From d155d9ec9e8211cbc99d00b6fadb1583dda613fb Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Fri, 17 Jul 2026 03:20:11 +0000 Subject: [PATCH] Configurations: 'specification/compute/resource-manager/Microsoft.Compute/Bulkactions/tspconfig.yaml', and CommitSHA: '5c99613e9a48fae7fc92e8d7178c2124319fe954' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6576926 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../CHANGELOG.md | 3 +- .../README.md | 2 +- .../SAMPLE.md | 1189 ++++++++++++- .../pom.xml | 3 +- .../ComputeBulkActionsManager.java | 18 + .../ComputeBulkActionsManagementClient.java | 7 + .../LaunchBulkInstancesOperationsClient.java | 350 ++++ .../VirtualMachineBulkOperationsClient.java | 168 ++ ...ledgeBulkOperationErrorsResponseInner.java | 117 ++ .../models/CancelOperationsResponseInner.java | 8 +- .../CreateResourceOperationResponseInner.java | 131 ++ ...llocateResourceOperationResponseInner.java | 8 +- .../DeleteResourceOperationResponseInner.java | 8 +- .../GetOperationStatusResponseInner.java | 8 +- ...bernateResourceOperationResponseInner.java | 8 +- ...asedLaunchBulkInstancesOperationInner.java | 277 +++ .../models/OperationStatusResultInner.java | 222 +++ ...ReimageResourceOperationResponseInner.java | 131 ++ .../fluent/models/ResourceOperationInner.java | 145 ++ .../StartResourceOperationResponseInner.java | 8 +- .../fluent/models/VirtualMachineInner.java | 144 ++ ...wledgeBulkOperationErrorsResponseImpl.java | 57 + .../CancelOperationsResponseImpl.java | 8 +- ...omputeBulkActionsManagementClientImpl.java | 18 +- .../CreateResourceOperationResponseImpl.java | 56 + ...allocateResourceOperationResponseImpl.java | 8 +- .../DeleteResourceOperationResponseImpl.java | 8 +- .../GetOperationStatusResponseImpl.java | 8 +- ...ibernateResourceOperationResponseImpl.java | 8 +- ...unchBulkInstancesOperationsClientImpl.java | 1583 +++++++++++++++++ .../LaunchBulkInstancesOperationsImpl.java | 218 +++ ...BasedLaunchBulkInstancesOperationImpl.java | 192 ++ .../OperationStatusResultImpl.java | 76 + .../ReimageResourceOperationResponseImpl.java | 56 + .../implementation/ResourceOperationImpl.java | 50 + .../StartResourceOperationResponseImpl.java | 8 +- ...irtualMachineBulkOperationsClientImpl.java | 662 +++++++ .../VirtualMachineBulkOperationsImpl.java | 102 ++ .../implementation/VirtualMachineImpl.java | 50 + ...aunchBulkInstancesOperationListResult.java | 98 + .../ListBulkOperationErrorsResponse.java | 97 + .../models/VirtualMachineListResult.java | 96 + .../models/AcceleratorManufacturer.java | 56 + .../bulkactions/models/AcceleratorType.java | 51 + ...AcknowledgeBulkOperationErrorsRequest.java | 90 + ...cknowledgeBulkOperationErrorsResponse.java | 43 + .../models/AdditionalCapabilities.java | 119 ++ .../models/AdditionalUnattendContent.java | 183 ++ ...dditionalUnattendContentComponentName.java | 51 + .../AdditionalUnattendContentPassName.java | 51 + .../bulkactions/models/AllInstancesDown.java | 88 + .../models/AllocationStrategy.java | 56 + .../models/ApiEntityReference.java | 87 + .../compute/bulkactions/models/ApiError.java | 144 ++ .../bulkactions/models/ApiErrorBase.java | 108 ++ .../models/ApplicationProfile.java | 89 + .../bulkactions/models/ArchitectureType.java | 51 + .../bulkactions/models/BootDiagnostics.java | 118 ++ .../BulkActionVmExtensionProperties.java | 415 +++++ .../models/BulkactionVMExtension.java | 114 ++ .../models/BulkactionVMProperties.java | 526 ++++++ .../bulkactions/models/CachingTypes.java | 57 + .../models/CapacityReservationProfile.java | 91 + .../bulkactions/models/CapacityType.java | 54 + .../bulkactions/models/ComputeProfile.java | 158 ++ .../bulkactions/models/CpuManufacturer.java | 61 + .../CreateResourceOperationResponse.java | 49 + .../compute/bulkactions/models/DataDisk.java | 459 +++++ .../bulkactions/models/DeleteOptions.java | 51 + .../models/DiagnosticsProfile.java | 94 + .../bulkactions/models/DiffDiskOptions.java | 46 + .../bulkactions/models/DiffDiskPlacement.java | 61 + .../bulkactions/models/DiffDiskSettings.java | 120 ++ .../models/DiskControllerTypes.java | 56 + .../models/DiskCreateOptionTypes.java | 72 + .../models/DiskDeleteOptionTypes.java | 54 + .../models/DiskDetachOptionTypes.java | 52 + .../DiskEncryptionSetParametersContent.java | 72 + .../models/DiskEncryptionSettings.java | 143 ++ .../models/DistributionStrategy.java | 61 + .../models/DomainNameLabelScopeTypes.java | 63 + .../models/EncryptionIdentity.java | 87 + .../models/EventGridAndResourceGraph.java | 117 ++ .../bulkactions/models/EvictionPolicy.java | 51 + .../models/ExecuteCreateContent.java | 115 ++ .../models/ExecuteDeallocateContent.java | 31 + .../models/ExecuteDeleteContent.java | 31 + .../models/ExecuteHibernateContent.java | 31 + .../models/ExecuteReimageRequest.java | 173 ++ .../models/ExecuteStartContent.java | 31 + .../models/ExecuteVdiCreateRequest.java | 115 ++ .../models/ExecutionParameters.java | 31 + .../bulkactions/models/FlexProperties.java | 204 +++ .../bulkactions/models/HardwareProfile.java | 148 ++ .../models/HostEndpointSettings.java | 128 ++ .../bulkactions/models/HyperVGeneration.java | 51 + .../bulkactions/models/IPVersions.java | 52 + .../bulkactions/models/ImageReference.java | 269 +++ .../bulkactions/models/InnerError.java | 91 + .../models/KeyVaultKeyReference.java | 115 ++ .../models/KeyVaultSecretReference.java | 115 ++ ...aunchBulkInstancesOperationProperties.java | 330 ++++ .../models/LaunchBulkInstancesOperations.java | 253 +++ .../models/LinuxConfiguration.java | 209 +++ .../models/LinuxPatchAssessmentMode.java | 54 + .../models/LinuxPatchSettings.java | 167 ++ ...PatchAutomaticByPlatformRebootSetting.java | 62 + ...GuestPatchAutomaticByPlatformSettings.java | 124 ++ .../models/LinuxVMGuestPatchMode.java | 55 + .../models/LocalStorageDiskType.java | 51 + ...tionBasedLaunchBulkInstancesOperation.java | 345 ++++ .../models/ManagedDiskParametersContent.java | 161 ++ .../models/ManagedServiceIdentity.java | 154 ++ .../models/ManagedServiceIdentityType.java | 62 + .../compute/bulkactions/models/Mode.java | 53 + .../compute/bulkactions/models/Modes.java | 58 + .../bulkactions/models/NetworkApiVersion.java | 52 + .../models/NetworkInterfaceAuxiliaryMode.java | 56 + .../models/NetworkInterfaceAuxiliarySku.java | 66 + .../models/NetworkInterfaceReference.java | 98 + .../NetworkInterfaceReferenceProperties.java | 119 ++ .../bulkactions/models/NetworkProfile.java | 157 ++ .../compute/bulkactions/models/OSDisk.java | 431 +++++ .../models/OSImageNotificationProfile.java | 119 ++ .../compute/bulkactions/models/OSProfile.java | 411 +++++ .../models/OSProfileProvisioningData.java | 164 ++ .../models/OperatingSystemTypes.java | 52 + .../models/OperationStatusResult.java | 86 + .../compute/bulkactions/models/OsType.java | 51 + .../bulkactions/models/PatchSettings.java | 210 +++ .../compute/bulkactions/models/Plan.java | 203 +++ .../bulkactions/models/PriorityProfile.java | 175 ++ .../bulkactions/models/PriorityType.java | 51 + .../bulkactions/models/ProtocolTypes.java | 51 + .../bulkactions/models/ProvisioningState.java | 66 + .../models/ProxyAgentSettings.java | 242 +++ .../models/PublicIPAddressSku.java | 113 ++ .../models/PublicIPAddressSkuName.java | 51 + .../models/PublicIPAddressSkuTier.java | 51 + .../models/PublicIPAllocationMethod.java | 51 + .../bulkactions/models/ReimagePayload.java | 117 ++ .../ReimageResourceOperationResponse.java | 49 + .../models/ReimageResourceOverride.java | 114 ++ .../models/ResourceNotificationDetails.java | 74 + .../bulkactions/models/ResourceOperation.java | 107 +- .../models/ResourceOperationDetails.java | 18 + .../models/ResourceOperationType.java | 6 + .../models/ResourceProvisionPayload.java | 200 +++ .../models/ResourceProvisionVdiPayload.java | 228 +++ .../models/ResourceWithContext.java | 114 ++ .../models/ResourcesWithContext.java | 89 + ...uledEventsAdditionalPublishingTargets.java | 91 + .../models/ScheduledEventsPolicy.java | 180 ++ .../models/ScheduledEventsProfile.java | 117 ++ .../models/SecurityEncryptionTypes.java | 58 + .../bulkactions/models/SecurityProfile.java | 218 +++ .../bulkactions/models/SecurityTypes.java | 52 + .../bulkactions/models/SettingNames.java | 52 + .../bulkactions/models/SshConfiguration.java | 87 + .../bulkactions/models/SshPublicKey.java | 122 ++ .../models/StorageAccountTypes.java | 82 + .../bulkactions/models/StorageProfile.java | 204 +++ .../models/TerminateNotificationProfile.java | 119 ++ .../bulkactions/models/UefiSettings.java | 118 ++ .../models/UserAssignedIdentity.java | 89 + .../models/UserInitiatedReboot.java | 89 + .../models/UserInitiatedRedeploy.java | 89 + .../models/VMAttributeMinMaxDouble.java | 113 ++ .../models/VMAttributeMinMaxInteger.java | 114 ++ .../models/VMAttributeSupport.java | 57 + .../bulkactions/models/VMAttributes.java | 776 ++++++++ .../bulkactions/models/VMCategory.java | 81 + .../models/VMDiskSecurityProfile.java | 128 ++ .../models/VMGalleryApplication.java | 240 +++ .../bulkactions/models/VMOperationStatus.java | 77 + .../bulkactions/models/VaultCertificate.java | 150 ++ .../bulkactions/models/VaultSecretGroup.java | 120 ++ .../bulkactions/models/VirtualHardDisk.java | 85 + .../bulkactions/models/VirtualMachine.java | 56 + .../models/VirtualMachineBulkOperations.java | 150 ++ .../models/VirtualMachineInfo.java | 91 + .../models/VirtualMachineIpTag.java | 113 ++ ...lMachineNetworkInterfaceConfiguration.java | 150 ++ ...tworkInterfaceConfigurationProperties.java | 429 +++++ ...workInterfaceDnsSettingsConfiguration.java | 90 + ...achineNetworkInterfaceIPConfiguration.java | 118 ++ ...orkInterfaceIPConfigurationProperties.java | 297 ++++ ...alMachinePublicIPAddressConfiguration.java | 178 ++ ...ublicIPAddressConfigurationProperties.java | 274 +++ ...blicIPAddressDnsSettingsConfiguration.java | 130 ++ .../VirtualMachineReimageParameters.java | 148 ++ .../bulkactions/models/VmSizeProfile.java | 114 ++ .../bulkactions/models/VmSizeProperties.java | 133 ++ .../models/WinRMConfiguration.java | 87 + .../bulkactions/models/WinRMListener.java | 139 ++ .../models/WindowsConfiguration.java | 258 +++ .../models/WindowsPatchAssessmentMode.java | 54 + ...PatchAutomaticByPlatformRebootSetting.java | 62 + ...GuestPatchAutomaticByPlatformSettings.java | 125 ++ .../models/WindowsVMGuestPatchMode.java | 63 + .../models/ZoneAllocationPolicy.java | 119 ++ .../bulkactions/models/ZonePreference.java | 114 ++ ...emanager-compute-bulkactions_metadata.json | 2 +- .../proxy-config.json | 2 +- ...chBulkInstancesOperationCancelSamples.java | 25 + ...stancesOperationCreateOrUpdateSamples.java | 477 +++++ ...chBulkInstancesOperationDeleteSamples.java | 25 + ...cesOperationGetOperationStatusSamples.java | 25 + ...aunchBulkInstancesOperationGetSamples.java | 25 + ...esOperationListByResourceGroupSamples.java | 38 + ...cesOperationListBySubscriptionSamples.java | 36 + ...esOperationListVirtualMachinesSamples.java | 25 + .../generated/OperationsListSamples.java | 12 +- ...BulkAcknowledgeOperationErrorsSamples.java | 49 + ...OperationsBulkCancelOperationsSamples.java | 20 +- ...kOperationsBulkCreateOperationSamples.java | 112 ++ ...rationsBulkDeallocateOperationSamples.java | 28 +- ...kOperationsBulkDeleteOperationSamples.java | 28 +- ...rationsBulkGetOperationsStatusSamples.java | 20 +- ...erationsBulkHibernateOperationSamples.java | 37 +- ...rationsBulkListOperationErrorsSamples.java | 38 + ...OperationsBulkReimageOperationSamples.java | 52 + ...lkOperationsBulkStartOperationSamples.java | 37 +- ...ionsBulkVdiFlexCreateOperationSamples.java | 139 ++ ...wledgeBulkOperationErrorsRequestTests.java | 27 + ...BulkOperationErrorsResponseInnerTests.java | 21 + .../AdditionalCapabilitiesTests.java | 28 + .../AdditionalUnattendContentTests.java | 41 + .../generated/AllInstancesDownTests.java | 25 + .../generated/ApiEntityReferenceTests.java | 25 + .../generated/ApplicationProfileTests.java | 56 + .../generated/BootDiagnosticsTests.java | 27 + .../CancelOperationsContentTests.java | 10 +- .../CapacityReservationProfileTests.java | 28 + .../bulkactions/generated/DataDiskTests.java | 89 + .../generated/DiagnosticsProfileTests.java | 30 + .../generated/DiffDiskSettingsTests.java | 30 + ...skEncryptionSetParametersContentTests.java | 25 + .../generated/EncryptionIdentityTests.java | 25 + .../EventGridAndResourceGraphTests.java | 29 + .../generated/ExecuteCreateContentTests.java | 80 + .../ExecuteDeallocateContentTests.java | 24 +- .../generated/ExecuteDeleteContentTests.java | 35 +- .../ExecuteHibernateContentTests.java | 35 +- .../generated/ExecuteStartContentTests.java | 38 +- .../ExecuteVdiCreateRequestTests.java | 137 ++ .../generated/ExecutionParametersTests.java | 22 +- .../generated/FlexPropertiesTests.java | 70 + .../GetOperationStatusContentTests.java | 11 +- .../generated/HardwareProfileTests.java | 32 + .../generated/HostEndpointSettingsTests.java | 30 + .../generated/ImageReferenceTests.java | 44 + .../generated/InnerErrorTests.java | 19 + .../generated/LinuxPatchSettingsTests.java | 42 + ...PatchAutomaticByPlatformSettingsTests.java | 31 + .../ManagedDiskParametersContentTests.java | 46 + .../ManagedServiceIdentityTests.java | 44 + ...workInterfaceReferencePropertiesTests.java | 30 + .../NetworkInterfaceReferenceTests.java | 34 + .../generated/NetworkProfileTests.java | 127 ++ .../OSImageNotificationProfileTests.java | 29 + .../generated/OperationsListMockTests.java | 2 +- .../generated/PatchSettingsTests.java | 45 + .../generated/PriorityProfileTests.java | 38 + .../generated/PublicIPAddressSkuTests.java | 30 + .../ResourceNotificationDetailsTests.java | 18 + .../ResourceProvisionPayloadTests.java | 55 + .../ResourceProvisionVdiPayloadTests.java | 110 ++ .../generated/ResourceWithContextTests.java | 29 + .../bulkactions/generated/ResourcesTests.java | 9 +- .../generated/ResourcesWithContextTests.java | 31 + .../generated/RetryPolicyTests.java | 21 +- ...ventsAdditionalPublishingTargetsTests.java | 32 + .../generated/ScheduledEventsPolicyTests.java | 47 + .../ScheduledEventsProfileTests.java | 38 + .../TerminateNotificationProfileTests.java | 29 + .../generated/UefiSettingsTests.java | 27 + .../generated/UserAssignedIdentityTests.java | 22 + .../generated/UserInitiatedRebootTests.java | 25 + .../generated/UserInitiatedRedeployTests.java | 25 + .../VMAttributeMinMaxDoubleTests.java | 28 + .../VMAttributeMinMaxIntegerTests.java | 27 + .../generated/VMAttributesTests.java | 123 ++ .../generated/VMDiskSecurityProfileTests.java | 32 + .../generated/VMGalleryApplicationTests.java | 41 + .../generated/VaultCertificateTests.java | 29 + .../generated/VaultSecretGroupTests.java | 36 + .../generated/VirtualHardDiskTests.java | 24 + ...eOperationErrorsWithResponseMockTests.java | 46 + .../generated/VirtualMachineInfoTests.java | 19 + .../generated/VirtualMachineIpTagTests.java | 27 + ...InterfaceConfigurationPropertiesTests.java | 274 +++ ...ineNetworkInterfaceConfigurationTests.java | 180 ++ ...nterfaceDnsSettingsConfigurationTests.java | 29 + ...terfaceIPConfigurationPropertiesTests.java | 126 ++ ...eNetworkInterfaceIPConfigurationTests.java | 138 ++ ...IPAddressConfigurationPropertiesTests.java | 63 + ...hinePublicIPAddressConfigurationTests.java | 94 + ...PAddressDnsSettingsConfigurationTests.java | 31 + .../generated/VmSizeProfileTests.java | 27 + .../generated/VmSizePropertiesTests.java | 27 + .../generated/WinRMConfigurationTests.java | 32 + .../generated/WinRMListenerTests.java | 28 + .../generated/WindowsConfigurationTests.java | 95 + ...PatchAutomaticByPlatformSettingsTests.java | 31 + .../generated/ZoneAllocationPolicyTests.java | 35 + .../generated/ZonePreferenceTests.java | 27 + .../tsp-location.yaml | 2 +- 308 files changed, 30897 insertions(+), 429 deletions(-) create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/LaunchBulkInstancesOperationsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/AcknowledgeBulkOperationErrorsResponseInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/CreateResourceOperationResponseInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/LocationBasedLaunchBulkInstancesOperationInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/OperationStatusResultInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/ReimageResourceOperationResponseInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/ResourceOperationInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/VirtualMachineInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/AcknowledgeBulkOperationErrorsResponseImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/CreateResourceOperationResponseImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/LaunchBulkInstancesOperationsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/LaunchBulkInstancesOperationsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/LocationBasedLaunchBulkInstancesOperationImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/OperationStatusResultImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/ReimageResourceOperationResponseImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/ResourceOperationImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/VirtualMachineImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/models/LaunchBulkInstancesOperationListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/models/ListBulkOperationErrorsResponse.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/models/VirtualMachineListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AcceleratorManufacturer.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AcceleratorType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AcknowledgeBulkOperationErrorsRequest.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AcknowledgeBulkOperationErrorsResponse.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AdditionalCapabilities.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AdditionalUnattendContent.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AdditionalUnattendContentComponentName.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AdditionalUnattendContentPassName.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AllInstancesDown.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AllocationStrategy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ApiEntityReference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ApiError.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ApiErrorBase.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ApplicationProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ArchitectureType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/BootDiagnostics.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/BulkActionVmExtensionProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/BulkactionVMExtension.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/BulkactionVMProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CachingTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CapacityReservationProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CapacityType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ComputeProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CpuManufacturer.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CreateResourceOperationResponse.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DataDisk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DeleteOptions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiagnosticsProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiffDiskOptions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiffDiskPlacement.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiffDiskSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskControllerTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskCreateOptionTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskDeleteOptionTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskDetachOptionTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskEncryptionSetParametersContent.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskEncryptionSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DistributionStrategy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DomainNameLabelScopeTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/EncryptionIdentity.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/EventGridAndResourceGraph.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/EvictionPolicy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteCreateContent.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteReimageRequest.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteVdiCreateRequest.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/FlexProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/HardwareProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/HostEndpointSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/HyperVGeneration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/IPVersions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ImageReference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/InnerError.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/KeyVaultKeyReference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/KeyVaultSecretReference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LaunchBulkInstancesOperationProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LaunchBulkInstancesOperations.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxPatchAssessmentMode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxPatchSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxVMGuestPatchAutomaticByPlatformRebootSetting.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxVMGuestPatchAutomaticByPlatformSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxVMGuestPatchMode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LocalStorageDiskType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LocationBasedLaunchBulkInstancesOperation.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ManagedDiskParametersContent.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ManagedServiceIdentity.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ManagedServiceIdentityType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Mode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Modes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkApiVersion.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkInterfaceAuxiliaryMode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkInterfaceAuxiliarySku.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkInterfaceReference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkInterfaceReferenceProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OSDisk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OSImageNotificationProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OSProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OSProfileProvisioningData.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OperatingSystemTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OperationStatusResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OsType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PatchSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Plan.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PriorityProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PriorityType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ProtocolTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ProvisioningState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ProxyAgentSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PublicIPAddressSku.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PublicIPAddressSkuName.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PublicIPAddressSkuTier.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PublicIPAllocationMethod.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ReimagePayload.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ReimageResourceOperationResponse.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ReimageResourceOverride.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceNotificationDetails.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceProvisionPayload.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceProvisionVdiPayload.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceWithContext.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourcesWithContext.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ScheduledEventsAdditionalPublishingTargets.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ScheduledEventsPolicy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ScheduledEventsProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SecurityEncryptionTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SecurityProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SecurityTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SettingNames.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SshConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SshPublicKey.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/StorageAccountTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/StorageProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/TerminateNotificationProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/UefiSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/UserAssignedIdentity.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/UserInitiatedReboot.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/UserInitiatedRedeploy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMAttributeMinMaxDouble.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMAttributeMinMaxInteger.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMAttributeSupport.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMAttributes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMCategory.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMDiskSecurityProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMGalleryApplication.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMOperationStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VaultCertificate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VaultSecretGroup.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualHardDisk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachine.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineInfo.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineIpTag.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceConfigurationProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceDnsSettingsConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceIPConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceIPConfigurationProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachinePublicIPAddressConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachinePublicIPAddressConfigurationProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachinePublicIPAddressDnsSettingsConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineReimageParameters.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VmSizeProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VmSizeProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WinRMConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WinRMListener.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsPatchAssessmentMode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsVMGuestPatchAutomaticByPlatformRebootSetting.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsVMGuestPatchMode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ZoneAllocationPolicy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ZonePreference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationCancelSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationGetOperationStatusSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationListByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationListBySubscriptionSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationListVirtualMachinesSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkAcknowledgeOperationErrorsSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkCreateOperationSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkListOperationErrorsSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkReimageOperationSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkVdiFlexCreateOperationSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/AcknowledgeBulkOperationErrorsRequestTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/AcknowledgeBulkOperationErrorsResponseInnerTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/AdditionalCapabilitiesTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/AdditionalUnattendContentTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/AllInstancesDownTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ApiEntityReferenceTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ApplicationProfileTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/BootDiagnosticsTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/CapacityReservationProfileTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/DataDiskTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/DiagnosticsProfileTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/DiffDiskSettingsTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/DiskEncryptionSetParametersContentTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/EncryptionIdentityTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/EventGridAndResourceGraphTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteCreateContentTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteVdiCreateRequestTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/FlexPropertiesTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/HardwareProfileTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/HostEndpointSettingsTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ImageReferenceTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/InnerErrorTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/LinuxPatchSettingsTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/LinuxVMGuestPatchAutomaticByPlatformSettingsTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ManagedDiskParametersContentTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ManagedServiceIdentityTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/NetworkInterfaceReferencePropertiesTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/NetworkInterfaceReferenceTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/NetworkProfileTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/OSImageNotificationProfileTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/PatchSettingsTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/PriorityProfileTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/PublicIPAddressSkuTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourceNotificationDetailsTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourceProvisionPayloadTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourceProvisionVdiPayloadTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourceWithContextTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourcesWithContextTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ScheduledEventsAdditionalPublishingTargetsTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ScheduledEventsPolicyTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ScheduledEventsProfileTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/TerminateNotificationProfileTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/UefiSettingsTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/UserAssignedIdentityTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/UserInitiatedRebootTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/UserInitiatedRedeployTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VMAttributeMinMaxDoubleTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VMAttributeMinMaxIntegerTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VMAttributesTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VMDiskSecurityProfileTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VMGalleryApplicationTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VaultCertificateTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VaultSecretGroupTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualHardDiskTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkAcknowledgeOperationErrorsWithResponseMockTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineInfoTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineIpTagTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineNetworkInterfaceConfigurationPropertiesTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineNetworkInterfaceConfigurationTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineNetworkInterfaceDnsSettingsConfigurationTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineNetworkInterfaceIPConfigurationPropertiesTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineNetworkInterfaceIPConfigurationTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachinePublicIPAddressConfigurationPropertiesTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachinePublicIPAddressConfigurationTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachinePublicIPAddressDnsSettingsConfigurationTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VmSizeProfileTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VmSizePropertiesTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/WinRMConfigurationTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/WinRMListenerTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/WindowsConfigurationTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/WindowsVMGuestPatchAutomaticByPlatformSettingsTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ZoneAllocationPolicyTests.java create mode 100644 sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ZonePreferenceTests.java diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/CHANGELOG.md b/sdk/compute/azure-resourcemanager-compute-bulkactions/CHANGELOG.md index 0a05babf8f09..2283b7b33aa6 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/CHANGELOG.md +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.1 (2026-07-01) +## 1.0.0-beta.1 (2026-07-17) +- Azure Resource Manager Compute BulkActions client library for Java. This package contains Microsoft Azure SDK for Compute BulkActions Management SDK. Package api-version 2026-07-06-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). - Azure Resource Manager Compute BulkActions client library for Java. This package contains Microsoft Azure SDK for Compute BulkActions Management SDK. Package api-version 2026-06-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/README.md b/sdk/compute/azure-resourcemanager-compute-bulkactions/README.md index a722a2568faa..0e0f80388f08 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/README.md +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Compute BulkActions client library for Java. -This package contains Microsoft Azure SDK for Compute BulkActions Management SDK. Package api-version 2026-06-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Compute BulkActions Management SDK. Package api-version 2026-07-06-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/SAMPLE.md b/sdk/compute/azure-resourcemanager-compute-bulkactions/SAMPLE.md index c59f50bf6f75..c4f2056bc44e 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/SAMPLE.md +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/SAMPLE.md @@ -1,18 +1,702 @@ # Code snippets and samples +## LaunchBulkInstancesOperation + +- [Cancel](#launchbulkinstancesoperation_cancel) +- [CreateOrUpdate](#launchbulkinstancesoperation_createorupdate) +- [Delete](#launchbulkinstancesoperation_delete) +- [Get](#launchbulkinstancesoperation_get) +- [GetOperationStatus](#launchbulkinstancesoperation_getoperationstatus) +- [ListByResourceGroup](#launchbulkinstancesoperation_listbyresourcegroup) +- [ListBySubscription](#launchbulkinstancesoperation_listbysubscription) +- [ListVirtualMachines](#launchbulkinstancesoperation_listvirtualmachines) + ## Operations - [List](#operations_list) ## VirtualMachineBulkOperations +- [BulkAcknowledgeOperationErrors](#virtualmachinebulkoperations_bulkacknowledgeoperationerrors) - [BulkCancelOperations](#virtualmachinebulkoperations_bulkcanceloperations) +- [BulkCreateOperation](#virtualmachinebulkoperations_bulkcreateoperation) - [BulkDeallocateOperation](#virtualmachinebulkoperations_bulkdeallocateoperation) - [BulkDeleteOperation](#virtualmachinebulkoperations_bulkdeleteoperation) - [BulkGetOperationsStatus](#virtualmachinebulkoperations_bulkgetoperationsstatus) - [BulkHibernateOperation](#virtualmachinebulkoperations_bulkhibernateoperation) +- [BulkListOperationErrors](#virtualmachinebulkoperations_bulklistoperationerrors) +- [BulkReimageOperation](#virtualmachinebulkoperations_bulkreimageoperation) - [BulkStartOperation](#virtualmachinebulkoperations_bulkstartoperation) +- [BulkVdiFlexCreateOperation](#virtualmachinebulkoperations_bulkvdiflexcreateoperation) +### LaunchBulkInstancesOperation_Cancel + +```java +/** + * Samples for LaunchBulkInstancesOperation Cancel. + */ +public final class LaunchBulkInstancesOperationCancelSamples { + /* + * x-ms-original-file: 2026-07-06-preview/LaunchBulkInstancesOperation_Cancel_MaximumSet_Gen.json + */ + /** + * Sample code: LaunchBulkInstancesOperation_Cancel_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void launchBulkInstancesOperationCancelExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.launchBulkInstancesOperations() + .cancel("rgBulkactions", "useast2euap", "434d5a2a-167a-4e26-a89c-fbe622dfd0bc", + com.azure.core.util.Context.NONE); + } +} +``` + +### LaunchBulkInstancesOperation_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.bulkactions.models.AcceleratorManufacturer; +import com.azure.resourcemanager.compute.bulkactions.models.AcceleratorType; +import com.azure.resourcemanager.compute.bulkactions.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.bulkactions.models.AdditionalUnattendContent; +import com.azure.resourcemanager.compute.bulkactions.models.AdditionalUnattendContentComponentName; +import com.azure.resourcemanager.compute.bulkactions.models.AdditionalUnattendContentPassName; +import com.azure.resourcemanager.compute.bulkactions.models.AllInstancesDown; +import com.azure.resourcemanager.compute.bulkactions.models.AllocationStrategy; +import com.azure.resourcemanager.compute.bulkactions.models.ApiEntityReference; +import com.azure.resourcemanager.compute.bulkactions.models.ApplicationProfile; +import com.azure.resourcemanager.compute.bulkactions.models.ArchitectureType; +import com.azure.resourcemanager.compute.bulkactions.models.BootDiagnostics; +import com.azure.resourcemanager.compute.bulkactions.models.BulkActionVmExtensionProperties; +import com.azure.resourcemanager.compute.bulkactions.models.BulkactionVMExtension; +import com.azure.resourcemanager.compute.bulkactions.models.BulkactionVMProperties; +import com.azure.resourcemanager.compute.bulkactions.models.CachingTypes; +import com.azure.resourcemanager.compute.bulkactions.models.CapacityReservationProfile; +import com.azure.resourcemanager.compute.bulkactions.models.CapacityType; +import com.azure.resourcemanager.compute.bulkactions.models.ComputeProfile; +import com.azure.resourcemanager.compute.bulkactions.models.CpuManufacturer; +import com.azure.resourcemanager.compute.bulkactions.models.DataDisk; +import com.azure.resourcemanager.compute.bulkactions.models.DeleteOptions; +import com.azure.resourcemanager.compute.bulkactions.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.bulkactions.models.DiffDiskOptions; +import com.azure.resourcemanager.compute.bulkactions.models.DiffDiskPlacement; +import com.azure.resourcemanager.compute.bulkactions.models.DiffDiskSettings; +import com.azure.resourcemanager.compute.bulkactions.models.DiskControllerTypes; +import com.azure.resourcemanager.compute.bulkactions.models.DiskCreateOptionTypes; +import com.azure.resourcemanager.compute.bulkactions.models.DiskDeleteOptionTypes; +import com.azure.resourcemanager.compute.bulkactions.models.DiskDetachOptionTypes; +import com.azure.resourcemanager.compute.bulkactions.models.DiskEncryptionSetParametersContent; +import com.azure.resourcemanager.compute.bulkactions.models.DiskEncryptionSettings; +import com.azure.resourcemanager.compute.bulkactions.models.DistributionStrategy; +import com.azure.resourcemanager.compute.bulkactions.models.DomainNameLabelScopeTypes; +import com.azure.resourcemanager.compute.bulkactions.models.EncryptionIdentity; +import com.azure.resourcemanager.compute.bulkactions.models.EventGridAndResourceGraph; +import com.azure.resourcemanager.compute.bulkactions.models.EvictionPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.HardwareProfile; +import com.azure.resourcemanager.compute.bulkactions.models.HostEndpointSettings; +import com.azure.resourcemanager.compute.bulkactions.models.HyperVGeneration; +import com.azure.resourcemanager.compute.bulkactions.models.IPVersions; +import com.azure.resourcemanager.compute.bulkactions.models.ImageReference; +import com.azure.resourcemanager.compute.bulkactions.models.KeyVaultKeyReference; +import com.azure.resourcemanager.compute.bulkactions.models.KeyVaultSecretReference; +import com.azure.resourcemanager.compute.bulkactions.models.LaunchBulkInstancesOperationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.LinuxConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.LinuxPatchAssessmentMode; +import com.azure.resourcemanager.compute.bulkactions.models.LinuxPatchSettings; +import com.azure.resourcemanager.compute.bulkactions.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.compute.bulkactions.models.LinuxVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.compute.bulkactions.models.LinuxVMGuestPatchMode; +import com.azure.resourcemanager.compute.bulkactions.models.LocalStorageDiskType; +import com.azure.resourcemanager.compute.bulkactions.models.ManagedDiskParametersContent; +import com.azure.resourcemanager.compute.bulkactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.compute.bulkactions.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.compute.bulkactions.models.Mode; +import com.azure.resourcemanager.compute.bulkactions.models.Modes; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkApiVersion; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceAuxiliarySku; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceReference; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceReferenceProperties; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkProfile; +import com.azure.resourcemanager.compute.bulkactions.models.OSDisk; +import com.azure.resourcemanager.compute.bulkactions.models.OSImageNotificationProfile; +import com.azure.resourcemanager.compute.bulkactions.models.OSProfile; +import com.azure.resourcemanager.compute.bulkactions.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.bulkactions.models.PatchSettings; +import com.azure.resourcemanager.compute.bulkactions.models.Plan; +import com.azure.resourcemanager.compute.bulkactions.models.PriorityProfile; +import com.azure.resourcemanager.compute.bulkactions.models.PriorityType; +import com.azure.resourcemanager.compute.bulkactions.models.ProtocolTypes; +import com.azure.resourcemanager.compute.bulkactions.models.ProxyAgentSettings; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSku; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSkuName; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSkuTier; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAllocationMethod; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType; +import com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.ScheduledEventsAdditionalPublishingTargets; +import com.azure.resourcemanager.compute.bulkactions.models.ScheduledEventsPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.ScheduledEventsProfile; +import com.azure.resourcemanager.compute.bulkactions.models.SecurityEncryptionTypes; +import com.azure.resourcemanager.compute.bulkactions.models.SecurityProfile; +import com.azure.resourcemanager.compute.bulkactions.models.SecurityTypes; +import com.azure.resourcemanager.compute.bulkactions.models.SettingNames; +import com.azure.resourcemanager.compute.bulkactions.models.SshConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.SshPublicKey; +import com.azure.resourcemanager.compute.bulkactions.models.StorageAccountTypes; +import com.azure.resourcemanager.compute.bulkactions.models.StorageProfile; +import com.azure.resourcemanager.compute.bulkactions.models.TerminateNotificationProfile; +import com.azure.resourcemanager.compute.bulkactions.models.UefiSettings; +import com.azure.resourcemanager.compute.bulkactions.models.UserAssignedIdentity; +import com.azure.resourcemanager.compute.bulkactions.models.UserInitiatedReboot; +import com.azure.resourcemanager.compute.bulkactions.models.UserInitiatedRedeploy; +import com.azure.resourcemanager.compute.bulkactions.models.VMAttributeMinMaxDouble; +import com.azure.resourcemanager.compute.bulkactions.models.VMAttributeMinMaxInteger; +import com.azure.resourcemanager.compute.bulkactions.models.VMAttributeSupport; +import com.azure.resourcemanager.compute.bulkactions.models.VMAttributes; +import com.azure.resourcemanager.compute.bulkactions.models.VMCategory; +import com.azure.resourcemanager.compute.bulkactions.models.VMDiskSecurityProfile; +import com.azure.resourcemanager.compute.bulkactions.models.VMGalleryApplication; +import com.azure.resourcemanager.compute.bulkactions.models.VaultCertificate; +import com.azure.resourcemanager.compute.bulkactions.models.VaultSecretGroup; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualHardDisk; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineIpTag; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceConfigurationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceDnsSettingsConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceIPConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceIPConfigurationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressConfigurationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressDnsSettingsConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VmSizeProfile; +import com.azure.resourcemanager.compute.bulkactions.models.VmSizeProperties; +import com.azure.resourcemanager.compute.bulkactions.models.WinRMConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.WinRMListener; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsPatchAssessmentMode; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsVMGuestPatchMode; +import com.azure.resourcemanager.compute.bulkactions.models.ZoneAllocationPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.ZonePreference; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LaunchBulkInstancesOperation CreateOrUpdate. + */ +public final class LaunchBulkInstancesOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-07-06-preview/LaunchBulkInstancesOperation_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: LaunchBulkInstancesOperation_CreateOrUpdate_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void launchBulkInstancesOperationCreateOrUpdateExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.launchBulkInstancesOperations() + .define("4ad45156-c829-4cd4-aafa-ecabe28aa029") + .withExistingLocation("rgBulkactions", "useast2euap") + .withTags(mapOf("key1909", "fakeTokenPlaceholder")) + .withProperties(new LaunchBulkInstancesOperationProperties().withCapacity(21) + .withCapacityType(CapacityType.VM) + .withPriorityProfile(new PriorityProfile().withType(PriorityType.REGULAR) + .withMaxPricePerVM(23.0D) + .withEvictionPolicy(EvictionPolicy.DELETE) + .withAllocationStrategy(AllocationStrategy.LOWEST_PRICE)) + .withVmSizesProfile(Arrays.asList(new VmSizeProfile().withName("frbnnpdkq").withRank(7))) + .withVmAttributes(new VMAttributes().withVCpuCount(new VMAttributeMinMaxInteger().withMin(0).withMax(0)) + .withMemoryInGiB(new VMAttributeMinMaxDouble().withMin(0.0D).withMax(0.0D)) + .withArchitectureTypes(Arrays.asList(ArchitectureType.ARM64)) + .withMemoryInGiBPerVCpu(new VMAttributeMinMaxDouble().withMin(0.0D).withMax(0.0D)) + .withLocalStorageSupport(VMAttributeSupport.EXCLUDED) + .withLocalStorageInGiB(new VMAttributeMinMaxDouble().withMin(0.0D).withMax(0.0D)) + .withLocalStorageDiskTypes(Arrays.asList(LocalStorageDiskType.HDD)) + .withDataDiskCount(new VMAttributeMinMaxInteger().withMin(0).withMax(0)) + .withNetworkInterfaceCount(new VMAttributeMinMaxInteger().withMin(0).withMax(0)) + .withNetworkBandwidthInMbps(new VMAttributeMinMaxDouble().withMin(0.0D).withMax(0.0D)) + .withRdmaSupport(VMAttributeSupport.EXCLUDED) + .withRdmaNetworkInterfaceCount(new VMAttributeMinMaxInteger().withMin(0).withMax(0)) + .withAcceleratorSupport(VMAttributeSupport.EXCLUDED) + .withAcceleratorManufacturers(Arrays.asList(AcceleratorManufacturer.AMD)) + .withAcceleratorTypes(Arrays.asList(AcceleratorType.GPU)) + .withAcceleratorCount(new VMAttributeMinMaxInteger().withMin(0).withMax(0)) + .withVmCategories(Arrays.asList(VMCategory.GENERAL_PURPOSE)) + .withCpuManufacturers(Arrays.asList(CpuManufacturer.INTEL)) + .withHyperVGenerations(Arrays.asList(HyperVGeneration.GEN1)) + .withBurstableSupport(VMAttributeSupport.EXCLUDED) + .withAllowedVMSizes(Arrays.asList("dwcsrlrzrzzqleqivkzwpczpf", "dwcsrlrzrzzqleqivkzwpczpf", + "dwcsrlrzrzzqleqivkzwpczpf", "dwcsrlrzrzzqleqivkzwpczpf", "dwcsrlrzrzzqleqivkzwpczpf", + "dwcsrlrzrzzqleqivkzwpczpf", "dwcsrlrzrzzqleqivkzwpczpf")) + .withExcludedVMSizes(Arrays.asList("igehpnuaybwy", "igehpnuaybwy", "igehpnuaybwy", "igehpnuaybwy", + "igehpnuaybwy", "igehpnuaybwy", "igehpnuaybwy"))) + .withComputeProfile( + new ComputeProfile() + .withVirtualMachineProfile(new BulkactionVMProperties() + .withScheduledEventsPolicy(new ScheduledEventsPolicy() + .withUserInitiatedRedeploy( + new UserInitiatedRedeploy().withUserInitiatedRedeployAutomaticallyApprove(true)) + .withUserInitiatedReboot( + new UserInitiatedReboot().withUserInitiatedRebootAutomaticallyApprove(true)) + .withScheduledEventsAdditionalPublishingTargets( + new ScheduledEventsAdditionalPublishingTargets() + .withEventGridAndResourceGraph(new EventGridAndResourceGraph().withEnable(true) + .withScheduledEventsApiVersion("lifncbftlkounuyfn"))) + .withAllInstancesDown( + new AllInstancesDown().withAllInstancesDownAutomaticallyApprove(true))) + .withStorageProfile(new StorageProfile() + .withImageReference(new ImageReference() + .withId("cdbrkpdicibtlliq") + .withPublisher("ojlplghybdamadvsrq") + .withOffer("uvnqoxhkxefqwbsvjgbswqy") + .withSku("hajdxhjmlkx") + .withVersion("u") + .withSharedGalleryImageId("fz") + .withCommunityGalleryImageId("tsfpcq")) + .withOsDisk(new OSDisk().withOsType(OperatingSystemTypes.WINDOWS) + .withEncryptionSettings(new DiskEncryptionSettings() + .withDiskEncryptionKey( + new KeyVaultSecretReference().withSecretUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("lvzxxyypkeqlflftmfn"))) + .withKeyEncryptionKey( + new KeyVaultKeyReference().withKeyUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("lvzxxyypkeqlflftmfn"))) + .withEnabled(true)) + .withName("opogpznvctmraoajgizcyrfvpt") + .withVhd(new VirtualHardDisk().withUri("elpzggtxubepzgjqvdbjmbu")) + .withImage(new VirtualHardDisk().withUri("elpzggtxubepzgjqvdbjmbu")) + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withDiffDiskSettings(new DiffDiskSettings().withOption(DiffDiskOptions.LOCAL) + .withPlacement(DiffDiskPlacement.CACHE_DISK)) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiskSizeGB(2) + .withManagedDisk(new ManagedDiskParametersContent().withId("numddbqmkxuu") + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParametersContent().withId("magvkzhdmzhktjlqkkk")) + .withSecurityProfile(new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet(new DiskEncryptionSetParametersContent() + .withId("magvkzhdmzhktjlqkkk")))) + .withDeleteOption(DiskDeleteOptionTypes.DELETE)) + .withDataDisks(Arrays.asList(new DataDisk().withLun(7) + .withName("nbthfzqsxyqvqnbgcljxbwyyoj") + .withVhd(new VirtualHardDisk().withUri("elpzggtxubepzgjqvdbjmbu")) + .withImage(new VirtualHardDisk().withUri("elpzggtxubepzgjqvdbjmbu")) + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiskSizeGB(19) + .withManagedDisk(new ManagedDiskParametersContent().withId("numddbqmkxuu") + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParametersContent().withId("magvkzhdmzhktjlqkkk")) + .withSecurityProfile(new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet(new DiskEncryptionSetParametersContent() + .withId("magvkzhdmzhktjlqkkk")))) + .withSourceResource(new ApiEntityReference().withId("qnukyordmomtjjqabovlsxl")) + .withToBeDetached(true) + .withDetachOption(DiskDetachOptionTypes.FORCE_DETACH) + .withDeleteOption(DiskDeleteOptionTypes.DELETE))) + .withDiskControllerType(DiskControllerTypes.SCSI)) + .withHardwareProfile(new HardwareProfile().withVmSize("szrnjqwbruz") + .withVmSizeProperties( + new VmSizeProperties().withVCpusAvailable(24).withVCpusPerCore(6))) + .withAdditionalCapabilities( + new AdditionalCapabilities().withUltraSSDEnabled(true).withHibernationEnabled(true)) + .withOsProfile( + new OSProfile().withComputerName("bplxnfp") + .withAdminUsername("fxzbi") + .withAdminPassword("fakeTokenPlaceholder") + .withCustomData("hbdlirohsgnbrahscboc") + .withWindowsConfiguration(new WindowsConfiguration().withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withTimeZone("t") + .withAdditionalUnattendContent(Arrays.asList(new AdditionalUnattendContent() + .withPassName(AdditionalUnattendContentPassName.OOBE_SYSTEM) + .withComponentName( + AdditionalUnattendContentComponentName.MICROSOFT_WINDOWS_SHELL_SETUP) + .withSettingName(SettingNames.AUTO_LOGON) + .withContent("rguazthnx"))) + .withPatchSettings( + new PatchSettings().withPatchMode(WindowsVMGuestPatchMode.MANUAL) + .withEnableHotpatching(true) + .withAssessmentMode(WindowsPatchAssessmentMode.IMAGE_DEFAULT) + .withAutomaticByPlatformSettings( + new WindowsVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting( + WindowsVMGuestPatchAutomaticByPlatformRebootSetting.UNKNOWN) + .withBypassPlatformSafetyChecksOnUserSchedule(true))) + .withWinRM(new WinRMConfiguration().withListeners( + Arrays.asList(new WinRMListener().withProtocol(ProtocolTypes.HTTP) + .withCertificateUrl("quhfapfpyeeocwvwtvuggoqqwt"))))) + .withLinuxConfiguration(new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withPath("mrdfxnfjazxog") + .withKeyData("fakeTokenPlaceholder")))) + .withProvisionVMAgent(true) + .withPatchSettings( + new LinuxPatchSettings().withPatchMode(LinuxVMGuestPatchMode.IMAGE_DEFAULT) + .withAssessmentMode(LinuxPatchAssessmentMode.IMAGE_DEFAULT) + .withAutomaticByPlatformSettings( + new LinuxVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting( + LinuxVMGuestPatchAutomaticByPlatformRebootSetting.UNKNOWN) + .withBypassPlatformSafetyChecksOnUserSchedule(true))) + .withEnableVMAgentPlatformUpdates(true)) + .withSecrets(Arrays.asList(new VaultSecretGroup() + .withSourceVault(new SubResource().withId("lvzxxyypkeqlflftmfn")) + .withVaultCertificates(Arrays + .asList(new VaultCertificate().withCertificateUrl("crgbpfdvlohwkupdjp") + .withCertificateStore("hyx"))))) + .withAllowExtensionOperations(true) + .withRequireGuestProvisionSignal(true)) + .withNetworkProfile(new NetworkProfile() + .withNetworkInterfaces(Arrays + .asList(new NetworkInterfaceReference().withId("ymfxctb") + .withProperties(new NetworkInterfaceReferenceProperties() + .withPrimary(true) + .withDeleteOption(DeleteOptions.DELETE)))) + .withNetworkApiVersion(NetworkApiVersion.TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE) + .withNetworkInterfaceConfigurations(Arrays.asList( + new VirtualMachineNetworkInterfaceConfiguration().withName("qrkzoctmzjketostzabnra") + .withProperties(new VirtualMachineNetworkInterfaceConfigurationProperties() + .withPrimary(true) + .withDeleteOption(DeleteOptions.DELETE) + .withEnableAcceleratedNetworking(true) + .withDisableTcpStateTracking(true) + .withEnableFpga(true) + .withEnableIPForwarding(true) + .withNetworkSecurityGroup(new SubResource().withId("lvzxxyypkeqlflftmfn")) + .withDnsSettings( + new VirtualMachineNetworkInterfaceDnsSettingsConfiguration() + .withDnsServers(Arrays.asList("tqcqopnanyyiavfwhqbkarxtrfqbww"))) + .withIpConfigurations( + Arrays.asList(new VirtualMachineNetworkInterfaceIPConfiguration() + .withName("gqymuvgzzfmxqvdadx") + .withProperties( + new VirtualMachineNetworkInterfaceIPConfigurationProperties() + .withSubnet(new SubResource().withId("lvzxxyypkeqlflftmfn")) + .withPrimary(true) + .withPublicIPAddressConfiguration( + new VirtualMachinePublicIPAddressConfiguration() + .withName("cwxsqjijtwbsyqdwht") + .withProperties( + new VirtualMachinePublicIPAddressConfigurationProperties() + .withIdleTimeoutInMinutes(17) + .withDeleteOption(DeleteOptions.DELETE) + .withDnsSettings( + new VirtualMachinePublicIPAddressDnsSettingsConfiguration() + .withDomainNameLabel("fampou") + .withDomainNameLabelScope( + DomainNameLabelScopeTypes.TENANT_REUSE)) + .withIpTags( + Arrays.asList(new VirtualMachineIpTag() + .withIpTagType( + "hkjoxhqadudjartwooezaxl") + .withTag("xywunkjglkmmwfpf"))) + .withPublicIPPrefix(new SubResource() + .withId("lvzxxyypkeqlflftmfn")) + .withPublicIPAddressVersion(IPVersions.IPV4) + .withPublicIPAllocationMethod( + PublicIPAllocationMethod.DYNAMIC)) + .withSku(new PublicIPAddressSku() + .withName(PublicIPAddressSkuName.BASIC) + .withTier(PublicIPAddressSkuTier.REGIONAL)) + .withTags(mapOf("key5442", "fakeTokenPlaceholder"))) + .withPrivateIPAddressVersion(IPVersions.IPV4) + .withApplicationSecurityGroups(Arrays.asList( + new SubResource().withId("lvzxxyypkeqlflftmfn"))) + .withApplicationGatewayBackendAddressPools(Arrays.asList( + new SubResource().withId("lvzxxyypkeqlflftmfn"))) + .withLoadBalancerBackendAddressPools(Arrays.asList( + new SubResource().withId("lvzxxyypkeqlflftmfn")))))) + .withDscpConfiguration(new SubResource().withId("lvzxxyypkeqlflftmfn")) + .withAuxiliaryMode(NetworkInterfaceAuxiliaryMode.NONE) + .withAuxiliarySku(NetworkInterfaceAuxiliarySku.NONE)) + .withTags(mapOf("key9436", "fakeTokenPlaceholder"))))) + .withSecurityProfile(new SecurityProfile() + .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true)) + .withEncryptionAtHost(true) + .withSecurityType(SecurityTypes.TRUSTED_LAUNCH) + .withEncryptionIdentity( + new EncryptionIdentity().withUserAssignedIdentityResourceId("tnajlgbwcepmhytzb")) + .withProxyAgentSettings(new ProxyAgentSettings().withEnabled(true) + .withMode(Mode.AUDIT) + .withKeyIncarnationId(4) + .withWireServer(new HostEndpointSettings().withMode(Modes.AUDIT) + .withInVMAccessControlProfileReferenceId("xvlzroy")) + .withImds(new HostEndpointSettings().withMode(Modes.AUDIT) + .withInVMAccessControlProfileReferenceId("xvlzroy")) + .withAddProxyAgentExtension(true))) + .withDiagnosticsProfile(new DiagnosticsProfile().withBootDiagnostics( + new BootDiagnostics().withEnabled(true).withStorageUri("pxuhtzehlfsqolbdleirgj"))) + .withLicenseType("ymwuemwuntbignqyvzqflvjpcdus") + .withExtensionsTimeBudget("dnyqmcijikzkltjav") + .withScheduledEventsProfile(new ScheduledEventsProfile() + .withTerminateNotificationProfile( + new TerminateNotificationProfile().withNotBeforeTimeout("owbwifqrlsdmm") + .withEnable(true)) + .withOsImageNotificationProfile( + new OSImageNotificationProfile().withNotBeforeTimeout("ataqykjdakdvyyzdspaqnhd") + .withEnable(true))) + .withUserData("nwjvxe") + .withCapacityReservation(new CapacityReservationProfile() + .withCapacityReservationGroup(new SubResource().withId("lvzxxyypkeqlflftmfn"))) + .withApplicationProfile( + new ApplicationProfile() + .withGalleryApplications( + Arrays.asList(new VMGalleryApplication().withTags("cmygipvpkegyclvpznfu") + .withOrder(8) + .withPackageReferenceId("afrfkjdrtzftmwramfyu") + .withConfigurationReference("nmfaspclhidtznslsps") + .withTreatFailureAsDeploymentFailure(true) + .withEnableAutomaticUpgrade(true)))) + .withVmExtensions( + Arrays + .asList( + new BulkactionVMExtension().withName("jkpmcxwuahpzwkvexgzpypk") + .withProperties(new BulkActionVmExtensionProperties() + .withForceUpdateTag("dockqxgatsfzhctxrncuw") + .withPublisher("qesyfldbfoaexyoywhcxafdtdwcg") + .withType("ptlmlzpbpbkfbu") + .withTypeHandlerVersion("crllsludntz") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings(mapOf()) + .withProtectedSettings(mapOf()) + .withSuppressFailures(true) + .withProtectedSettingsFromKeyVault(new KeyVaultSecretReference() + .withSecretUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("lvzxxyypkeqlflftmfn"))) + .withProvisionAfterExtensions(Arrays.asList("onbtyoeifafiktrkmal")))))) + .withExtensions( + Arrays + .asList(new BulkactionVMExtension().withName("jkpmcxwuahpzwkvexgzpypk") + .withProperties(new BulkActionVmExtensionProperties() + .withForceUpdateTag("dockqxgatsfzhctxrncuw") + .withPublisher("qesyfldbfoaexyoywhcxafdtdwcg") + .withType("ptlmlzpbpbkfbu") + .withTypeHandlerVersion("crllsludntz") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings(mapOf()) + .withProtectedSettings(mapOf()) + .withSuppressFailures(true) + .withProtectedSettingsFromKeyVault( + new KeyVaultSecretReference().withSecretUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("lvzxxyypkeqlflftmfn"))) + .withProvisionAfterExtensions(Arrays.asList("onbtyoeifafiktrkmal"))))) + .withComputeApiVersion("qqxldedyfmfmidkvtkixh")) + .withZoneAllocationPolicy( + new ZoneAllocationPolicy().withDistributionStrategy(DistributionStrategy.BEST_EFFORT_SINGLE_ZONE) + .withZonePreferences( + Arrays.asList(new ZonePreference().withZone("ixksjnaxwelhfpsoyjfaezievquqv").withRank(19)))) + .withRetryPolicy(new RetryPolicy().withRetryCount(2) + .withRetryWindowInMinutes(19) + .withOnFailureAction(ResourceOperationType.UNKNOWN))) + .withZones(Arrays.asList("hzqzrbvpgsudtesi")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("key9643", new UserAssignedIdentity()))) + .withPlan(new Plan().withName("iemasqqkbixbewezyrhnpntjd") + .withPublisher("bvggylbvfstnscuupuithafvvgc") + .withProduct("bguuzrknnuohugjhernflurpx") + .withPromotionCode("fakeTokenPlaceholder") + .withVersion("uyxetqmmzvqianqv")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### LaunchBulkInstancesOperation_Delete + +```java +/** + * Samples for LaunchBulkInstancesOperation Delete. + */ +public final class LaunchBulkInstancesOperationDeleteSamples { + /* + * x-ms-original-file: 2026-07-06-preview/LaunchBulkInstancesOperation_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: LaunchBulkInstancesOperation_Delete_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void launchBulkInstancesOperationDeleteExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.launchBulkInstancesOperations() + .delete("rgBulkactions", "useast2euap", "8a71b9df-efee-48a9-a381-4e6d60b4304f", true, + com.azure.core.util.Context.NONE); + } +} +``` + +### LaunchBulkInstancesOperation_Get + +```java +/** + * Samples for LaunchBulkInstancesOperation Get. + */ +public final class LaunchBulkInstancesOperationGetSamples { + /* + * x-ms-original-file: 2026-07-06-preview/LaunchBulkInstancesOperation_Get_MaximumSet_Gen.json + */ + /** + * Sample code: LaunchBulkInstancesOperation_Get_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void launchBulkInstancesOperationGetExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.launchBulkInstancesOperations() + .getWithResponse("rgBulkactions", "useast2euap", "495544ae-8710-4e8b-bca3-49a1dbb1623a", + com.azure.core.util.Context.NONE); + } +} +``` + +### LaunchBulkInstancesOperation_GetOperationStatus + +```java +/** + * Samples for LaunchBulkInstancesOperation GetOperationStatus. + */ +public final class LaunchBulkInstancesOperationGetOperationStatusSamples { + /* + * x-ms-original-file: 2026-07-06-preview/LaunchBulkInstancesOperation_GetOperationStatus_MaximumSet_Gen.json + */ + /** + * Sample code: LaunchBulkInstancesOperation_GetOperationStatus_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void launchBulkInstancesOperationGetOperationStatusExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.launchBulkInstancesOperations() + .getOperationStatusWithResponse("useast2euap", "8596407e-8834-4a62-8d3c-9231af92d785", + com.azure.core.util.Context.NONE); + } +} +``` + +### LaunchBulkInstancesOperation_ListByResourceGroup + +```java +/** + * Samples for LaunchBulkInstancesOperation ListByResourceGroup. + */ +public final class LaunchBulkInstancesOperationListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-07-06-preview/LaunchBulkInstancesOperation_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: LaunchBulkInstancesOperation_ListByResourceGroup_Example - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void launchBulkInstancesOperationListByResourceGroupExampleGeneratedByMinimumSetRule( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.launchBulkInstancesOperations() + .listByResourceGroup("rgBulkactions", "useast2euap", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-06-preview/LaunchBulkInstancesOperation_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: LaunchBulkInstancesOperation_ListByResourceGroup_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void launchBulkInstancesOperationListByResourceGroupExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.launchBulkInstancesOperations() + .listByResourceGroup("rgBulkactions", "useast2euap", com.azure.core.util.Context.NONE); + } +} +``` + +### LaunchBulkInstancesOperation_ListBySubscription + +```java +/** + * Samples for LaunchBulkInstancesOperation ListBySubscription. + */ +public final class LaunchBulkInstancesOperationListBySubscriptionSamples { + /* + * x-ms-original-file: 2026-07-06-preview/LaunchBulkInstancesOperation_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: LaunchBulkInstancesOperation_ListBySubscription_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void launchBulkInstancesOperationListBySubscriptionExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.launchBulkInstancesOperations().listBySubscription("useast2euap", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-06-preview/LaunchBulkInstancesOperation_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: LaunchBulkInstancesOperation_ListBySubscription_Example - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void launchBulkInstancesOperationListBySubscriptionExampleGeneratedByMinimumSetRule( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.launchBulkInstancesOperations().listBySubscription("useast2euap", com.azure.core.util.Context.NONE); + } +} +``` + +### LaunchBulkInstancesOperation_ListVirtualMachines + +```java +/** + * Samples for LaunchBulkInstancesOperation ListVirtualMachines. + */ +public final class LaunchBulkInstancesOperationListVirtualMachinesSamples { + /* + * x-ms-original-file: 2026-07-06-preview/LaunchBulkInstancesOperation_ListVirtualMachines_MaximumSet_Gen.json + */ + /** + * Sample code: LaunchBulkInstancesOperation_ListVirtualMachines_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void launchBulkInstancesOperationListVirtualMachinesExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.launchBulkInstancesOperations() + .listVirtualMachines("rgBulkactions", "useast2euap", "b038ec94-0860-42a5-b149-f1ce5f144e15", + "onywxjwswbhlbkbbusgmkfgabdku", "tcbhwfqtoiwnlbjdbsnukxpgpa", com.azure.core.util.Context.NONE); + } +} +``` + ### Operations_List ```java @@ -21,33 +705,81 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: 2026-06-06/Operations_List_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/Operations_List_MinimumSet_Gen.json */ /** - * Sample code: Operations_List - generated by [MaximumSet] rule. + * Sample code: Operations_List_Minimum_Gen_Example. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void operationsListGeneratedByMaximumSetRule( + public static void operationsListMinimumGenExample( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.operations().list(com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: 2026-06-06/Operations_List_MinimumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/Operations_List_MaximumSet_Gen.json */ /** - * Sample code: Operations_List - generated by [MinimumSet] rule. + * Sample code: Operations_List_MaximumSet_Gen_Example. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void operationsListGeneratedByMinimumSetRule( + public static void operationsListMaximumSetGenExample( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.operations().list(com.azure.core.util.Context.NONE); } } ``` +### VirtualMachineBulkOperations_BulkAcknowledgeOperationErrors + +```java +import com.azure.resourcemanager.compute.bulkactions.models.AcknowledgeBulkOperationErrorsRequest; +import java.util.Arrays; + +/** + * Samples for VirtualMachineBulkOperations BulkAcknowledgeOperationErrors. + */ +public final class VirtualMachineBulkOperationsBulkAcknowledgeOperationErrorsSamples { + /* + * x-ms-original-file: + * 2026-07-06-preview/VirtualMachineBulkOperations_BulkAcknowledgeOperationErrors_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineBulkOperations_BulkAcknowledgeOperationErrors_MinimumSet_Gen. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void virtualMachineBulkOperationsBulkAcknowledgeOperationErrorsMinimumSetGen( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.virtualMachineBulkOperations() + .bulkAcknowledgeOperationErrorsWithResponse("rgBulkactions", "useast2euap", + new AcknowledgeBulkOperationErrorsRequest().withOperationIds( + Arrays.asList("af449548-8e1a-4079-874e-2caa4ff783cc")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-07-06-preview/VirtualMachineBulkOperations_BulkAcknowledgeOperationErrors_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineBulkOperations_BulkAcknowledgeOperationErrors_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void virtualMachineBulkOperationsBulkAcknowledgeOperationErrorsExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.virtualMachineBulkOperations() + .bulkAcknowledgeOperationErrorsWithResponse("rgBulkactions", "useast2euap", + new AcknowledgeBulkOperationErrorsRequest().withOperationIds( + Arrays.asList("af449548-8e1a-4079-874e-2caa4ff783cc")), + com.azure.core.util.Context.NONE); + } +} +``` + ### VirtualMachineBulkOperations_BulkCancelOperations ```java @@ -59,97 +791,154 @@ import java.util.Arrays; */ public final class VirtualMachineBulkOperationsBulkCancelOperationsSamples { /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkCancel_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkCancel_MaximumSet_Gen.json */ /** - * Sample code: VirtualMachineBulkOperations_BulkCancel - generated by [MaximumSet] rule. + * Sample code: VirtualMachineBulkOperations_BulkCancel_Example. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void virtualMachineBulkOperationsBulkCancelGeneratedByMaximumSetRule( + public static void virtualMachineBulkOperationsBulkCancelExample( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.virtualMachineBulkOperations() - .bulkCancelOperationsWithResponse("myResourceGroup", "eastus2euap", - new CancelOperationsContent().withOperationIds(Arrays.asList("a1b2c3d4-e5f6-7890-abcd-ef0123456789")), + .bulkCancelOperationsWithResponse("rgBulkactions", "useast2euap", + new CancelOperationsContent().withOperationIds(Arrays.asList("af449548-8e1a-4079-874e-2caa4ff783cc")), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkCancel_MinimumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkCancel_MinimumSet_Gen.json */ /** - * Sample code: VirtualMachineBulkOperations_BulkCancel - generated by [MinimumSet] rule. + * Sample code: VirtualMachineBulkOperations_BulkCancel_Example - generated by [MinimumSet] rule. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void virtualMachineBulkOperationsBulkCancelGeneratedByMinimumSetRule( + public static void virtualMachineBulkOperationsBulkCancelExampleGeneratedByMinimumSetRule( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.virtualMachineBulkOperations() - .bulkCancelOperationsWithResponse("myResourceGroup", "eastus2euap", - new CancelOperationsContent().withOperationIds(Arrays.asList("a1b2c3d4-e5f6-7890-abcd-ef0123456789")), + .bulkCancelOperationsWithResponse("rgBulkactions", "useast2euap", + new CancelOperationsContent().withOperationIds(Arrays.asList("af449548-8e1a-4079-874e-2caa4ff783cc")), com.azure.core.util.Context.NONE); } } ``` -### VirtualMachineBulkOperations_BulkDeallocateOperation +### VirtualMachineBulkOperations_BulkCreateOperation ```java -import com.azure.resourcemanager.compute.bulkactions.models.ExecuteDeallocateContent; +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.ExecuteCreateContent; import com.azure.resourcemanager.compute.bulkactions.models.ExecutionParameters; import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType; -import com.azure.resourcemanager.compute.bulkactions.models.Resources; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceProvisionPayload; import com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy; +import java.nio.charset.StandardCharsets; import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; /** - * Samples for VirtualMachineBulkOperations BulkDeallocateOperation. + * Samples for VirtualMachineBulkOperations BulkCreateOperation. */ -public final class VirtualMachineBulkOperationsBulkDeallocateOperationSamples { +public final class VirtualMachineBulkOperationsBulkCreateOperationSamples { /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkDeallocate_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkCreate_MaximumSet_Gen.json */ /** - * Sample code: VirtualMachineBulkOperations_BulkDeallocate - generated by [MaximumSet] rule. + * Sample code: VirtualMachineBulkOperations_BulkCreate_Example. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void virtualMachineBulkOperationsBulkDeallocateGeneratedByMaximumSetRule( + public static void virtualMachineBulkOperationsBulkCreateExample( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.virtualMachineBulkOperations() - .bulkDeallocateOperationWithResponse("myResourceGroup", "eastus2euap", new ExecuteDeallocateContent() + .bulkCreateOperationWithResponse("rgBulkactions", "useast2euap", new ExecuteCreateContent() + .withResourceConfigParameters(new ResourceProvisionPayload().withBaseProfile(mapOf("plan", + BinaryData.fromBytes( + "{name=iemasqqkbixbewezyrhnpntjd, publisher=bvggylbvfstnscuupuithafvvgc, product=bguuzrknnuohugjhernflurpx, promotionCode=bxgonranwqoryfkhkfaumdgz, version=uyxetqmmzvqianqv}" + .getBytes(StandardCharsets.UTF_8)), + "zones", BinaryData.fromBytes("[wczj]".getBytes(StandardCharsets.UTF_8)), "identity", + BinaryData.fromBytes( + "{type=SystemAssigned, userAssignedIdentities={key7={}}}".getBytes(StandardCharsets.UTF_8)), + "extendedLocation", + BinaryData.fromBytes("{name=gbnxzymbdkxhwjpqkur, type=EdgeZone}".getBytes(StandardCharsets.UTF_8)), + "placement", + BinaryData.fromBytes( + "{zonePlacementPolicy=Any, includeZones=[inagtbtedobdea], excludeZones=[pvvwrhuhdpvbacwmesblpgwzk]}" + .getBytes(StandardCharsets.UTF_8)), + "tags", BinaryData.fromBytes("{key6824=cefndldgkx}".getBytes(StandardCharsets.UTF_8)), "properties", + BinaryData.fromBytes( + "{scheduledEventsPolicy={userInitiatedRedeploy={automaticallyApprove=true}, userInitiatedReboot={automaticallyApprove=true}, scheduledEventsAdditionalPublishingTargets={eventGridAndResourceGraph={enable=true, scheduledEventsApiVersion=lifncbftlkounuyfn}}, allInstancesDown={automaticallyApprove=true}}, storageProfile={imageReference={publisher=ojlplghybdamadvsrq, offer=uvnqoxhkxefqwbsvjgbswqy, sku=hajdxhjmlkx, version=u, sharedGalleryImageId=fz, communityGalleryImageId=tsfpcq, id=cdbrkpdicibtlliq}, osDisk={osType=Windows, encryptionSettings={diskEncryptionKey={secretUrl=vzkogocyw, sourceVault={id=lvzxxyypkeqlflftmfn}}, keyEncryptionKey={keyUrl=mjjkvgpoohatw, sourceVault={id=lvzxxyypkeqlflftmfn}}, enabled=true}, name=opogpznvctmraoajgizcyrfvpt, vhd={uri=elpzggtxubepzgjqvdbjmbu}, image={uri=elpzggtxubepzgjqvdbjmbu}, caching=None, writeAcceleratorEnabled=true, diffDiskSettings={option=Local, placement=CacheDisk}, createOption=FromImage, diskSizeGB=2, managedDisk={storageAccountType=Standard_LRS, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}, securityProfile={securityEncryptionType=VMGuestStateOnly, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}}, id=numddbqmkxuu}, deleteOption=Delete}, dataDisks=[{lun=7, name=nbthfzqsxyqvqnbgcljxbwyyoj, vhd={uri=elpzggtxubepzgjqvdbjmbu}, image={uri=elpzggtxubepzgjqvdbjmbu}, caching=None, writeAcceleratorEnabled=true, createOption=FromImage, diskSizeGB=19, managedDisk={storageAccountType=Standard_LRS, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}, securityProfile={securityEncryptionType=VMGuestStateOnly, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}}, id=numddbqmkxuu}, sourceResource={id=qnukyordmomtjjqabovlsxl}, toBeDetached=true, detachOption=ForceDetach, deleteOption=Delete}], diskControllerType=SCSI}, hardwareProfile={vmSize=szrnjqwbruz, vmSizeProperties={vCpusAvailable=24, vCpusPerCore=6}}, additionalCapabilities={ultraSSDEnabled=true, hibernationEnabled=true}, osProfile={computerName=bplxnfp, adminUsername=fxzbi, adminPassword=, customData=hbdlirohsgnbrahscboc, windowsConfiguration={provisionVMAgent=true, enableAutomaticUpdates=true, timeZone=t, additionalUnattendContent=[{passName=OobeSystem, componentName=Microsoft-Windows-Shell-Setup, settingName=AutoLogon, content=rguazthnx}], patchSettings={patchMode=Manual, enableHotpatching=true, assessmentMode=ImageDefault, automaticByPlatformSettings={rebootSetting=Unknown, bypassPlatformSafetyChecksOnUserSchedule=true}}, winRM={listeners=[{protocol=Http, certificateUrl=quhfapfpyeeocwvwtvuggoqqwt}]}}, linuxConfiguration={disablePasswordAuthentication=true, ssh={publicKeys=[{path=mrdfxnfjazxog, keyData=wfhrknkehgesontscqyrewfmhgwt}]}, provisionVMAgent=true, patchSettings={patchMode=ImageDefault, assessmentMode=ImageDefault, automaticByPlatformSettings={rebootSetting=Unknown, bypassPlatformSafetyChecksOnUserSchedule=true}}, enableVMAgentPlatformUpdates=true}, secrets=[{sourceVault={id=lvzxxyypkeqlflftmfn}, vaultCertificates=[{certificateUrl=crgbpfdvlohwkupdjp, certificateStore=hyx}]}], allowExtensionOperations=true, requireGuestProvisionSignal=true}, networkProfile={networkInterfaces=[{properties={primary=true, deleteOption=Delete}, id=ymfxctb}], networkApiVersion=2020-11-01, networkInterfaceConfigurations=[{name=qrkzoctmzjketostzabnra, properties={primary=true, deleteOption=Delete, enableAcceleratedNetworking=true, disableTcpStateTracking=true, enableFpga=true, enableIPForwarding=true, networkSecurityGroup={id=lvzxxyypkeqlflftmfn}, dnsSettings={dnsServers=[tqcqopnanyyiavfwhqbkarxtrfqbww]}, ipConfigurations=[{name=gqymuvgzzfmxqvdadx, properties={subnet={id=lvzxxyypkeqlflftmfn}, primary=true, publicIPAddressConfiguration={name=cwxsqjijtwbsyqdwht, properties={idleTimeoutInMinutes=17, deleteOption=Delete, dnsSettings={domainNameLabel=fampou, domainNameLabelScope=TenantReuse}, ipTags=[{ipTagType=hkjoxhqadudjartwooezaxl, tag=xywunkjglkmmwfpf}], publicIPPrefix={id=lvzxxyypkeqlflftmfn}, publicIPAddressVersion=IPv4, publicIPAllocationMethod=Dynamic}, sku={name=Basic, tier=Regional}, tags={key5442=qhpwpnylvmdthxazhxamnbhdfpf}}, privateIPAddressVersion=IPv4, applicationSecurityGroups=[{id=lvzxxyypkeqlflftmfn}], applicationGatewayBackendAddressPools=[{id=lvzxxyypkeqlflftmfn}], loadBalancerBackendAddressPools=[{id=lvzxxyypkeqlflftmfn}]}}], dscpConfiguration={id=lvzxxyypkeqlflftmfn}, auxiliaryMode=None, auxiliarySku=None}, tags={key9436=bjbadzbfvpszbsickv}}]}, securityProfile={uefiSettings={secureBootEnabled=true, vTpmEnabled=true}, encryptionAtHost=true, securityType=TrustedLaunch, encryptionIdentity={userAssignedIdentityResourceId=tnajlgbwcepmhytzb}, proxyAgentSettings={enabled=true, mode=Audit, keyIncarnationId=4, wireServer={mode=Audit, inVMAccessControlProfileReferenceId=xvlzroy}, imds={mode=Audit, inVMAccessControlProfileReferenceId=xvlzroy}, addProxyAgentExtension=true}}, diagnosticsProfile={bootDiagnostics={enabled=true, storageUri=pxuhtzehlfsqolbdleirgj}}, licenseType=ymwuemwuntbignqyvzqflvjpcdus, extensionsTimeBudget=dnyqmcijikzkltjav, scheduledEventsProfile={terminateNotificationProfile={notBeforeTimeout=owbwifqrlsdmm, enable=true}, osImageNotificationProfile={notBeforeTimeout=ataqykjdakdvyyzdspaqnhd, enable=true}}, userData=nwjvxe, capacityReservation={capacityReservationGroup={id=lvzxxyypkeqlflftmfn}}, applicationProfile={galleryApplications=[{tags=cmygipvpkegyclvpznfu, order=8, packageReferenceId=afrfkjdrtzftmwramfyu, configurationReference=nmfaspclhidtznslsps, treatFailureAsDeploymentFailure=true, enableAutomaticUpgrade=true}]}, vmExtensions=[{name=jkpmcxwuahpzwkvexgzpypk, properties={forceUpdateTag=dockqxgatsfzhctxrncuw, publisher=qesyfldbfoaexyoywhcxafdtdwcg, type=ptlmlzpbpbkfbu, typeHandlerVersion=crllsludntz, autoUpgradeMinorVersion=true, enableAutomaticUpgrade=true, settings={}, protectedSettings={}, suppressFailures=true, protectedSettingsFromKeyVault={secretUrl=vzkogocyw, sourceVault={id=lvzxxyypkeqlflftmfn}}, provisionAfterExtensions=[onbtyoeifafiktrkmal]}}]}" + .getBytes(StandardCharsets.UTF_8)), + "computeApiVersion", + BinaryData.fromBytes("axcvphjtsdjzcwqczcglmq".getBytes(StandardCharsets.UTF_8)), "name", + BinaryData.fromBytes("dbozdvegpdvqxltqipvmqsfgunpe".getBytes(StandardCharsets.UTF_8)))) + .withResourceOverrides(Arrays.asList(mapOf("plan", BinaryData.fromBytes( + "{name=iemasqqkbixbewezyrhnpntjd, publisher=bvggylbvfstnscuupuithafvvgc, product=bguuzrknnuohugjhernflurpx, promotionCode=bxgonranwqoryfkhkfaumdgz, version=uyxetqmmzvqianqv}" + .getBytes(StandardCharsets.UTF_8)), + "zones", BinaryData.fromBytes("[wczj]".getBytes(StandardCharsets.UTF_8)), "identity", + BinaryData.fromBytes( + "{type=SystemAssigned, userAssignedIdentities={key7={}}}".getBytes(StandardCharsets.UTF_8)), + "extendedLocation", + BinaryData + .fromBytes("{name=gbnxzymbdkxhwjpqkur, type=EdgeZone}".getBytes(StandardCharsets.UTF_8)), + "placement", + BinaryData.fromBytes( + "{zonePlacementPolicy=Any, includeZones=[inagtbtedobdea], excludeZones=[pvvwrhuhdpvbacwmesblpgwzk]}" + .getBytes(StandardCharsets.UTF_8)), + "tags", BinaryData.fromBytes("{key6824=cefndldgkx}".getBytes(StandardCharsets.UTF_8)), + "properties", + BinaryData.fromBytes( + "{scheduledEventsPolicy={userInitiatedRedeploy={automaticallyApprove=true}, userInitiatedReboot={automaticallyApprove=true}, scheduledEventsAdditionalPublishingTargets={eventGridAndResourceGraph={enable=true, scheduledEventsApiVersion=lifncbftlkounuyfn}}, allInstancesDown={automaticallyApprove=true}}, storageProfile={imageReference={publisher=ojlplghybdamadvsrq, offer=uvnqoxhkxefqwbsvjgbswqy, sku=hajdxhjmlkx, version=u, sharedGalleryImageId=fz, communityGalleryImageId=tsfpcq, id=cdbrkpdicibtlliq}, osDisk={osType=Windows, encryptionSettings={diskEncryptionKey={secretUrl=vzkogocyw, sourceVault={id=lvzxxyypkeqlflftmfn}}, keyEncryptionKey={keyUrl=mjjkvgpoohatw, sourceVault={id=lvzxxyypkeqlflftmfn}}, enabled=true}, name=opogpznvctmraoajgizcyrfvpt, vhd={uri=elpzggtxubepzgjqvdbjmbu}, image={uri=elpzggtxubepzgjqvdbjmbu}, caching=None, writeAcceleratorEnabled=true, diffDiskSettings={option=Local, placement=CacheDisk}, createOption=FromImage, diskSizeGB=2, managedDisk={storageAccountType=Standard_LRS, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}, securityProfile={securityEncryptionType=VMGuestStateOnly, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}}, id=numddbqmkxuu}, deleteOption=Delete}, dataDisks=[{lun=7, name=nbthfzqsxyqvqnbgcljxbwyyoj, vhd={uri=elpzggtxubepzgjqvdbjmbu}, image={uri=elpzggtxubepzgjqvdbjmbu}, caching=None, writeAcceleratorEnabled=true, createOption=FromImage, diskSizeGB=19, managedDisk={storageAccountType=Standard_LRS, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}, securityProfile={securityEncryptionType=VMGuestStateOnly, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}}, id=numddbqmkxuu}, sourceResource={id=qnukyordmomtjjqabovlsxl}, toBeDetached=true, detachOption=ForceDetach, deleteOption=Delete}], diskControllerType=SCSI}, hardwareProfile={vmSize=szrnjqwbruz, vmSizeProperties={vCpusAvailable=24, vCpusPerCore=6}}, additionalCapabilities={ultraSSDEnabled=true, hibernationEnabled=true}, osProfile={computerName=bplxnfp, adminUsername=fxzbi, adminPassword=, customData=hbdlirohsgnbrahscboc, windowsConfiguration={provisionVMAgent=true, enableAutomaticUpdates=true, timeZone=t, additionalUnattendContent=[{passName=OobeSystem, componentName=Microsoft-Windows-Shell-Setup, settingName=AutoLogon, content=rguazthnx}], patchSettings={patchMode=Manual, enableHotpatching=true, assessmentMode=ImageDefault, automaticByPlatformSettings={rebootSetting=Unknown, bypassPlatformSafetyChecksOnUserSchedule=true}}, winRM={listeners=[{protocol=Http, certificateUrl=quhfapfpyeeocwvwtvuggoqqwt}]}}, linuxConfiguration={disablePasswordAuthentication=true, ssh={publicKeys=[{path=mrdfxnfjazxog, keyData=wfhrknkehgesontscqyrewfmhgwt}]}, provisionVMAgent=true, patchSettings={patchMode=ImageDefault, assessmentMode=ImageDefault, automaticByPlatformSettings={rebootSetting=Unknown, bypassPlatformSafetyChecksOnUserSchedule=true}}, enableVMAgentPlatformUpdates=true}, secrets=[{sourceVault={id=lvzxxyypkeqlflftmfn}, vaultCertificates=[{certificateUrl=crgbpfdvlohwkupdjp, certificateStore=hyx}]}], allowExtensionOperations=true, requireGuestProvisionSignal=true}, networkProfile={networkInterfaces=[{properties={primary=true, deleteOption=Delete}, id=ymfxctb}], networkApiVersion=2020-11-01, networkInterfaceConfigurations=[{name=qrkzoctmzjketostzabnra, properties={primary=true, deleteOption=Delete, enableAcceleratedNetworking=true, disableTcpStateTracking=true, enableFpga=true, enableIPForwarding=true, networkSecurityGroup={id=lvzxxyypkeqlflftmfn}, dnsSettings={dnsServers=[tqcqopnanyyiavfwhqbkarxtrfqbww]}, ipConfigurations=[{name=gqymuvgzzfmxqvdadx, properties={subnet={id=lvzxxyypkeqlflftmfn}, primary=true, publicIPAddressConfiguration={name=cwxsqjijtwbsyqdwht, properties={idleTimeoutInMinutes=17, deleteOption=Delete, dnsSettings={domainNameLabel=fampou, domainNameLabelScope=TenantReuse}, ipTags=[{ipTagType=hkjoxhqadudjartwooezaxl, tag=xywunkjglkmmwfpf}], publicIPPrefix={id=lvzxxyypkeqlflftmfn}, publicIPAddressVersion=IPv4, publicIPAllocationMethod=Dynamic}, sku={name=Basic, tier=Regional}, tags={key5442=qhpwpnylvmdthxazhxamnbhdfpf}}, privateIPAddressVersion=IPv4, applicationSecurityGroups=[{id=lvzxxyypkeqlflftmfn}], applicationGatewayBackendAddressPools=[{id=lvzxxyypkeqlflftmfn}], loadBalancerBackendAddressPools=[{id=lvzxxyypkeqlflftmfn}]}}], dscpConfiguration={id=lvzxxyypkeqlflftmfn}, auxiliaryMode=None, auxiliarySku=None}, tags={key9436=bjbadzbfvpszbsickv}}]}, securityProfile={uefiSettings={secureBootEnabled=true, vTpmEnabled=true}, encryptionAtHost=true, securityType=TrustedLaunch, encryptionIdentity={userAssignedIdentityResourceId=tnajlgbwcepmhytzb}, proxyAgentSettings={enabled=true, mode=Audit, keyIncarnationId=4, wireServer={mode=Audit, inVMAccessControlProfileReferenceId=xvlzroy}, imds={mode=Audit, inVMAccessControlProfileReferenceId=xvlzroy}, addProxyAgentExtension=true}}, diagnosticsProfile={bootDiagnostics={enabled=true, storageUri=pxuhtzehlfsqolbdleirgj}}, licenseType=ymwuemwuntbignqyvzqflvjpcdus, extensionsTimeBudget=dnyqmcijikzkltjav, scheduledEventsProfile={terminateNotificationProfile={notBeforeTimeout=owbwifqrlsdmm, enable=true}, osImageNotificationProfile={notBeforeTimeout=ataqykjdakdvyyzdspaqnhd, enable=true}}, userData=nwjvxe, capacityReservation={capacityReservationGroup={id=lvzxxyypkeqlflftmfn}}, applicationProfile={galleryApplications=[{tags=cmygipvpkegyclvpznfu, order=8, packageReferenceId=afrfkjdrtzftmwramfyu, configurationReference=nmfaspclhidtznslsps, treatFailureAsDeploymentFailure=true, enableAutomaticUpgrade=true}]}, vmExtensions=[{name=jkpmcxwuahpzwkvexgzpypk, properties={forceUpdateTag=dockqxgatsfzhctxrncuw, publisher=qesyfldbfoaexyoywhcxafdtdwcg, type=ptlmlzpbpbkfbu, typeHandlerVersion=crllsludntz, autoUpgradeMinorVersion=true, enableAutomaticUpgrade=true, settings={}, protectedSettings={}, suppressFailures=true, protectedSettingsFromKeyVault={secretUrl=vzkogocyw, sourceVault={id=lvzxxyypkeqlflftmfn}}, provisionAfterExtensions=[onbtyoeifafiktrkmal]}}]}" + .getBytes(StandardCharsets.UTF_8)), + "computeApiVersion", + BinaryData.fromBytes("axcvphjtsdjzcwqczcglmq".getBytes(StandardCharsets.UTF_8)), "name", + BinaryData.fromBytes("dbozdvegpdvqxltqipvmqsfgunpe".getBytes(StandardCharsets.UTF_8))))) + .withResourceCount(23) + .withResourcePrefix("flivkboavfhjuiucwdjof")) .withExecutionParameters(new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(2) - .withRetryWindowInMinutes(20) - .withOnFailureAction(ResourceOperationType.UNKNOWN))) - .withResources(new Resources().withIds(Arrays.asList( - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))), + .withRetryWindowInMinutes(19) + .withOnFailureAction(ResourceOperationType.UNKNOWN))), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkDeallocate_MinimumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkCreate_MinimumSet_Gen.json */ /** - * Sample code: VirtualMachineBulkOperations_BulkDeallocate - generated by [MinimumSet] rule. + * Sample code: VirtualMachineBulkOperations_BulkCreate_Example - generated by [MinimumSet] rule. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void virtualMachineBulkOperationsBulkDeallocateGeneratedByMinimumSetRule( + public static void virtualMachineBulkOperationsBulkCreateExampleGeneratedByMinimumSetRule( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.virtualMachineBulkOperations() - .bulkDeallocateOperationWithResponse("myResourceGroup", "eastus2euap", new ExecuteDeallocateContent() - .withExecutionParameters(new ExecutionParameters()) - .withResources(new Resources().withIds(Arrays.asList( - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))), + .bulkCreateOperationWithResponse("rgBulkactions", "useast2euap", + new ExecuteCreateContent() + .withResourceConfigParameters(new ResourceProvisionPayload().withResourceCount(23)) + .withExecutionParameters(new ExecutionParameters()), com.azure.core.util.Context.NONE); } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } ``` -### VirtualMachineBulkOperations_BulkDeleteOperation +### VirtualMachineBulkOperations_BulkDeallocateOperation ```java -import com.azure.resourcemanager.compute.bulkactions.models.ExecuteDeleteContent; +import com.azure.resourcemanager.compute.bulkactions.models.ExecuteDeallocateContent; import com.azure.resourcemanager.compute.bulkactions.models.ExecutionParameters; import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType; import com.azure.resourcemanager.compute.bulkactions.models.Resources; @@ -157,45 +946,63 @@ import com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy; import java.util.Arrays; /** - * Samples for VirtualMachineBulkOperations BulkDeleteOperation. + * Samples for VirtualMachineBulkOperations BulkDeallocateOperation. */ -public final class VirtualMachineBulkOperationsBulkDeleteOperationSamples { +public final class VirtualMachineBulkOperationsBulkDeallocateOperationSamples { /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkDelete_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkDeallocate_MaximumSet_Gen.json */ /** - * Sample code: VirtualMachineBulkOperations_BulkDelete - generated by [MaximumSet] rule. + * Sample code: VirtualMachineBulkOperations_BulkDeallocate_Example. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void virtualMachineBulkOperationsBulkDeleteGeneratedByMaximumSetRule( + public static void virtualMachineBulkOperationsBulkDeallocateExample( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.virtualMachineBulkOperations() - .bulkDeleteOperationWithResponse("myResourceGroup", "eastus2euap", new ExecuteDeleteContent() + .bulkDeallocateOperationWithResponse("rgBulkactions", "useast2euap", new ExecuteDeallocateContent() .withExecutionParameters(new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(2) - .withRetryWindowInMinutes(20) + .withRetryWindowInMinutes(19) .withOnFailureAction(ResourceOperationType.UNKNOWN))) .withResources(new Resources().withIds(Arrays.asList( - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))) - .withForceDeletion(true), com.azure.core.util.Context.NONE); + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))), + com.azure.core.util.Context.NONE); } +} +``` + +### VirtualMachineBulkOperations_BulkDeleteOperation + +```java +import com.azure.resourcemanager.compute.bulkactions.models.ExecuteDeleteContent; +import com.azure.resourcemanager.compute.bulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType; +import com.azure.resourcemanager.compute.bulkactions.models.Resources; +import com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy; +import java.util.Arrays; +/** + * Samples for VirtualMachineBulkOperations BulkDeleteOperation. + */ +public final class VirtualMachineBulkOperationsBulkDeleteOperationSamples { /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkDelete_MinimumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkDelete_MaximumSet_Gen.json */ /** - * Sample code: VirtualMachineBulkOperations_BulkDelete - generated by [MinimumSet] rule. + * Sample code: VirtualMachineBulkOperations_BulkDelete_Example. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void virtualMachineBulkOperationsBulkDeleteGeneratedByMinimumSetRule( + public static void virtualMachineBulkOperationsBulkDeleteExample( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.virtualMachineBulkOperations() - .bulkDeleteOperationWithResponse("myResourceGroup", "eastus2euap", new ExecuteDeleteContent() - .withExecutionParameters(new ExecutionParameters()) + .bulkDeleteOperationWithResponse("rgBulkactions", "useast2euap", new ExecuteDeleteContent() + .withExecutionParameters(new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(2) + .withRetryWindowInMinutes(19) + .withOnFailureAction(ResourceOperationType.UNKNOWN))) .withResources(new Resources().withIds(Arrays.asList( - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))), - com.azure.core.util.Context.NONE); + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))) + .withForceDeletion(true), com.azure.core.util.Context.NONE); } } ``` @@ -211,34 +1018,34 @@ import java.util.Arrays; */ public final class VirtualMachineBulkOperationsBulkGetOperationsStatusSamples { /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkGetOperationsStatus_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkGetOperationsStatus_MinimumSet_Gen.json */ /** - * Sample code: VirtualMachineBulkOperations_BulkGetOperationsStatus - generated by [MaximumSet] rule. + * Sample code: VirtualMachineBulkOperations_BulkGetOperationsStatus_Example - generated by [MinimumSet] rule. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void virtualMachineBulkOperationsBulkGetOperationsStatusGeneratedByMaximumSetRule( + public static void virtualMachineBulkOperationsBulkGetOperationsStatusExampleGeneratedByMinimumSetRule( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.virtualMachineBulkOperations() - .bulkGetOperationsStatusWithResponse("myResourceGroup", "eastus2euap", - new GetOperationStatusContent().withOperationIds(Arrays.asList("a1b2c3d4-e5f6-7890-abcd-ef0123456789")), + .bulkGetOperationsStatusWithResponse("rgBulkactions", "useast2euap", + new GetOperationStatusContent().withOperationIds(Arrays.asList("406e7856-f94b-48ae-93ee-b062afee54e5")), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkGetOperationsStatus_MinimumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkGetOperationsStatus_MaximumSet_Gen.json */ /** - * Sample code: VirtualMachineBulkOperations_BulkGetOperationsStatus - generated by [MinimumSet] rule. + * Sample code: VirtualMachineBulkOperations_BulkGetOperationsStatus_Example. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void virtualMachineBulkOperationsBulkGetOperationsStatusGeneratedByMinimumSetRule( + public static void virtualMachineBulkOperationsBulkGetOperationsStatusExample( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.virtualMachineBulkOperations() - .bulkGetOperationsStatusWithResponse("myResourceGroup", "eastus2euap", - new GetOperationStatusContent().withOperationIds(Arrays.asList("a1b2c3d4-e5f6-7890-abcd-ef0123456789")), + .bulkGetOperationsStatusWithResponse("rgBulkactions", "useast2euap", + new GetOperationStatusContent().withOperationIds(Arrays.asList("406e7856-f94b-48ae-93ee-b062afee54e5")), com.azure.core.util.Context.NONE); } } @@ -250,7 +1057,8 @@ public final class VirtualMachineBulkOperationsBulkGetOperationsStatusSamples { import com.azure.resourcemanager.compute.bulkactions.models.ExecuteHibernateContent; import com.azure.resourcemanager.compute.bulkactions.models.ExecutionParameters; import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType; -import com.azure.resourcemanager.compute.bulkactions.models.Resources; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceWithContext; +import com.azure.resourcemanager.compute.bulkactions.models.ResourcesWithContext; import com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy; import java.util.Arrays; @@ -259,40 +1067,112 @@ import java.util.Arrays; */ public final class VirtualMachineBulkOperationsBulkHibernateOperationSamples { /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkHibernate_MinimumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkHibernate_MaximumSet_Gen.json */ /** - * Sample code: VirtualMachineBulkOperations_BulkHibernate - generated by [MinimumSet] rule. + * Sample code: VirtualMachineBulkOperations_BulkHibernate_Example. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void virtualMachineBulkOperationsBulkHibernateGeneratedByMinimumSetRule( + public static void virtualMachineBulkOperationsBulkHibernateExample( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.virtualMachineBulkOperations() - .bulkHibernateOperationWithResponse("myResourceGroup", "eastus2euap", new ExecuteHibernateContent() - .withExecutionParameters(new ExecutionParameters()) - .withResources(new Resources().withIds(Arrays.asList( - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))), + .bulkHibernateOperationWithResponse("rgBulkactions", "useast2euap", new ExecuteHibernateContent() + .withExecutionParameters(new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(2) + .withRetryWindowInMinutes(19) + .withOnFailureAction(ResourceOperationType.UNKNOWN))) + .withResourcesWithContext( + new ResourcesWithContext().withResources(Arrays.asList(new ResourceWithContext().withResourceId( + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM") + .withResourceContext("hibernateContext")))), com.azure.core.util.Context.NONE); } +} +``` + +### VirtualMachineBulkOperations_BulkListOperationErrors + +```java +/** + * Samples for VirtualMachineBulkOperations BulkListOperationErrors. + */ +public final class VirtualMachineBulkOperationsBulkListOperationErrorsSamples { + /* + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkListOperationErrors_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineBulkOperations_BulkListOperationErrors_MinimumSet_Gen. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void virtualMachineBulkOperationsBulkListOperationErrorsMinimumSetGen( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.virtualMachineBulkOperations() + .bulkListOperationErrors("rgBulkactions", "useast2euap", null, com.azure.core.util.Context.NONE); + } /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkHibernate_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkListOperationErrors_MaximumSet_Gen.json */ /** - * Sample code: VirtualMachineBulkOperations_BulkHibernate - generated by [MaximumSet] rule. + * Sample code: VirtualMachineBulkOperations_BulkListOperationErrors_Example. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void virtualMachineBulkOperationsBulkHibernateGeneratedByMaximumSetRule( + public static void virtualMachineBulkOperationsBulkListOperationErrorsExample( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.virtualMachineBulkOperations() - .bulkHibernateOperationWithResponse("myResourceGroup", "eastus2euap", new ExecuteHibernateContent() + .bulkListOperationErrors("rgBulkactions", "useast2euap", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineBulkOperations_BulkReimageOperation + +```java +import com.azure.resourcemanager.compute.bulkactions.models.ExecuteReimageRequest; +import com.azure.resourcemanager.compute.bulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.compute.bulkactions.models.OSProfileProvisioningData; +import com.azure.resourcemanager.compute.bulkactions.models.ReimagePayload; +import com.azure.resourcemanager.compute.bulkactions.models.ReimageResourceOverride; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType; +import com.azure.resourcemanager.compute.bulkactions.models.Resources; +import com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineReimageParameters; +import java.util.Arrays; + +/** + * Samples for VirtualMachineBulkOperations BulkReimageOperation. + */ +public final class VirtualMachineBulkOperationsBulkReimageOperationSamples { + /* + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkReimage_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineBulkOperations_BulkReimage_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void virtualMachineBulkOperationsBulkReimageExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.virtualMachineBulkOperations() + .bulkReimageOperationWithResponse("rgBulkactions", "useast2euap", new ExecuteReimageRequest() .withExecutionParameters(new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(2) - .withRetryWindowInMinutes(20) + .withRetryWindowInMinutes(19) .withOnFailureAction(ResourceOperationType.UNKNOWN))) .withResources(new Resources().withIds(Arrays.asList( - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))), + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))) + .withReimageParameters(new ReimagePayload() + .withBaseProfile(new VirtualMachineReimageParameters().withTempDisk(true) + .withExactVersion("zjmkrnqjmzs") + .withOsProfile(new OSProfileProvisioningData().withAdminPassword("fakeTokenPlaceholder") + .withCustomData("teyngslcznlxihiitqbul"))) + .withResourceOverrides(Arrays.asList(new ReimageResourceOverride().withResourceId( + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM") + .withProfile(new VirtualMachineReimageParameters().withTempDisk(true) + .withExactVersion("zjmkrnqjmzs") + .withOsProfile(new OSProfileProvisioningData().withAdminPassword("fakeTokenPlaceholder") + .withCustomData("teyngslcznlxihiitqbul")))))), com.azure.core.util.Context.NONE); } } @@ -304,7 +1184,8 @@ public final class VirtualMachineBulkOperationsBulkHibernateOperationSamples { import com.azure.resourcemanager.compute.bulkactions.models.ExecuteStartContent; import com.azure.resourcemanager.compute.bulkactions.models.ExecutionParameters; import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType; -import com.azure.resourcemanager.compute.bulkactions.models.Resources; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceWithContext; +import com.azure.resourcemanager.compute.bulkactions.models.ResourcesWithContext; import com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy; import java.util.Arrays; @@ -313,42 +1194,164 @@ import java.util.Arrays; */ public final class VirtualMachineBulkOperationsBulkStartOperationSamples { /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkStart_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkStart_MaximumSet_Gen.json */ /** - * Sample code: VirtualMachineBulkOperations_BulkStart - generated by [MaximumSet] rule. + * Sample code: VirtualMachineBulkOperations_BulkStart_Example. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void virtualMachineBulkOperationsBulkStartGeneratedByMaximumSetRule( + public static void virtualMachineBulkOperationsBulkStartExample( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.virtualMachineBulkOperations() - .bulkStartOperationWithResponse("myResourceGroup", "eastus2euap", new ExecuteStartContent() + .bulkStartOperationWithResponse("rgBulkactions", "useast2euap", new ExecuteStartContent() .withExecutionParameters(new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(2) - .withRetryWindowInMinutes(20) + .withRetryWindowInMinutes(19) .withOnFailureAction(ResourceOperationType.UNKNOWN))) - .withResources(new Resources().withIds(Arrays.asList( - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))), + .withResourcesWithContext( + new ResourcesWithContext().withResources(Arrays.asList(new ResourceWithContext().withResourceId( + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM") + .withResourceContext("startContext")))), com.azure.core.util.Context.NONE); } +} +``` + +### VirtualMachineBulkOperations_BulkVdiFlexCreateOperation + +```java +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.AllocationStrategy; +import com.azure.resourcemanager.compute.bulkactions.models.DistributionStrategy; +import com.azure.resourcemanager.compute.bulkactions.models.EvictionPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.ExecuteVdiCreateRequest; +import com.azure.resourcemanager.compute.bulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.compute.bulkactions.models.FlexProperties; +import com.azure.resourcemanager.compute.bulkactions.models.OsType; +import com.azure.resourcemanager.compute.bulkactions.models.PriorityProfile; +import com.azure.resourcemanager.compute.bulkactions.models.PriorityType; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceProvisionVdiPayload; +import com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.VmSizeProfile; +import com.azure.resourcemanager.compute.bulkactions.models.ZoneAllocationPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.ZonePreference; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +/** + * Samples for VirtualMachineBulkOperations BulkVdiFlexCreateOperation. + */ +public final class VirtualMachineBulkOperationsBulkVdiFlexCreateOperationSamples { /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkStart_MinimumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkVdiFlexCreate_MaximumSet_Gen.json */ /** - * Sample code: VirtualMachineBulkOperations_BulkStart - generated by [MinimumSet] rule. + * Sample code: VirtualMachineBulkOperations_BulkVdiFlexCreate_Example. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void virtualMachineBulkOperationsBulkStartGeneratedByMinimumSetRule( + public static void virtualMachineBulkOperationsBulkVdiFlexCreateExample( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.virtualMachineBulkOperations() - .bulkStartOperationWithResponse("myResourceGroup", "eastus2euap", new ExecuteStartContent() - .withExecutionParameters(new ExecutionParameters()) - .withResources(new Resources().withIds(Arrays.asList( - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))), + .bulkVdiFlexCreateOperationWithResponse("rgBulkactions", "useast2euap", new ExecuteVdiCreateRequest() + .withResourceConfigParameters(new ResourceProvisionVdiPayload().withBaseProfile(mapOf("plan", + BinaryData.fromBytes( + "{name=iemasqqkbixbewezyrhnpntjd, publisher=bvggylbvfstnscuupuithafvvgc, product=bguuzrknnuohugjhernflurpx, promotionCode=bxgonranwqoryfkhkfaumdgz, version=uyxetqmmzvqianqv}" + .getBytes(StandardCharsets.UTF_8)), + "zones", BinaryData.fromBytes("[wczj]".getBytes(StandardCharsets.UTF_8)), "identity", + BinaryData.fromBytes( + "{type=SystemAssigned, userAssignedIdentities={key7={}}}".getBytes(StandardCharsets.UTF_8)), + "extendedLocation", + BinaryData.fromBytes("{name=gbnxzymbdkxhwjpqkur, type=EdgeZone}".getBytes(StandardCharsets.UTF_8)), + "placement", + BinaryData.fromBytes( + "{zonePlacementPolicy=Any, includeZones=[inagtbtedobdea], excludeZones=[pvvwrhuhdpvbacwmesblpgwzk]}" + .getBytes(StandardCharsets.UTF_8)), + "tags", BinaryData.fromBytes("{key6824=cefndldgkx}".getBytes(StandardCharsets.UTF_8)), "properties", + BinaryData.fromBytes( + "{scheduledEventsPolicy={userInitiatedRedeploy={automaticallyApprove=true}, userInitiatedReboot={automaticallyApprove=true}, scheduledEventsAdditionalPublishingTargets={eventGridAndResourceGraph={enable=true, scheduledEventsApiVersion=lifncbftlkounuyfn}}, allInstancesDown={automaticallyApprove=true}}, storageProfile={imageReference={publisher=ojlplghybdamadvsrq, offer=uvnqoxhkxefqwbsvjgbswqy, sku=hajdxhjmlkx, version=u, sharedGalleryImageId=fz, communityGalleryImageId=tsfpcq, id=cdbrkpdicibtlliq}, osDisk={osType=Windows, encryptionSettings={diskEncryptionKey={secretUrl=vzkogocyw, sourceVault={id=lvzxxyypkeqlflftmfn}}, keyEncryptionKey={keyUrl=mjjkvgpoohatw, sourceVault={id=lvzxxyypkeqlflftmfn}}, enabled=true}, name=opogpznvctmraoajgizcyrfvpt, vhd={uri=elpzggtxubepzgjqvdbjmbu}, image={uri=elpzggtxubepzgjqvdbjmbu}, caching=None, writeAcceleratorEnabled=true, diffDiskSettings={option=Local, placement=CacheDisk}, createOption=FromImage, diskSizeGB=2, managedDisk={storageAccountType=Standard_LRS, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}, securityProfile={securityEncryptionType=VMGuestStateOnly, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}}, id=numddbqmkxuu}, deleteOption=Delete}, dataDisks=[{lun=7, name=nbthfzqsxyqvqnbgcljxbwyyoj, vhd={uri=elpzggtxubepzgjqvdbjmbu}, image={uri=elpzggtxubepzgjqvdbjmbu}, caching=None, writeAcceleratorEnabled=true, createOption=FromImage, diskSizeGB=19, managedDisk={storageAccountType=Standard_LRS, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}, securityProfile={securityEncryptionType=VMGuestStateOnly, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}}, id=numddbqmkxuu}, sourceResource={id=qnukyordmomtjjqabovlsxl}, toBeDetached=true, detachOption=ForceDetach, deleteOption=Delete}], diskControllerType=SCSI}, hardwareProfile={vmSize=szrnjqwbruz, vmSizeProperties={vCpusAvailable=24, vCpusPerCore=6}}, additionalCapabilities={ultraSSDEnabled=true, hibernationEnabled=true}, osProfile={computerName=bplxnfp, adminUsername=fxzbi, adminPassword=, customData=hbdlirohsgnbrahscboc, windowsConfiguration={provisionVMAgent=true, enableAutomaticUpdates=true, timeZone=t, additionalUnattendContent=[{passName=OobeSystem, componentName=Microsoft-Windows-Shell-Setup, settingName=AutoLogon, content=rguazthnx}], patchSettings={patchMode=Manual, enableHotpatching=true, assessmentMode=ImageDefault, automaticByPlatformSettings={rebootSetting=Unknown, bypassPlatformSafetyChecksOnUserSchedule=true}}, winRM={listeners=[{protocol=Http, certificateUrl=quhfapfpyeeocwvwtvuggoqqwt}]}}, linuxConfiguration={disablePasswordAuthentication=true, ssh={publicKeys=[{path=mrdfxnfjazxog, keyData=wfhrknkehgesontscqyrewfmhgwt}]}, provisionVMAgent=true, patchSettings={patchMode=ImageDefault, assessmentMode=ImageDefault, automaticByPlatformSettings={rebootSetting=Unknown, bypassPlatformSafetyChecksOnUserSchedule=true}}, enableVMAgentPlatformUpdates=true}, secrets=[{sourceVault={id=lvzxxyypkeqlflftmfn}, vaultCertificates=[{certificateUrl=crgbpfdvlohwkupdjp, certificateStore=hyx}]}], allowExtensionOperations=true, requireGuestProvisionSignal=true}, networkProfile={networkInterfaces=[{properties={primary=true, deleteOption=Delete}, id=ymfxctb}], networkApiVersion=2020-11-01, networkInterfaceConfigurations=[{name=qrkzoctmzjketostzabnra, properties={primary=true, deleteOption=Delete, enableAcceleratedNetworking=true, disableTcpStateTracking=true, enableFpga=true, enableIPForwarding=true, networkSecurityGroup={id=lvzxxyypkeqlflftmfn}, dnsSettings={dnsServers=[tqcqopnanyyiavfwhqbkarxtrfqbww]}, ipConfigurations=[{name=gqymuvgzzfmxqvdadx, properties={subnet={id=lvzxxyypkeqlflftmfn}, primary=true, publicIPAddressConfiguration={name=cwxsqjijtwbsyqdwht, properties={idleTimeoutInMinutes=17, deleteOption=Delete, dnsSettings={domainNameLabel=fampou, domainNameLabelScope=TenantReuse}, ipTags=[{ipTagType=hkjoxhqadudjartwooezaxl, tag=xywunkjglkmmwfpf}], publicIPPrefix={id=lvzxxyypkeqlflftmfn}, publicIPAddressVersion=IPv4, publicIPAllocationMethod=Dynamic}, sku={name=Basic, tier=Regional}, tags={key5442=qhpwpnylvmdthxazhxamnbhdfpf}}, privateIPAddressVersion=IPv4, applicationSecurityGroups=[{id=lvzxxyypkeqlflftmfn}], applicationGatewayBackendAddressPools=[{id=lvzxxyypkeqlflftmfn}], loadBalancerBackendAddressPools=[{id=lvzxxyypkeqlflftmfn}]}}], dscpConfiguration={id=lvzxxyypkeqlflftmfn}, auxiliaryMode=None, auxiliarySku=None}, tags={key9436=bjbadzbfvpszbsickv}}]}, securityProfile={uefiSettings={secureBootEnabled=true, vTpmEnabled=true}, encryptionAtHost=true, securityType=TrustedLaunch, encryptionIdentity={userAssignedIdentityResourceId=tnajlgbwcepmhytzb}, proxyAgentSettings={enabled=true, mode=Audit, keyIncarnationId=4, wireServer={mode=Audit, inVMAccessControlProfileReferenceId=xvlzroy}, imds={mode=Audit, inVMAccessControlProfileReferenceId=xvlzroy}, addProxyAgentExtension=true}}, diagnosticsProfile={bootDiagnostics={enabled=true, storageUri=pxuhtzehlfsqolbdleirgj}}, licenseType=ymwuemwuntbignqyvzqflvjpcdus, extensionsTimeBudget=dnyqmcijikzkltjav, scheduledEventsProfile={terminateNotificationProfile={notBeforeTimeout=owbwifqrlsdmm, enable=true}, osImageNotificationProfile={notBeforeTimeout=ataqykjdakdvyyzdspaqnhd, enable=true}}, userData=nwjvxe, capacityReservation={capacityReservationGroup={id=lvzxxyypkeqlflftmfn}}, applicationProfile={galleryApplications=[{tags=cmygipvpkegyclvpznfu, order=8, packageReferenceId=afrfkjdrtzftmwramfyu, configurationReference=nmfaspclhidtznslsps, treatFailureAsDeploymentFailure=true, enableAutomaticUpgrade=true}]}, vmExtensions=[{name=jkpmcxwuahpzwkvexgzpypk, properties={forceUpdateTag=dockqxgatsfzhctxrncuw, publisher=qesyfldbfoaexyoywhcxafdtdwcg, type=ptlmlzpbpbkfbu, typeHandlerVersion=crllsludntz, autoUpgradeMinorVersion=true, enableAutomaticUpgrade=true, settings={}, protectedSettings={}, suppressFailures=true, protectedSettingsFromKeyVault={secretUrl=vzkogocyw, sourceVault={id=lvzxxyypkeqlflftmfn}}, provisionAfterExtensions=[onbtyoeifafiktrkmal]}}]}" + .getBytes(StandardCharsets.UTF_8)), + "computeApiVersion", + BinaryData.fromBytes("axcvphjtsdjzcwqczcglmq".getBytes(StandardCharsets.UTF_8)), "name", + BinaryData.fromBytes("dbozdvegpdvqxltqipvmqsfgunpe".getBytes(StandardCharsets.UTF_8)))) + .withResourceOverrides(Arrays.asList(mapOf("plan", BinaryData.fromBytes( + "{name=iemasqqkbixbewezyrhnpntjd, publisher=bvggylbvfstnscuupuithafvvgc, product=bguuzrknnuohugjhernflurpx, promotionCode=bxgonranwqoryfkhkfaumdgz, version=uyxetqmmzvqianqv}" + .getBytes(StandardCharsets.UTF_8)), + "zones", BinaryData.fromBytes("[wczj]".getBytes(StandardCharsets.UTF_8)), "identity", + BinaryData.fromBytes( + "{type=SystemAssigned, userAssignedIdentities={key7={}}}".getBytes(StandardCharsets.UTF_8)), + "extendedLocation", + BinaryData + .fromBytes("{name=gbnxzymbdkxhwjpqkur, type=EdgeZone}".getBytes(StandardCharsets.UTF_8)), + "placement", + BinaryData.fromBytes( + "{zonePlacementPolicy=Any, includeZones=[inagtbtedobdea], excludeZones=[pvvwrhuhdpvbacwmesblpgwzk]}" + .getBytes(StandardCharsets.UTF_8)), + "tags", BinaryData.fromBytes("{key6824=cefndldgkx}".getBytes(StandardCharsets.UTF_8)), + "properties", + BinaryData.fromBytes( + "{scheduledEventsPolicy={userInitiatedRedeploy={automaticallyApprove=true}, userInitiatedReboot={automaticallyApprove=true}, scheduledEventsAdditionalPublishingTargets={eventGridAndResourceGraph={enable=true, scheduledEventsApiVersion=lifncbftlkounuyfn}}, allInstancesDown={automaticallyApprove=true}}, storageProfile={imageReference={publisher=ojlplghybdamadvsrq, offer=uvnqoxhkxefqwbsvjgbswqy, sku=hajdxhjmlkx, version=u, sharedGalleryImageId=fz, communityGalleryImageId=tsfpcq, id=cdbrkpdicibtlliq}, osDisk={osType=Windows, encryptionSettings={diskEncryptionKey={secretUrl=vzkogocyw, sourceVault={id=lvzxxyypkeqlflftmfn}}, keyEncryptionKey={keyUrl=mjjkvgpoohatw, sourceVault={id=lvzxxyypkeqlflftmfn}}, enabled=true}, name=opogpznvctmraoajgizcyrfvpt, vhd={uri=elpzggtxubepzgjqvdbjmbu}, image={uri=elpzggtxubepzgjqvdbjmbu}, caching=None, writeAcceleratorEnabled=true, diffDiskSettings={option=Local, placement=CacheDisk}, createOption=FromImage, diskSizeGB=2, managedDisk={storageAccountType=Standard_LRS, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}, securityProfile={securityEncryptionType=VMGuestStateOnly, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}}, id=numddbqmkxuu}, deleteOption=Delete}, dataDisks=[{lun=7, name=nbthfzqsxyqvqnbgcljxbwyyoj, vhd={uri=elpzggtxubepzgjqvdbjmbu}, image={uri=elpzggtxubepzgjqvdbjmbu}, caching=None, writeAcceleratorEnabled=true, createOption=FromImage, diskSizeGB=19, managedDisk={storageAccountType=Standard_LRS, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}, securityProfile={securityEncryptionType=VMGuestStateOnly, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}}, id=numddbqmkxuu}, sourceResource={id=qnukyordmomtjjqabovlsxl}, toBeDetached=true, detachOption=ForceDetach, deleteOption=Delete}], diskControllerType=SCSI}, hardwareProfile={vmSize=szrnjqwbruz, vmSizeProperties={vCpusAvailable=24, vCpusPerCore=6}}, additionalCapabilities={ultraSSDEnabled=true, hibernationEnabled=true}, osProfile={computerName=bplxnfp, adminUsername=fxzbi, adminPassword=, customData=hbdlirohsgnbrahscboc, windowsConfiguration={provisionVMAgent=true, enableAutomaticUpdates=true, timeZone=t, additionalUnattendContent=[{passName=OobeSystem, componentName=Microsoft-Windows-Shell-Setup, settingName=AutoLogon, content=rguazthnx}], patchSettings={patchMode=Manual, enableHotpatching=true, assessmentMode=ImageDefault, automaticByPlatformSettings={rebootSetting=Unknown, bypassPlatformSafetyChecksOnUserSchedule=true}}, winRM={listeners=[{protocol=Http, certificateUrl=quhfapfpyeeocwvwtvuggoqqwt}]}}, linuxConfiguration={disablePasswordAuthentication=true, ssh={publicKeys=[{path=mrdfxnfjazxog, keyData=wfhrknkehgesontscqyrewfmhgwt}]}, provisionVMAgent=true, patchSettings={patchMode=ImageDefault, assessmentMode=ImageDefault, automaticByPlatformSettings={rebootSetting=Unknown, bypassPlatformSafetyChecksOnUserSchedule=true}}, enableVMAgentPlatformUpdates=true}, secrets=[{sourceVault={id=lvzxxyypkeqlflftmfn}, vaultCertificates=[{certificateUrl=crgbpfdvlohwkupdjp, certificateStore=hyx}]}], allowExtensionOperations=true, requireGuestProvisionSignal=true}, networkProfile={networkInterfaces=[{properties={primary=true, deleteOption=Delete}, id=ymfxctb}], networkApiVersion=2020-11-01, networkInterfaceConfigurations=[{name=qrkzoctmzjketostzabnra, properties={primary=true, deleteOption=Delete, enableAcceleratedNetworking=true, disableTcpStateTracking=true, enableFpga=true, enableIPForwarding=true, networkSecurityGroup={id=lvzxxyypkeqlflftmfn}, dnsSettings={dnsServers=[tqcqopnanyyiavfwhqbkarxtrfqbww]}, ipConfigurations=[{name=gqymuvgzzfmxqvdadx, properties={subnet={id=lvzxxyypkeqlflftmfn}, primary=true, publicIPAddressConfiguration={name=cwxsqjijtwbsyqdwht, properties={idleTimeoutInMinutes=17, deleteOption=Delete, dnsSettings={domainNameLabel=fampou, domainNameLabelScope=TenantReuse}, ipTags=[{ipTagType=hkjoxhqadudjartwooezaxl, tag=xywunkjglkmmwfpf}], publicIPPrefix={id=lvzxxyypkeqlflftmfn}, publicIPAddressVersion=IPv4, publicIPAllocationMethod=Dynamic}, sku={name=Basic, tier=Regional}, tags={key5442=qhpwpnylvmdthxazhxamnbhdfpf}}, privateIPAddressVersion=IPv4, applicationSecurityGroups=[{id=lvzxxyypkeqlflftmfn}], applicationGatewayBackendAddressPools=[{id=lvzxxyypkeqlflftmfn}], loadBalancerBackendAddressPools=[{id=lvzxxyypkeqlflftmfn}]}}], dscpConfiguration={id=lvzxxyypkeqlflftmfn}, auxiliaryMode=None, auxiliarySku=None}, tags={key9436=bjbadzbfvpszbsickv}}]}, securityProfile={uefiSettings={secureBootEnabled=true, vTpmEnabled=true}, encryptionAtHost=true, securityType=TrustedLaunch, encryptionIdentity={userAssignedIdentityResourceId=tnajlgbwcepmhytzb}, proxyAgentSettings={enabled=true, mode=Audit, keyIncarnationId=4, wireServer={mode=Audit, inVMAccessControlProfileReferenceId=xvlzroy}, imds={mode=Audit, inVMAccessControlProfileReferenceId=xvlzroy}, addProxyAgentExtension=true}}, diagnosticsProfile={bootDiagnostics={enabled=true, storageUri=pxuhtzehlfsqolbdleirgj}}, licenseType=ymwuemwuntbignqyvzqflvjpcdus, extensionsTimeBudget=dnyqmcijikzkltjav, scheduledEventsProfile={terminateNotificationProfile={notBeforeTimeout=owbwifqrlsdmm, enable=true}, osImageNotificationProfile={notBeforeTimeout=ataqykjdakdvyyzdspaqnhd, enable=true}}, userData=nwjvxe, capacityReservation={capacityReservationGroup={id=lvzxxyypkeqlflftmfn}}, applicationProfile={galleryApplications=[{tags=cmygipvpkegyclvpznfu, order=8, packageReferenceId=afrfkjdrtzftmwramfyu, configurationReference=nmfaspclhidtznslsps, treatFailureAsDeploymentFailure=true, enableAutomaticUpgrade=true}]}, vmExtensions=[{name=jkpmcxwuahpzwkvexgzpypk, properties={forceUpdateTag=dockqxgatsfzhctxrncuw, publisher=qesyfldbfoaexyoywhcxafdtdwcg, type=ptlmlzpbpbkfbu, typeHandlerVersion=crllsludntz, autoUpgradeMinorVersion=true, enableAutomaticUpgrade=true, settings={}, protectedSettings={}, suppressFailures=true, protectedSettingsFromKeyVault={secretUrl=vzkogocyw, sourceVault={id=lvzxxyypkeqlflftmfn}}, provisionAfterExtensions=[onbtyoeifafiktrkmal]}}]}" + .getBytes(StandardCharsets.UTF_8)), + "computeApiVersion", + BinaryData.fromBytes("axcvphjtsdjzcwqczcglmq".getBytes(StandardCharsets.UTF_8)), "name", + BinaryData.fromBytes("dbozdvegpdvqxltqipvmqsfgunpe".getBytes(StandardCharsets.UTF_8))))) + .withResourceCount(10) + .withResourcePrefix("mwbopevxbjcunljvruov") + .withFlexProperties(new FlexProperties() + .withVmSizeProfiles(Arrays.asList(new VmSizeProfile().withName("frbnnpdkq").withRank(7))) + .withOsType(OsType.WINDOWS) + .withPriorityProfile(new PriorityProfile().withType(PriorityType.REGULAR) + .withMaxPricePerVM(23.0D) + .withEvictionPolicy(EvictionPolicy.DELETE) + .withAllocationStrategy(AllocationStrategy.LOWEST_PRICE)) + .withZoneAllocationPolicy(new ZoneAllocationPolicy() + .withDistributionStrategy(DistributionStrategy.BEST_EFFORT_SINGLE_ZONE) + .withZonePreferences(Arrays + .asList(new ZonePreference().withZone("ixksjnaxwelhfpsoyjfaezievquqv").withRank(19)))) + .withMinCapacity(5))) + .withExecutionParameters(new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(2) + .withRetryWindowInMinutes(19) + .withOnFailureAction(ResourceOperationType.UNKNOWN))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkVdiFlexCreate_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineBulkOperations_BulkVdiFlexCreate_Example - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void virtualMachineBulkOperationsBulkVdiFlexCreateExampleGeneratedByMinimumSetRule( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.virtualMachineBulkOperations() + .bulkVdiFlexCreateOperationWithResponse("rgBulkactions", "useast2euap", + new ExecuteVdiCreateRequest() + .withResourceConfigParameters(new ResourceProvisionVdiPayload().withResourceCount(10) + .withFlexProperties(new FlexProperties() + .withVmSizeProfiles( + Arrays.asList(new VmSizeProfile().withName("Standard_D2ads_v5").withRank(7))) + .withOsType(OsType.WINDOWS) + .withPriorityProfile(new PriorityProfile()))) + .withExecutionParameters(new ExecutionParameters()), com.azure.core.util.Context.NONE); } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } ``` diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/pom.xml b/sdk/compute/azure-resourcemanager-compute-bulkactions/pom.xml index fff5987801b4..bb69ab79a70f 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/pom.xml +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for Compute BulkActions Management - This package contains Microsoft Azure SDK for Compute BulkActions Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package api-version 2026-06-06. + This package contains Microsoft Azure SDK for Compute BulkActions Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package api-version 2026-07-06-preview. https://github.com/Azure/azure-sdk-for-java @@ -45,6 +45,7 @@ UTF-8 0 0 + true diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/ComputeBulkActionsManager.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/ComputeBulkActionsManager.java index c711dbe53461..86fac42dad4b 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/ComputeBulkActionsManager.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/ComputeBulkActionsManager.java @@ -26,8 +26,10 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.compute.bulkactions.fluent.ComputeBulkActionsManagementClient; import com.azure.resourcemanager.compute.bulkactions.implementation.ComputeBulkActionsManagementClientBuilder; +import com.azure.resourcemanager.compute.bulkactions.implementation.LaunchBulkInstancesOperationsImpl; import com.azure.resourcemanager.compute.bulkactions.implementation.OperationsImpl; import com.azure.resourcemanager.compute.bulkactions.implementation.VirtualMachineBulkOperationsImpl; +import com.azure.resourcemanager.compute.bulkactions.models.LaunchBulkInstancesOperations; import com.azure.resourcemanager.compute.bulkactions.models.Operations; import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineBulkOperations; import java.time.Duration; @@ -46,6 +48,8 @@ public final class ComputeBulkActionsManager { private VirtualMachineBulkOperations virtualMachineBulkOperations; + private LaunchBulkInstancesOperations launchBulkInstancesOperations; + private final ComputeBulkActionsManagementClient clientObject; private ComputeBulkActionsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -286,6 +290,20 @@ public VirtualMachineBulkOperations virtualMachineBulkOperations() { return virtualMachineBulkOperations; } + /** + * Gets the resource collection API of LaunchBulkInstancesOperations. It manages + * LocationBasedLaunchBulkInstancesOperation. + * + * @return Resource collection API of LaunchBulkInstancesOperations. + */ + public LaunchBulkInstancesOperations launchBulkInstancesOperations() { + if (this.launchBulkInstancesOperations == null) { + this.launchBulkInstancesOperations + = new LaunchBulkInstancesOperationsImpl(clientObject.getLaunchBulkInstancesOperations(), this); + } + return launchBulkInstancesOperations; + } + /** * Gets wrapped service client ComputeBulkActionsManagementClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/ComputeBulkActionsManagementClient.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/ComputeBulkActionsManagementClient.java index 7da885fc87c6..843ae082a2b8 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/ComputeBulkActionsManagementClient.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/ComputeBulkActionsManagementClient.java @@ -59,4 +59,11 @@ public interface ComputeBulkActionsManagementClient { * @return the VirtualMachineBulkOperationsClient object. */ VirtualMachineBulkOperationsClient getVirtualMachineBulkOperations(); + + /** + * Gets the LaunchBulkInstancesOperationsClient object to access its operations. + * + * @return the LaunchBulkInstancesOperationsClient object. + */ + LaunchBulkInstancesOperationsClient getLaunchBulkInstancesOperations(); } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/LaunchBulkInstancesOperationsClient.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/LaunchBulkInstancesOperationsClient.java new file mode 100644 index 000000000000..eb7c0a3628e2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/LaunchBulkInstancesOperationsClient.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.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.bulkactions.fluent.models.LocationBasedLaunchBulkInstancesOperationInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.VirtualMachineInner; + +/** + * An instance of this class provides access to all the operations defined in LaunchBulkInstancesOperationsClient. + */ +public interface LaunchBulkInstancesOperationsClient { + /** + * Gets an instance of LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of LaunchBulkInstancesOperations along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String location, + String name, Context context); + + /** + * Gets an instance of LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of LaunchBulkInstancesOperations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LocationBasedLaunchBulkInstancesOperationInner get(String resourceGroupName, String location, String name); + + /** + * Get the status of a LaunchBulkInstancesOperation. + * + * @param location The location name. + * @param asyncOperationId The async operation id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a LaunchBulkInstancesOperation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getOperationStatusWithResponse(String location, String asyncOperationId, + Context context); + + /** + * Get the status of a LaunchBulkInstancesOperation. + * + * @param location The location name. + * @param asyncOperationId The async operation id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a LaunchBulkInstancesOperation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner getOperationStatus(String location, String asyncOperationId); + + /** + * Creates or updates LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of location based LaunchBulkInstancesOperation resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LocationBasedLaunchBulkInstancesOperationInner> + beginCreateOrUpdate(String resourceGroupName, String location, String name, + LocationBasedLaunchBulkInstancesOperationInner resource); + + /** + * Creates or updates LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of location based LaunchBulkInstancesOperation resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LocationBasedLaunchBulkInstancesOperationInner> + beginCreateOrUpdate(String resourceGroupName, String location, String name, + LocationBasedLaunchBulkInstancesOperationInner resource, Context context); + + /** + * Creates or updates LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return location based LaunchBulkInstancesOperation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LocationBasedLaunchBulkInstancesOperationInner createOrUpdate(String resourceGroupName, String location, + String name, LocationBasedLaunchBulkInstancesOperationInner resource); + + /** + * Creates or updates LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return location based LaunchBulkInstancesOperation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LocationBasedLaunchBulkInstancesOperationInner createOrUpdate(String resourceGroupName, String location, + String name, LocationBasedLaunchBulkInstancesOperationInner resource, Context context); + + /** + * Deletes LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 location, String name); + + /** + * Deletes LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param deleteInstances When true, deletes all virtual machines created by this BulkAction 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, Void> beginDelete(String resourceGroupName, String location, String name, + Boolean deleteInstances, Context context); + + /** + * Deletes LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the 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 location, String name); + + /** + * Deletes LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param deleteInstances When true, deletes all virtual machines created by this BulkAction Operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String location, String name, Boolean deleteInstances, Context context); + + /** + * Cancels LaunchBulkInstancesOperation instances that have not yet launched. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 location, String name); + + /** + * Cancels LaunchBulkInstancesOperation instances that have not yet launched. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 location, String name, + Context context); + + /** + * Cancels LaunchBulkInstancesOperation instances that have not yet launched. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the 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 location, String name); + + /** + * Cancels LaunchBulkInstancesOperation instances that have not yet launched. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the 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 location, String name, Context context); + + /** + * List LaunchBulkInstancesOperation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, + String location); + + /** + * List LaunchBulkInstancesOperation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, + String location, Context context); + + /** + * List LaunchBulkInstancesOperation resources by subscriptionId. + * + * @param location The location name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscription(String location); + + /** + * List LaunchBulkInstancesOperation resources by subscriptionId. + * + * @param location The location name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscription(String location, Context context); + + /** + * List VirtualMachine resources of a LaunchBulkInstancesOperation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a virtual machine list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachines(String resourceGroupName, String location, String name); + + /** + * List VirtualMachine resources of a LaunchBulkInstancesOperation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param filter Filter expression to filter the virtual machines. + * @param skiptoken Skip token for pagination. Uses the token from a previous response to fetch the next page of + * results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a virtual machine list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachines(String resourceGroupName, String location, String name, + String filter, String skiptoken, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/VirtualMachineBulkOperationsClient.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/VirtualMachineBulkOperationsClient.java index de89952e8a5f..c952d4c8d7ed 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/VirtualMachineBulkOperationsClient.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/VirtualMachineBulkOperationsClient.java @@ -6,19 +6,28 @@ 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.bulkactions.fluent.models.AcknowledgeBulkOperationErrorsResponseInner; import com.azure.resourcemanager.compute.bulkactions.fluent.models.CancelOperationsResponseInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.CreateResourceOperationResponseInner; import com.azure.resourcemanager.compute.bulkactions.fluent.models.DeallocateResourceOperationResponseInner; import com.azure.resourcemanager.compute.bulkactions.fluent.models.DeleteResourceOperationResponseInner; import com.azure.resourcemanager.compute.bulkactions.fluent.models.GetOperationStatusResponseInner; import com.azure.resourcemanager.compute.bulkactions.fluent.models.HibernateResourceOperationResponseInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.ReimageResourceOperationResponseInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.ResourceOperationInner; import com.azure.resourcemanager.compute.bulkactions.fluent.models.StartResourceOperationResponseInner; +import com.azure.resourcemanager.compute.bulkactions.models.AcknowledgeBulkOperationErrorsRequest; import com.azure.resourcemanager.compute.bulkactions.models.CancelOperationsContent; +import com.azure.resourcemanager.compute.bulkactions.models.ExecuteCreateContent; import com.azure.resourcemanager.compute.bulkactions.models.ExecuteDeallocateContent; import com.azure.resourcemanager.compute.bulkactions.models.ExecuteDeleteContent; import com.azure.resourcemanager.compute.bulkactions.models.ExecuteHibernateContent; +import com.azure.resourcemanager.compute.bulkactions.models.ExecuteReimageRequest; import com.azure.resourcemanager.compute.bulkactions.models.ExecuteStartContent; +import com.azure.resourcemanager.compute.bulkactions.models.ExecuteVdiCreateRequest; import com.azure.resourcemanager.compute.bulkactions.models.GetOperationStatusContent; /** @@ -124,6 +133,72 @@ Response bulkStartOperationWithResponse(Str StartResourceOperationResponseInner bulkStartOperation(String resourceGroupName, String location, ExecuteStartContent requestBody); + /** + * BulkCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as + * Computeschedule receives it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a create request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response bulkCreateOperationWithResponse(String resourceGroupName, + String location, ExecuteCreateContent requestBody, Context context); + + /** + * BulkCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as + * Computeschedule receives it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a create request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CreateResourceOperationResponseInner bulkCreateOperation(String resourceGroupName, String location, + ExecuteCreateContent requestBody); + + /** + * BulkVdiFlexCreate: Bulk create operation for a batch of virtual machines, this operation supports flex properties + * to give options on Sku and zone selection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a create request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response bulkVdiFlexCreateOperationWithResponse(String resourceGroupName, + String location, ExecuteVdiCreateRequest requestBody, Context context); + + /** + * BulkVdiFlexCreate: Bulk create operation for a batch of virtual machines, this operation supports flex properties + * to give options on Sku and zone selection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a create request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CreateResourceOperationResponseInner bulkVdiFlexCreateOperation(String resourceGroupName, String location, + ExecuteVdiCreateRequest requestBody); + /** * BulkDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as * Computeschedule receives it. @@ -218,4 +293,97 @@ Response bulkCancelOperationsWithResponse(String @ServiceMethod(returns = ReturnType.SINGLE) CancelOperationsResponseInner bulkCancelOperations(String resourceGroupName, String location, CancelOperationsContent requestBody); + + /** + * BulkReimage: Execute reimage operation for a batch of virtual machines, this operation is triggered as soon as + * Computeschedule receives it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a reimage request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response bulkReimageOperationWithResponse(String resourceGroupName, + String location, ExecuteReimageRequest requestBody, Context context); + + /** + * BulkReimage: Execute reimage operation for a batch of virtual machines, this operation is triggered as soon as + * Computeschedule receives it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a reimage request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReimageResourceOperationResponseInner bulkReimageOperation(String resourceGroupName, String location, + ExecuteReimageRequest requestBody); + + /** + * BulkListOperationErrors: List bulk operation errors for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 from listing bulk operation errors as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable bulkListOperationErrors(String resourceGroupName, String location); + + /** + * BulkListOperationErrors: List bulk operation errors for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param lookbackInMinutes The number of minutes to look back for errors. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 from listing bulk operation errors as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable bulkListOperationErrors(String resourceGroupName, String location, + Integer lookbackInMinutes, Context context); + + /** + * BulkAcknowledgeOperationErrors: Acknowledge bulk operation errors for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param body The list of operation ids to acknowledge. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 from acknowledging bulk operation errors along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response bulkAcknowledgeOperationErrorsWithResponse( + String resourceGroupName, String location, AcknowledgeBulkOperationErrorsRequest body, Context context); + + /** + * BulkAcknowledgeOperationErrors: Acknowledge bulk operation errors for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param body The list of operation ids to acknowledge. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 from acknowledging bulk operation errors. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AcknowledgeBulkOperationErrorsResponseInner bulkAcknowledgeOperationErrors(String resourceGroupName, + String location, AcknowledgeBulkOperationErrorsRequest body); } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/AcknowledgeBulkOperationErrorsResponseInner.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/AcknowledgeBulkOperationErrorsResponseInner.java new file mode 100644 index 000000000000..c1a67eab4ed6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/AcknowledgeBulkOperationErrorsResponseInner.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The response from acknowledging bulk operation errors. + */ +@Immutable +public final class AcknowledgeBulkOperationErrorsResponseInner + implements JsonSerializable { + /* + * The set of operation ids that were newly acknowledged + */ + private List acknowledged; + + /* + * The set of operation ids that were not found in the completed operations store + */ + private List notFound; + + /* + * The set of operation ids that were skipped because they were already acknowledged, not failed, or belong to a + * different scope + */ + private List skipped; + + /** + * Creates an instance of AcknowledgeBulkOperationErrorsResponseInner class. + */ + private AcknowledgeBulkOperationErrorsResponseInner() { + } + + /** + * Get the acknowledged property: The set of operation ids that were newly acknowledged. + * + * @return the acknowledged value. + */ + public List acknowledged() { + return this.acknowledged; + } + + /** + * Get the notFound property: The set of operation ids that were not found in the completed operations store. + * + * @return the notFound value. + */ + public List notFound() { + return this.notFound; + } + + /** + * Get the skipped property: The set of operation ids that were skipped because they were already acknowledged, not + * failed, or belong to a different scope. + * + * @return the skipped value. + */ + public List skipped() { + return this.skipped; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("acknowledged", this.acknowledged, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("notFound", this.notFound, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("skipped", this.skipped, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AcknowledgeBulkOperationErrorsResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AcknowledgeBulkOperationErrorsResponseInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AcknowledgeBulkOperationErrorsResponseInner. + */ + public static AcknowledgeBulkOperationErrorsResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AcknowledgeBulkOperationErrorsResponseInner deserializedAcknowledgeBulkOperationErrorsResponseInner + = new AcknowledgeBulkOperationErrorsResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("acknowledged".equals(fieldName)) { + List acknowledged = reader.readArray(reader1 -> reader1.getString()); + deserializedAcknowledgeBulkOperationErrorsResponseInner.acknowledged = acknowledged; + } else if ("notFound".equals(fieldName)) { + List notFound = reader.readArray(reader1 -> reader1.getString()); + deserializedAcknowledgeBulkOperationErrorsResponseInner.notFound = notFound; + } else if ("skipped".equals(fieldName)) { + List skipped = reader.readArray(reader1 -> reader1.getString()); + deserializedAcknowledgeBulkOperationErrorsResponseInner.skipped = skipped; + } else { + reader.skipChildren(); + } + } + + return deserializedAcknowledgeBulkOperationErrorsResponseInner; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/CancelOperationsResponseInner.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/CancelOperationsResponseInner.java index 670bf5312da1..034a4e4cb042 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/CancelOperationsResponseInner.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/CancelOperationsResponseInner.java @@ -9,7 +9,6 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperation; import java.io.IOException; import java.util.List; @@ -21,7 +20,7 @@ public final class CancelOperationsResponseInner implements JsonSerializable results; + private List results; /** * Creates an instance of CancelOperationsResponseInner class. @@ -34,7 +33,7 @@ private CancelOperationsResponseInner() { * * @return the results value. */ - public List results() { + public List results() { return this.results; } @@ -66,7 +65,8 @@ public static CancelOperationsResponseInner fromJson(JsonReader jsonReader) thro reader.nextToken(); if ("results".equals(fieldName)) { - List results = reader.readArray(reader1 -> ResourceOperation.fromJson(reader1)); + List results + = reader.readArray(reader1 -> ResourceOperationInner.fromJson(reader1)); deserializedCancelOperationsResponseInner.results = results; } else { reader.skipChildren(); diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/CreateResourceOperationResponseInner.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/CreateResourceOperationResponseInner.java new file mode 100644 index 000000000000..e23ea0326684 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/CreateResourceOperationResponseInner.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The response from a create request. + */ +@Immutable +public final class CreateResourceOperationResponseInner + implements JsonSerializable { + /* + * The description of the operation response + */ + private String description; + + /* + * The type of resources used in the create request eg virtual machines + */ + private String type; + + /* + * The location of the create request eg westus + */ + private String location; + + /* + * The results from the create request if no errors exist + */ + private List results; + + /** + * Creates an instance of CreateResourceOperationResponseInner class. + */ + private CreateResourceOperationResponseInner() { + } + + /** + * Get the description property: The description of the operation response. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the type property: The type of resources used in the create request eg virtual machines. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the location property: The location of the create request eg westus. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the results property: The results from the create request if no errors exist. + * + * @return the results value. + */ + public List results() { + return this.results; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeArrayField("results", this.results, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateResourceOperationResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateResourceOperationResponseInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CreateResourceOperationResponseInner. + */ + public static CreateResourceOperationResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CreateResourceOperationResponseInner deserializedCreateResourceOperationResponseInner + = new CreateResourceOperationResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedCreateResourceOperationResponseInner.description = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCreateResourceOperationResponseInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedCreateResourceOperationResponseInner.location = reader.getString(); + } else if ("results".equals(fieldName)) { + List results + = reader.readArray(reader1 -> ResourceOperationInner.fromJson(reader1)); + deserializedCreateResourceOperationResponseInner.results = results; + } else { + reader.skipChildren(); + } + } + + return deserializedCreateResourceOperationResponseInner; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/DeallocateResourceOperationResponseInner.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/DeallocateResourceOperationResponseInner.java index 52b044c2177b..1745d6fc3344 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/DeallocateResourceOperationResponseInner.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/DeallocateResourceOperationResponseInner.java @@ -9,7 +9,6 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperation; import java.io.IOException; import java.util.List; @@ -37,7 +36,7 @@ public final class DeallocateResourceOperationResponseInner /* * The results from the deallocate request if no errors exist */ - private List results; + private List results; /** * Creates an instance of DeallocateResourceOperationResponseInner class. @@ -77,7 +76,7 @@ public String location() { * * @return the results value. */ - public List results() { + public List results() { return this.results; } @@ -118,7 +117,8 @@ public static DeallocateResourceOperationResponseInner fromJson(JsonReader jsonR } else if ("location".equals(fieldName)) { deserializedDeallocateResourceOperationResponseInner.location = reader.getString(); } else if ("results".equals(fieldName)) { - List results = reader.readArray(reader1 -> ResourceOperation.fromJson(reader1)); + List results + = reader.readArray(reader1 -> ResourceOperationInner.fromJson(reader1)); deserializedDeallocateResourceOperationResponseInner.results = results; } else { reader.skipChildren(); diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/DeleteResourceOperationResponseInner.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/DeleteResourceOperationResponseInner.java index ee8045a9a850..58ec0491c533 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/DeleteResourceOperationResponseInner.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/DeleteResourceOperationResponseInner.java @@ -9,7 +9,6 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperation; import java.io.IOException; import java.util.List; @@ -37,7 +36,7 @@ public final class DeleteResourceOperationResponseInner /* * The results from the delete request if no errors exist */ - private List results; + private List results; /** * Creates an instance of DeleteResourceOperationResponseInner class. @@ -77,7 +76,7 @@ public String location() { * * @return the results value. */ - public List results() { + public List results() { return this.results; } @@ -118,7 +117,8 @@ public static DeleteResourceOperationResponseInner fromJson(JsonReader jsonReade } else if ("location".equals(fieldName)) { deserializedDeleteResourceOperationResponseInner.location = reader.getString(); } else if ("results".equals(fieldName)) { - List results = reader.readArray(reader1 -> ResourceOperation.fromJson(reader1)); + List results + = reader.readArray(reader1 -> ResourceOperationInner.fromJson(reader1)); deserializedDeleteResourceOperationResponseInner.results = results; } else { reader.skipChildren(); diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/GetOperationStatusResponseInner.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/GetOperationStatusResponseInner.java index 480ac41b6c40..254c3beed904 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/GetOperationStatusResponseInner.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/GetOperationStatusResponseInner.java @@ -9,7 +9,6 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperation; import java.io.IOException; import java.util.List; @@ -21,7 +20,7 @@ public final class GetOperationStatusResponseInner implements JsonSerializable results; + private List results; /** * Creates an instance of GetOperationStatusResponseInner class. @@ -34,7 +33,7 @@ private GetOperationStatusResponseInner() { * * @return the results value. */ - public List results() { + public List results() { return this.results; } @@ -66,7 +65,8 @@ public static GetOperationStatusResponseInner fromJson(JsonReader jsonReader) th reader.nextToken(); if ("results".equals(fieldName)) { - List results = reader.readArray(reader1 -> ResourceOperation.fromJson(reader1)); + List results + = reader.readArray(reader1 -> ResourceOperationInner.fromJson(reader1)); deserializedGetOperationStatusResponseInner.results = results; } else { reader.skipChildren(); diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/HibernateResourceOperationResponseInner.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/HibernateResourceOperationResponseInner.java index d7fd6634c845..4d2f0911dec4 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/HibernateResourceOperationResponseInner.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/HibernateResourceOperationResponseInner.java @@ -9,7 +9,6 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperation; import java.io.IOException; import java.util.List; @@ -37,7 +36,7 @@ public final class HibernateResourceOperationResponseInner /* * The results from the Hibernate request if no errors exist */ - private List results; + private List results; /** * Creates an instance of HibernateResourceOperationResponseInner class. @@ -77,7 +76,7 @@ public String location() { * * @return the results value. */ - public List results() { + public List results() { return this.results; } @@ -118,7 +117,8 @@ public static HibernateResourceOperationResponseInner fromJson(JsonReader jsonRe } else if ("location".equals(fieldName)) { deserializedHibernateResourceOperationResponseInner.location = reader.getString(); } else if ("results".equals(fieldName)) { - List results = reader.readArray(reader1 -> ResourceOperation.fromJson(reader1)); + List results + = reader.readArray(reader1 -> ResourceOperationInner.fromJson(reader1)); deserializedHibernateResourceOperationResponseInner.results = results; } else { reader.skipChildren(); diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/LocationBasedLaunchBulkInstancesOperationInner.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/LocationBasedLaunchBulkInstancesOperationInner.java new file mode 100644 index 000000000000..fcae773c58d6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/LocationBasedLaunchBulkInstancesOperationInner.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.compute.bulkactions.models.LaunchBulkInstancesOperationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.compute.bulkactions.models.Plan; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Location based LaunchBulkInstancesOperation resource. The location is part of the resource path. + */ +@Fluent +public final class LocationBasedLaunchBulkInstancesOperationInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private LaunchBulkInstancesOperationProperties properties; + + /* + * Zones in which the LaunchBulkInstancesOperation is available + */ + private List zones; + + /* + * Resource tags. + */ + private Map tags; + + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /* + * Details of the resource plan. + */ + private Plan plan; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of LocationBasedLaunchBulkInstancesOperationInner class. + */ + public LocationBasedLaunchBulkInstancesOperationInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public LaunchBulkInstancesOperationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the LocationBasedLaunchBulkInstancesOperationInner object itself. + */ + public LocationBasedLaunchBulkInstancesOperationInner + withProperties(LaunchBulkInstancesOperationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the zones property: Zones in which the LaunchBulkInstancesOperation is available. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: Zones in which the LaunchBulkInstancesOperation is available. + * + * @param zones the zones value to set. + * @return the LocationBasedLaunchBulkInstancesOperationInner object itself. + */ + public LocationBasedLaunchBulkInstancesOperationInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * 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 LocationBasedLaunchBulkInstancesOperationInner object itself. + */ + public LocationBasedLaunchBulkInstancesOperationInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the LocationBasedLaunchBulkInstancesOperationInner object itself. + */ + public LocationBasedLaunchBulkInstancesOperationInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the plan property: Details of the resource plan. + * + * @return the plan value. + */ + public Plan plan() { + return this.plan; + } + + /** + * Set the plan property: Details of the resource plan. + * + * @param plan the plan value to set. + * @return the LocationBasedLaunchBulkInstancesOperationInner object itself. + */ + public LocationBasedLaunchBulkInstancesOperationInner withPlan(Plan plan) { + this.plan = plan; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("plan", this.plan); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocationBasedLaunchBulkInstancesOperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocationBasedLaunchBulkInstancesOperationInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LocationBasedLaunchBulkInstancesOperationInner. + */ + public static LocationBasedLaunchBulkInstancesOperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocationBasedLaunchBulkInstancesOperationInner deserializedLocationBasedLaunchBulkInstancesOperationInner + = new LocationBasedLaunchBulkInstancesOperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLocationBasedLaunchBulkInstancesOperationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLocationBasedLaunchBulkInstancesOperationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLocationBasedLaunchBulkInstancesOperationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedLocationBasedLaunchBulkInstancesOperationInner.properties + = LaunchBulkInstancesOperationProperties.fromJson(reader); + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedLocationBasedLaunchBulkInstancesOperationInner.zones = zones; + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLocationBasedLaunchBulkInstancesOperationInner.tags = tags; + } else if ("identity".equals(fieldName)) { + deserializedLocationBasedLaunchBulkInstancesOperationInner.identity + = ManagedServiceIdentity.fromJson(reader); + } else if ("plan".equals(fieldName)) { + deserializedLocationBasedLaunchBulkInstancesOperationInner.plan = Plan.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLocationBasedLaunchBulkInstancesOperationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLocationBasedLaunchBulkInstancesOperationInner; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/OperationStatusResultInner.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/OperationStatusResultInner.java new file mode 100644 index 000000000000..a19d691a48e1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/OperationStatusResultInner.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * The current status of an async operation. + */ +@Immutable +public final class OperationStatusResultInner implements JsonSerializable { + /* + * Fully qualified ID for the async operation. + */ + private String id; + + /* + * Name of the async operation. + */ + private String name; + + /* + * Operation status. + */ + private String status; + + /* + * Percent of the operation that is complete. + */ + private Double percentComplete; + + /* + * The start time of the operation. + */ + private OffsetDateTime startTime; + + /* + * The end time of the operation. + */ + private OffsetDateTime endTime; + + /* + * The operations list. + */ + private List operations; + + /* + * If present, details of the operation error. + */ + private ManagementError error; + + /* + * Fully qualified ID of the resource against which the original async operation was started. + */ + private String resourceId; + + /** + * Creates an instance of OperationStatusResultInner class. + */ + private OperationStatusResultInner() { + } + + /** + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Name of the async operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + public Double percentComplete() { + return this.percentComplete; + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the operations property: The operations list. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Get the error property: If present, details of the operation error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Get the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("percentComplete", this.percentComplete); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeArrayField("operations", this.operations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusResultInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationStatusResultInner. + */ + public static OperationStatusResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusResultInner deserializedOperationStatusResultInner = new OperationStatusResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedOperationStatusResultInner.status = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedOperationStatusResultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOperationStatusResultInner.name = reader.getString(); + } else if ("percentComplete".equals(fieldName)) { + deserializedOperationStatusResultInner.percentComplete = reader.getNullable(JsonReader::getDouble); + } else if ("startTime".equals(fieldName)) { + deserializedOperationStatusResultInner.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedOperationStatusResultInner.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("operations".equals(fieldName)) { + List operations + = reader.readArray(reader1 -> OperationStatusResultInner.fromJson(reader1)); + deserializedOperationStatusResultInner.operations = operations; + } else if ("error".equals(fieldName)) { + deserializedOperationStatusResultInner.error = ManagementError.fromJson(reader); + } else if ("resourceId".equals(fieldName)) { + deserializedOperationStatusResultInner.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationStatusResultInner; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/ReimageResourceOperationResponseInner.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/ReimageResourceOperationResponseInner.java new file mode 100644 index 000000000000..91ed7df06b61 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/ReimageResourceOperationResponseInner.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The response from a reimage request. + */ +@Immutable +public final class ReimageResourceOperationResponseInner + implements JsonSerializable { + /* + * The description of the operation response + */ + private String description; + + /* + * The type of resources used in the reimage request eg virtual machines + */ + private String type; + + /* + * The location of the reimage request eg westus + */ + private String location; + + /* + * The results from the reimage request if no errors exist + */ + private List results; + + /** + * Creates an instance of ReimageResourceOperationResponseInner class. + */ + private ReimageResourceOperationResponseInner() { + } + + /** + * Get the description property: The description of the operation response. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the type property: The type of resources used in the reimage request eg virtual machines. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the location property: The location of the reimage request eg westus. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the results property: The results from the reimage request if no errors exist. + * + * @return the results value. + */ + public List results() { + return this.results; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeArrayField("results", this.results, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReimageResourceOperationResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReimageResourceOperationResponseInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ReimageResourceOperationResponseInner. + */ + public static ReimageResourceOperationResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReimageResourceOperationResponseInner deserializedReimageResourceOperationResponseInner + = new ReimageResourceOperationResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedReimageResourceOperationResponseInner.description = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedReimageResourceOperationResponseInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedReimageResourceOperationResponseInner.location = reader.getString(); + } else if ("results".equals(fieldName)) { + List results + = reader.readArray(reader1 -> ResourceOperationInner.fromJson(reader1)); + deserializedReimageResourceOperationResponseInner.results = results; + } else { + reader.skipChildren(); + } + } + + return deserializedReimageResourceOperationResponseInner; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/ResourceOperationInner.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/ResourceOperationInner.java new file mode 100644 index 000000000000..cd9eff5468f8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/ResourceOperationInner.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationDetails; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineInfo; +import java.io.IOException; + +/** + * High level response from an operation on a resource. + */ +@Immutable +public final class ResourceOperationInner implements JsonSerializable { + /* + * Unique identifier for the resource involved in the operation, for example Azure resource ID + */ + private String resourceId; + + /* + * Resource level error code if it exists + */ + private String errorCode; + + /* + * Resource level error details if they exist + */ + private String errorDetails; + + /* + * Details of the operation performed on a resource + */ + private ResourceOperationDetails operation; + + /* + * Information about the virtual machine + */ + private VirtualMachineInfo virtualMachineInfo; + + /** + * Creates an instance of ResourceOperationInner class. + */ + private ResourceOperationInner() { + } + + /** + * Get the resourceId property: Unique identifier for the resource involved in the operation, for example Azure + * resource ID. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the errorCode property: Resource level error code if it exists. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Get the errorDetails property: Resource level error details if they exist. + * + * @return the errorDetails value. + */ + public String errorDetails() { + return this.errorDetails; + } + + /** + * Get the operation property: Details of the operation performed on a resource. + * + * @return the operation value. + */ + public ResourceOperationDetails operation() { + return this.operation; + } + + /** + * Get the virtualMachineInfo property: Information about the virtual machine. + * + * @return the virtualMachineInfo value. + */ + public VirtualMachineInfo virtualMachineInfo() { + return this.virtualMachineInfo; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("errorCode", this.errorCode); + jsonWriter.writeStringField("errorDetails", this.errorDetails); + jsonWriter.writeJsonField("operation", this.operation); + jsonWriter.writeJsonField("virtualMachineInfo", this.virtualMachineInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceOperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceOperationInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceOperationInner. + */ + public static ResourceOperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceOperationInner deserializedResourceOperationInner = new ResourceOperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedResourceOperationInner.resourceId = reader.getString(); + } else if ("errorCode".equals(fieldName)) { + deserializedResourceOperationInner.errorCode = reader.getString(); + } else if ("errorDetails".equals(fieldName)) { + deserializedResourceOperationInner.errorDetails = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedResourceOperationInner.operation = ResourceOperationDetails.fromJson(reader); + } else if ("virtualMachineInfo".equals(fieldName)) { + deserializedResourceOperationInner.virtualMachineInfo = VirtualMachineInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceOperationInner; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/StartResourceOperationResponseInner.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/StartResourceOperationResponseInner.java index 0eaa36ea2841..f3933ab189cf 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/StartResourceOperationResponseInner.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/StartResourceOperationResponseInner.java @@ -9,7 +9,6 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperation; import java.io.IOException; import java.util.List; @@ -37,7 +36,7 @@ public final class StartResourceOperationResponseInner /* * The results from the start request if no errors exist */ - private List results; + private List results; /** * Creates an instance of StartResourceOperationResponseInner class. @@ -77,7 +76,7 @@ public String location() { * * @return the results value. */ - public List results() { + public List results() { return this.results; } @@ -118,7 +117,8 @@ public static StartResourceOperationResponseInner fromJson(JsonReader jsonReader } else if ("location".equals(fieldName)) { deserializedStartResourceOperationResponseInner.location = reader.getString(); } else if ("results".equals(fieldName)) { - List results = reader.readArray(reader1 -> ResourceOperation.fromJson(reader1)); + List results + = reader.readArray(reader1 -> ResourceOperationInner.fromJson(reader1)); deserializedStartResourceOperationResponseInner.results = results; } else { reader.skipChildren(); diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/VirtualMachineInner.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/VirtualMachineInner.java new file mode 100644 index 000000000000..7476e6934e26 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/VirtualMachineInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.compute.bulkactions.models.ApiError; +import com.azure.resourcemanager.compute.bulkactions.models.VMOperationStatus; +import java.io.IOException; + +/** + * A virtual machine launched by a LaunchBulkInstancesOperation. + */ +@Immutable +public final class VirtualMachineInner implements JsonSerializable { + /* + * The name of the virtual machine. + */ + private String name; + + /* + * The compute RP resource id of the virtual machine. + * subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName} + */ + private String id; + + /* + * Type of the virtual machine + */ + private String type; + + /* + * Represents the operationStatus of the virtual machine in response to the last operation performed on it by the + * LaunchBulkInstancesOperation. + */ + private VMOperationStatus operationStatus; + + /* + * Error information when operationStatus is Failed. + */ + private ApiError error; + + /** + * Creates an instance of VirtualMachineInner class. + */ + private VirtualMachineInner() { + } + + /** + * Get the name property: The name of the virtual machine. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the id property: The compute RP resource id of the virtual machine. + * subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName}. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the type property: Type of the virtual machine. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the operationStatus property: Represents the operationStatus of the virtual machine in response to the last + * operation performed on it by the LaunchBulkInstancesOperation. + * + * @return the operationStatus value. + */ + public VMOperationStatus operationStatus() { + return this.operationStatus; + } + + /** + * Get the error property: Error information when operationStatus is Failed. + * + * @return the error value. + */ + public ApiError error() { + return this.error; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualMachineInner. + */ + public static VirtualMachineInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInner deserializedVirtualMachineInner = new VirtualMachineInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVirtualMachineInner.name = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedVirtualMachineInner.id = reader.getString(); + } else if ("operationStatus".equals(fieldName)) { + deserializedVirtualMachineInner.operationStatus = VMOperationStatus.fromString(reader.getString()); + } else if ("type".equals(fieldName)) { + deserializedVirtualMachineInner.type = reader.getString(); + } else if ("error".equals(fieldName)) { + deserializedVirtualMachineInner.error = ApiError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInner; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/AcknowledgeBulkOperationErrorsResponseImpl.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/AcknowledgeBulkOperationErrorsResponseImpl.java new file mode 100644 index 000000000000..79a688b18287 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/AcknowledgeBulkOperationErrorsResponseImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.implementation; + +import com.azure.resourcemanager.compute.bulkactions.fluent.models.AcknowledgeBulkOperationErrorsResponseInner; +import com.azure.resourcemanager.compute.bulkactions.models.AcknowledgeBulkOperationErrorsResponse; +import java.util.Collections; +import java.util.List; + +public final class AcknowledgeBulkOperationErrorsResponseImpl implements AcknowledgeBulkOperationErrorsResponse { + private AcknowledgeBulkOperationErrorsResponseInner innerObject; + + private final com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager serviceManager; + + AcknowledgeBulkOperationErrorsResponseImpl(AcknowledgeBulkOperationErrorsResponseInner innerObject, + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List acknowledged() { + List inner = this.innerModel().acknowledged(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List notFound() { + List inner = this.innerModel().notFound(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List skipped() { + List inner = this.innerModel().skipped(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AcknowledgeBulkOperationErrorsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/CancelOperationsResponseImpl.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/CancelOperationsResponseImpl.java index 92ccf544e736..caa5ec2cbba5 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/CancelOperationsResponseImpl.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/CancelOperationsResponseImpl.java @@ -5,10 +5,12 @@ package com.azure.resourcemanager.compute.bulkactions.implementation; import com.azure.resourcemanager.compute.bulkactions.fluent.models.CancelOperationsResponseInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.ResourceOperationInner; import com.azure.resourcemanager.compute.bulkactions.models.CancelOperationsResponse; import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperation; import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; public final class CancelOperationsResponseImpl implements CancelOperationsResponse { private CancelOperationsResponseInner innerObject; @@ -22,9 +24,11 @@ public final class CancelOperationsResponseImpl implements CancelOperationsRespo } public List results() { - List inner = this.innerModel().results(); + List inner = this.innerModel().results(); if (inner != null) { - return Collections.unmodifiableList(inner); + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new ResourceOperationImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { return Collections.emptyList(); } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/ComputeBulkActionsManagementClientImpl.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/ComputeBulkActionsManagementClientImpl.java index 491ddce0b33f..a3ff809a0205 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/ComputeBulkActionsManagementClientImpl.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/ComputeBulkActionsManagementClientImpl.java @@ -27,6 +27,7 @@ import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.compute.bulkactions.fluent.ComputeBulkActionsManagementClient; +import com.azure.resourcemanager.compute.bulkactions.fluent.LaunchBulkInstancesOperationsClient; import com.azure.resourcemanager.compute.bulkactions.fluent.OperationsClient; import com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient; import java.io.IOException; @@ -155,6 +156,20 @@ public VirtualMachineBulkOperationsClient getVirtualMachineBulkOperations() { return this.virtualMachineBulkOperations; } + /** + * The LaunchBulkInstancesOperationsClient object to access its operations. + */ + private final LaunchBulkInstancesOperationsClient launchBulkInstancesOperations; + + /** + * Gets the LaunchBulkInstancesOperationsClient object to access its operations. + * + * @return the LaunchBulkInstancesOperationsClient object. + */ + public LaunchBulkInstancesOperationsClient getLaunchBulkInstancesOperations() { + return this.launchBulkInstancesOperations; + } + /** * Initializes an instance of ComputeBulkActionsManagementClient client. * @@ -172,9 +187,10 @@ public VirtualMachineBulkOperationsClient getVirtualMachineBulkOperations() { this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; this.subscriptionId = subscriptionId; - this.apiVersion = "2026-06-06"; + this.apiVersion = "2026-07-06-preview"; this.operations = new OperationsClientImpl(this); this.virtualMachineBulkOperations = new VirtualMachineBulkOperationsClientImpl(this); + this.launchBulkInstancesOperations = new LaunchBulkInstancesOperationsClientImpl(this); } /** diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/CreateResourceOperationResponseImpl.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/CreateResourceOperationResponseImpl.java new file mode 100644 index 000000000000..f66806fddd7f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/CreateResourceOperationResponseImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.implementation; + +import com.azure.resourcemanager.compute.bulkactions.fluent.models.CreateResourceOperationResponseInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.ResourceOperationInner; +import com.azure.resourcemanager.compute.bulkactions.models.CreateResourceOperationResponse; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperation; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class CreateResourceOperationResponseImpl implements CreateResourceOperationResponse { + private CreateResourceOperationResponseInner innerObject; + + private final com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager serviceManager; + + CreateResourceOperationResponseImpl(CreateResourceOperationResponseInner innerObject, + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String description() { + return this.innerModel().description(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public List results() { + List inner = this.innerModel().results(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new ResourceOperationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public CreateResourceOperationResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/DeallocateResourceOperationResponseImpl.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/DeallocateResourceOperationResponseImpl.java index a5f88d066e13..a136f817bb1b 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/DeallocateResourceOperationResponseImpl.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/DeallocateResourceOperationResponseImpl.java @@ -5,10 +5,12 @@ package com.azure.resourcemanager.compute.bulkactions.implementation; import com.azure.resourcemanager.compute.bulkactions.fluent.models.DeallocateResourceOperationResponseInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.ResourceOperationInner; import com.azure.resourcemanager.compute.bulkactions.models.DeallocateResourceOperationResponse; import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperation; import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; public final class DeallocateResourceOperationResponseImpl implements DeallocateResourceOperationResponse { private DeallocateResourceOperationResponseInner innerObject; @@ -34,9 +36,11 @@ public String location() { } public List results() { - List inner = this.innerModel().results(); + List inner = this.innerModel().results(); if (inner != null) { - return Collections.unmodifiableList(inner); + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new ResourceOperationImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { return Collections.emptyList(); } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/DeleteResourceOperationResponseImpl.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/DeleteResourceOperationResponseImpl.java index b3cdb0f3a92a..8d96f32d4924 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/DeleteResourceOperationResponseImpl.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/DeleteResourceOperationResponseImpl.java @@ -5,10 +5,12 @@ package com.azure.resourcemanager.compute.bulkactions.implementation; import com.azure.resourcemanager.compute.bulkactions.fluent.models.DeleteResourceOperationResponseInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.ResourceOperationInner; import com.azure.resourcemanager.compute.bulkactions.models.DeleteResourceOperationResponse; import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperation; import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; public final class DeleteResourceOperationResponseImpl implements DeleteResourceOperationResponse { private DeleteResourceOperationResponseInner innerObject; @@ -34,9 +36,11 @@ public String location() { } public List results() { - List inner = this.innerModel().results(); + List inner = this.innerModel().results(); if (inner != null) { - return Collections.unmodifiableList(inner); + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new ResourceOperationImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { return Collections.emptyList(); } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/GetOperationStatusResponseImpl.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/GetOperationStatusResponseImpl.java index 3e046601d37e..64ab9102afb3 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/GetOperationStatusResponseImpl.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/GetOperationStatusResponseImpl.java @@ -5,10 +5,12 @@ package com.azure.resourcemanager.compute.bulkactions.implementation; import com.azure.resourcemanager.compute.bulkactions.fluent.models.GetOperationStatusResponseInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.ResourceOperationInner; import com.azure.resourcemanager.compute.bulkactions.models.GetOperationStatusResponse; import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperation; import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; public final class GetOperationStatusResponseImpl implements GetOperationStatusResponse { private GetOperationStatusResponseInner innerObject; @@ -22,9 +24,11 @@ public final class GetOperationStatusResponseImpl implements GetOperationStatusR } public List results() { - List inner = this.innerModel().results(); + List inner = this.innerModel().results(); if (inner != null) { - return Collections.unmodifiableList(inner); + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new ResourceOperationImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { return Collections.emptyList(); } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/HibernateResourceOperationResponseImpl.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/HibernateResourceOperationResponseImpl.java index cbf8e16a301b..6146752aeeba 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/HibernateResourceOperationResponseImpl.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/HibernateResourceOperationResponseImpl.java @@ -5,10 +5,12 @@ package com.azure.resourcemanager.compute.bulkactions.implementation; import com.azure.resourcemanager.compute.bulkactions.fluent.models.HibernateResourceOperationResponseInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.ResourceOperationInner; import com.azure.resourcemanager.compute.bulkactions.models.HibernateResourceOperationResponse; import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperation; import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; public final class HibernateResourceOperationResponseImpl implements HibernateResourceOperationResponse { private HibernateResourceOperationResponseInner innerObject; @@ -34,9 +36,11 @@ public String location() { } public List results() { - List inner = this.innerModel().results(); + List inner = this.innerModel().results(); if (inner != null) { - return Collections.unmodifiableList(inner); + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new ResourceOperationImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { return Collections.emptyList(); } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/LaunchBulkInstancesOperationsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/LaunchBulkInstancesOperationsClientImpl.java new file mode 100644 index 000000000000..58d7e21227e8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/LaunchBulkInstancesOperationsClientImpl.java @@ -0,0 +1,1583 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.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.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.bulkactions.fluent.LaunchBulkInstancesOperationsClient; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.LocationBasedLaunchBulkInstancesOperationInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.compute.bulkactions.implementation.models.LaunchBulkInstancesOperationListResult; +import com.azure.resourcemanager.compute.bulkactions.implementation.models.VirtualMachineListResult; +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 LaunchBulkInstancesOperationsClient. + */ +public final class LaunchBulkInstancesOperationsClientImpl implements LaunchBulkInstancesOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final LaunchBulkInstancesOperationsService service; + + /** + * The service client containing this operation class. + */ + private final ComputeBulkActionsManagementClientImpl client; + + /** + * Initializes an instance of LaunchBulkInstancesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LaunchBulkInstancesOperationsClientImpl(ComputeBulkActionsManagementClientImpl client) { + this.service = RestProxy.create(LaunchBulkInstancesOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeBulkActionsManagementClientLaunchBulkInstancesOperations to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ComputeBulkActionsManagementClientLaunchBulkInstancesOperations") + public interface LaunchBulkInstancesOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/launchBulkInstancesOperations/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/launchBulkInstancesOperations/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/launchBulkInstancesOperations/asyncOperations/{asyncOperationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getOperationStatus(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("asyncOperationId") String asyncOperationId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/launchBulkInstancesOperations/asyncOperations/{asyncOperationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getOperationStatusSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("asyncOperationId") String asyncOperationId, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/launchBulkInstancesOperations/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") LocationBasedLaunchBulkInstancesOperationInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/launchBulkInstancesOperations/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") LocationBasedLaunchBulkInstancesOperationInner resource, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/launchBulkInstancesOperations/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("name") String name, @QueryParam("deleteInstances") Boolean deleteInstances, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/launchBulkInstancesOperations/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("name") String name, @QueryParam("deleteInstances") Boolean deleteInstances, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/launchBulkInstancesOperations/{name}/cancel") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cancel(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/launchBulkInstancesOperations/{name}/cancel") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response cancelSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("name") String name, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/launchBulkInstancesOperations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/launchBulkInstancesOperations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/launchBulkInstancesOperations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscription( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/launchBulkInstancesOperations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/launchBulkInstancesOperations/{name}/virtualMachines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualMachines(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("name") String name, @QueryParam("$filter") String filter, + @QueryParam("$skiptoken") String skiptoken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/launchBulkInstancesOperations/{name}/virtualMachines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listVirtualMachinesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("name") String name, @QueryParam("$filter") String filter, + @QueryParam("$skiptoken") String skiptoken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualMachinesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listVirtualMachinesNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets an instance of LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of LaunchBulkInstancesOperations along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getWithResponseAsync(String resourceGroupName, String location, String name) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an instance of LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of LaunchBulkInstancesOperations on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String location, + String name) { + return getWithResponseAsync(resourceGroupName, location, name).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an instance of LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of LaunchBulkInstancesOperations along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String location, String name, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, location, name, accept, context); + } + + /** + * Gets an instance of LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of LaunchBulkInstancesOperations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LocationBasedLaunchBulkInstancesOperationInner get(String resourceGroupName, String location, String name) { + return getWithResponse(resourceGroupName, location, name, Context.NONE).getValue(); + } + + /** + * Get the status of a LaunchBulkInstancesOperation. + * + * @param location The location name. + * @param asyncOperationId The async operation 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 the status of a LaunchBulkInstancesOperation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOperationStatusWithResponseAsync(String location, + String asyncOperationId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getOperationStatus(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, asyncOperationId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the status of a LaunchBulkInstancesOperation. + * + * @param location The location name. + * @param asyncOperationId The async operation 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 the status of a LaunchBulkInstancesOperation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getOperationStatusAsync(String location, String asyncOperationId) { + return getOperationStatusWithResponseAsync(location, asyncOperationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the status of a LaunchBulkInstancesOperation. + * + * @param location The location name. + * @param asyncOperationId The async operation 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 the status of a LaunchBulkInstancesOperation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOperationStatusWithResponse(String location, String asyncOperationId, + Context context) { + final String accept = "application/json"; + return service.getOperationStatusSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, asyncOperationId, accept, context); + } + + /** + * Get the status of a LaunchBulkInstancesOperation. + * + * @param location The location name. + * @param asyncOperationId The async operation 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 the status of a LaunchBulkInstancesOperation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner getOperationStatus(String location, String asyncOperationId) { + return getOperationStatusWithResponse(location, asyncOperationId, Context.NONE).getValue(); + } + + /** + * Creates or updates LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return location based LaunchBulkInstancesOperation resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String location, + String name, LocationBasedLaunchBulkInstancesOperationInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, name, contentType, accept, resource, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return location based LaunchBulkInstancesOperation resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String location, String name, + LocationBasedLaunchBulkInstancesOperationInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, name, contentType, accept, resource, + Context.NONE); + } + + /** + * Creates or updates LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return location based LaunchBulkInstancesOperation resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String location, String name, + LocationBasedLaunchBulkInstancesOperationInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, name, contentType, accept, resource, context); + } + + /** + * Creates or updates LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of location based LaunchBulkInstancesOperation resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, LocationBasedLaunchBulkInstancesOperationInner> + beginCreateOrUpdateAsync(String resourceGroupName, String location, String name, + LocationBasedLaunchBulkInstancesOperationInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, location, name, resource); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), LocationBasedLaunchBulkInstancesOperationInner.class, + LocationBasedLaunchBulkInstancesOperationInner.class, this.client.getContext()); + } + + /** + * Creates or updates LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of location based LaunchBulkInstancesOperation resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, LocationBasedLaunchBulkInstancesOperationInner> + beginCreateOrUpdate(String resourceGroupName, String location, String name, + LocationBasedLaunchBulkInstancesOperationInner resource) { + Response response = createOrUpdateWithResponse(resourceGroupName, location, name, resource); + return this.client + .getLroResult( + response, LocationBasedLaunchBulkInstancesOperationInner.class, + LocationBasedLaunchBulkInstancesOperationInner.class, Context.NONE); + } + + /** + * Creates or updates LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of location based LaunchBulkInstancesOperation resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, LocationBasedLaunchBulkInstancesOperationInner> + beginCreateOrUpdate(String resourceGroupName, String location, String name, + LocationBasedLaunchBulkInstancesOperationInner resource, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, location, name, resource, context); + return this.client + .getLroResult( + response, LocationBasedLaunchBulkInstancesOperationInner.class, + LocationBasedLaunchBulkInstancesOperationInner.class, context); + } + + /** + * Creates or updates LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return location based LaunchBulkInstancesOperation resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String location, String name, LocationBasedLaunchBulkInstancesOperationInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, location, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return location based LaunchBulkInstancesOperation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LocationBasedLaunchBulkInstancesOperationInner createOrUpdate(String resourceGroupName, String location, + String name, LocationBasedLaunchBulkInstancesOperationInner resource) { + return beginCreateOrUpdate(resourceGroupName, location, name, resource).getFinalResult(); + } + + /** + * Creates or updates LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return location based LaunchBulkInstancesOperation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LocationBasedLaunchBulkInstancesOperationInner createOrUpdate(String resourceGroupName, String location, + String name, LocationBasedLaunchBulkInstancesOperationInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, location, name, resource, context).getFinalResult(); + } + + /** + * Deletes LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param deleteInstances When true, deletes all virtual machines created by this BulkAction Operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 location, + String name, Boolean deleteInstances) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, name, deleteInstances, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param deleteInstances When true, deletes all virtual machines created by this BulkAction Operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String location, String name, + Boolean deleteInstances) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, name, deleteInstances, Context.NONE); + } + + /** + * Deletes LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param deleteInstances When true, deletes all virtual machines created by this BulkAction Operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String location, String name, + Boolean deleteInstances, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, name, deleteInstances, context); + } + + /** + * Deletes LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param deleteInstances When true, deletes all virtual machines created by this BulkAction Operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 location, String name, + Boolean deleteInstances) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, location, name, deleteInstances); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 location, + String name) { + final Boolean deleteInstances = null; + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, location, name, deleteInstances); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param deleteInstances When true, deletes all virtual machines created by this BulkAction Operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 location, String name, + Boolean deleteInstances) { + Response response = deleteWithResponse(resourceGroupName, location, name, deleteInstances); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 location, String name) { + final Boolean deleteInstances = null; + Response response = deleteWithResponse(resourceGroupName, location, name, deleteInstances); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param deleteInstances When true, deletes all virtual machines created by this BulkAction Operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 location, String name, + Boolean deleteInstances, Context context) { + Response response = deleteWithResponse(resourceGroupName, location, name, deleteInstances, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param deleteInstances When true, deletes all virtual machines created by this BulkAction Operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException 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 location, String name, Boolean deleteInstances) { + return beginDeleteAsync(resourceGroupName, location, name, deleteInstances).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException 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 location, String name) { + final Boolean deleteInstances = null; + return beginDeleteAsync(resourceGroupName, location, name, deleteInstances).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request 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 location, String name) { + final Boolean deleteInstances = null; + beginDelete(resourceGroupName, location, name, deleteInstances).getFinalResult(); + } + + /** + * Deletes LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param deleteInstances When true, deletes all virtual machines created by this BulkAction Operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request 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 location, String name, Boolean deleteInstances, + Context context) { + beginDelete(resourceGroupName, location, name, deleteInstances, context).getFinalResult(); + } + + /** + * Cancels LaunchBulkInstancesOperation instances that have not yet launched. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 location, + String name) { + return FluxUtil + .withContext(context -> service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancels LaunchBulkInstancesOperation instances that have not yet launched. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response cancelWithResponse(String resourceGroupName, String location, String name) { + return service.cancelSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, name, Context.NONE); + } + + /** + * Cancels LaunchBulkInstancesOperation instances that have not yet launched. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response cancelWithResponse(String resourceGroupName, String location, String name, + Context context) { + return service.cancelSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, name, context); + } + + /** + * Cancels LaunchBulkInstancesOperation instances that have not yet launched. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 location, + String name) { + Mono>> mono = cancelWithResponseAsync(resourceGroupName, location, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Cancels LaunchBulkInstancesOperation instances that have not yet launched. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 location, String name) { + Response response = cancelWithResponse(resourceGroupName, location, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Cancels LaunchBulkInstancesOperation instances that have not yet launched. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 location, String name, + Context context) { + Response response = cancelWithResponse(resourceGroupName, location, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Cancels LaunchBulkInstancesOperation instances that have not yet launched. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException 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 location, String name) { + return beginCancelAsync(resourceGroupName, location, name).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cancels LaunchBulkInstancesOperation instances that have not yet launched. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request 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 location, String name) { + beginCancel(resourceGroupName, location, name).getFinalResult(); + } + + /** + * Cancels LaunchBulkInstancesOperation instances that have not yet launched. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request 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 location, String name, Context context) { + beginCancel(resourceGroupName, location, name, context).getFinalResult(); + } + + /** + * List LaunchBulkInstancesOperation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, String location) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, accept, context)) + .>map( + res -> new 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 LaunchBulkInstancesOperation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + String location) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, location), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List LaunchBulkInstancesOperation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listByResourceGroupSinglePage(String resourceGroupName, String location) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List LaunchBulkInstancesOperation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listByResourceGroupSinglePage(String resourceGroupName, String location, Context context) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List LaunchBulkInstancesOperation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + String location) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, location), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * List LaunchBulkInstancesOperation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + String location, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, location, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * List LaunchBulkInstancesOperation resources by subscriptionId. + * + * @param location The location name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionSinglePageAsync(String location) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listBySubscription(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context)) + .>map( + res -> new 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 LaunchBulkInstancesOperation resources by subscriptionId. + * + * @param location The location name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionAsync(String location) { + return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(location), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List LaunchBulkInstancesOperation resources by subscriptionId. + * + * @param location The location name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listBySubscriptionSinglePage(String location) { + final String accept = "application/json"; + Response res = service.listBySubscriptionSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List LaunchBulkInstancesOperation resources by subscriptionId. + * + * @param location The location name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionSinglePage(String location, + Context context) { + final String accept = "application/json"; + Response res = service.listBySubscriptionSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List LaunchBulkInstancesOperation resources by subscriptionId. + * + * @param location The location name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscription(String location) { + return new PagedIterable<>(() -> listBySubscriptionSinglePage(location), + nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * List LaunchBulkInstancesOperation resources by subscriptionId. + * + * @param location The location name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscription(String location, + Context context) { + return new PagedIterable<>(() -> listBySubscriptionSinglePage(location, context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * List VirtualMachine resources of a LaunchBulkInstancesOperation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param filter Filter expression to filter the virtual machines. + * @param skiptoken Skip token for pagination. Uses the token from a previous response to fetch the next page of + * results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a virtual machine list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachinesSinglePageAsync(String resourceGroupName, + String location, String name, String filter, String skiptoken) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listVirtualMachines(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, name, filter, skiptoken, accept, context)) + .>map(res -> new 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 VirtualMachine resources of a LaunchBulkInstancesOperation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param filter Filter expression to filter the virtual machines. + * @param skiptoken Skip token for pagination. Uses the token from a previous response to fetch the next page of + * results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a virtual machine list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachinesAsync(String resourceGroupName, String location, + String name, String filter, String skiptoken) { + return new PagedFlux<>( + () -> listVirtualMachinesSinglePageAsync(resourceGroupName, location, name, filter, skiptoken), + nextLink -> listVirtualMachinesNextSinglePageAsync(nextLink)); + } + + /** + * List VirtualMachine resources of a LaunchBulkInstancesOperation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a virtual machine list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachinesAsync(String resourceGroupName, String location, + String name) { + final String filter = null; + final String skiptoken = null; + return new PagedFlux<>( + () -> listVirtualMachinesSinglePageAsync(resourceGroupName, location, name, filter, skiptoken), + nextLink -> listVirtualMachinesNextSinglePageAsync(nextLink)); + } + + /** + * List VirtualMachine resources of a LaunchBulkInstancesOperation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param filter Filter expression to filter the virtual machines. + * @param skiptoken Skip token for pagination. Uses the token from a previous response to fetch the next page of + * results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a virtual machine list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVirtualMachinesSinglePage(String resourceGroupName, String location, + String name, String filter, String skiptoken) { + final String accept = "application/json"; + Response res = service.listVirtualMachinesSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, location, name, filter, + skiptoken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List VirtualMachine resources of a LaunchBulkInstancesOperation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param filter Filter expression to filter the virtual machines. + * @param skiptoken Skip token for pagination. Uses the token from a previous response to fetch the next page of + * results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a virtual machine list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVirtualMachinesSinglePage(String resourceGroupName, String location, + String name, String filter, String skiptoken, Context context) { + final String accept = "application/json"; + Response res + = service.listVirtualMachinesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, name, filter, skiptoken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List VirtualMachine resources of a LaunchBulkInstancesOperation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a virtual machine list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachines(String resourceGroupName, String location, + String name) { + final String filter = null; + final String skiptoken = null; + return new PagedIterable<>( + () -> listVirtualMachinesSinglePage(resourceGroupName, location, name, filter, skiptoken), + nextLink -> listVirtualMachinesNextSinglePage(nextLink)); + } + + /** + * List VirtualMachine resources of a LaunchBulkInstancesOperation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param filter Filter expression to filter the virtual machines. + * @param skiptoken Skip token for pagination. Uses the token from a previous response to fetch the next page of + * results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a virtual machine list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachines(String resourceGroupName, String location, + String name, String filter, String skiptoken, Context context) { + return new PagedIterable<>( + () -> listVirtualMachinesSinglePage(resourceGroupName, location, name, filter, skiptoken, context), + nextLink -> listVirtualMachinesNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listByResourceGroupNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listBySubscriptionNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a virtual machine list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachinesNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listVirtualMachinesNext(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a virtual machine list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVirtualMachinesNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listVirtualMachinesNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a virtual machine list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVirtualMachinesNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listVirtualMachinesNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/LaunchBulkInstancesOperationsImpl.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/LaunchBulkInstancesOperationsImpl.java new file mode 100644 index 000000000000..f1c8e39fb0f4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/LaunchBulkInstancesOperationsImpl.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.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.bulkactions.fluent.LaunchBulkInstancesOperationsClient; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.LocationBasedLaunchBulkInstancesOperationInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.compute.bulkactions.models.LaunchBulkInstancesOperations; +import com.azure.resourcemanager.compute.bulkactions.models.LocationBasedLaunchBulkInstancesOperation; +import com.azure.resourcemanager.compute.bulkactions.models.OperationStatusResult; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachine; + +public final class LaunchBulkInstancesOperationsImpl implements LaunchBulkInstancesOperations { + private static final ClientLogger LOGGER = new ClientLogger(LaunchBulkInstancesOperationsImpl.class); + + private final LaunchBulkInstancesOperationsClient innerClient; + + private final com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager serviceManager; + + public LaunchBulkInstancesOperationsImpl(LaunchBulkInstancesOperationsClient innerClient, + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, + String location, String name, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, location, name, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LocationBasedLaunchBulkInstancesOperationImpl(inner.getValue(), this.manager())); + } + + public LocationBasedLaunchBulkInstancesOperation get(String resourceGroupName, String location, String name) { + LocationBasedLaunchBulkInstancesOperationInner inner + = this.serviceClient().get(resourceGroupName, location, name); + if (inner != null) { + return new LocationBasedLaunchBulkInstancesOperationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getOperationStatusWithResponse(String location, String asyncOperationId, + Context context) { + Response inner + = this.serviceClient().getOperationStatusWithResponse(location, asyncOperationId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OperationStatusResultImpl(inner.getValue(), this.manager())); + } + + public OperationStatusResult getOperationStatus(String location, String asyncOperationId) { + OperationStatusResultInner inner = this.serviceClient().getOperationStatus(location, asyncOperationId); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String location, String name) { + this.serviceClient().delete(resourceGroupName, location, name); + } + + public void delete(String resourceGroupName, String location, String name, Boolean deleteInstances, + Context context) { + this.serviceClient().delete(resourceGroupName, location, name, deleteInstances, context); + } + + public void cancel(String resourceGroupName, String location, String name) { + this.serviceClient().cancel(resourceGroupName, location, name); + } + + public void cancel(String resourceGroupName, String location, String name, Context context) { + this.serviceClient().cancel(resourceGroupName, location, name, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + String location) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, location); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new LocationBasedLaunchBulkInstancesOperationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + String location, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, location, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new LocationBasedLaunchBulkInstancesOperationImpl(inner1, this.manager())); + } + + public PagedIterable listBySubscription(String location) { + PagedIterable inner + = this.serviceClient().listBySubscription(location); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new LocationBasedLaunchBulkInstancesOperationImpl(inner1, this.manager())); + } + + public PagedIterable listBySubscription(String location, + Context context) { + PagedIterable inner + = this.serviceClient().listBySubscription(location, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new LocationBasedLaunchBulkInstancesOperationImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachines(String resourceGroupName, String location, String name) { + PagedIterable inner + = this.serviceClient().listVirtualMachines(resourceGroupName, location, name); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachines(String resourceGroupName, String location, String name, + String filter, String skiptoken, Context context) { + PagedIterable inner + = this.serviceClient().listVirtualMachines(resourceGroupName, location, name, filter, skiptoken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); + } + + public LocationBasedLaunchBulkInstancesOperation getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String location = ResourceManagerUtils.getValueFromIdByName(id, "locations"); + if (location == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "launchBulkInstancesOperations"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'launchBulkInstancesOperations'.", id))); + } + return this.getWithResponse(resourceGroupName, location, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String location = ResourceManagerUtils.getValueFromIdByName(id, "locations"); + if (location == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "launchBulkInstancesOperations"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'launchBulkInstancesOperations'.", id))); + } + return this.getWithResponse(resourceGroupName, location, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String location = ResourceManagerUtils.getValueFromIdByName(id, "locations"); + if (location == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "launchBulkInstancesOperations"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'launchBulkInstancesOperations'.", id))); + } + Boolean localDeleteInstances = null; + this.delete(resourceGroupName, location, name, localDeleteInstances, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean deleteInstances, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String location = ResourceManagerUtils.getValueFromIdByName(id, "locations"); + if (location == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "launchBulkInstancesOperations"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'launchBulkInstancesOperations'.", id))); + } + this.delete(resourceGroupName, location, name, deleteInstances, context); + } + + private LaunchBulkInstancesOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager() { + return this.serviceManager; + } + + public LocationBasedLaunchBulkInstancesOperationImpl define(String name) { + return new LocationBasedLaunchBulkInstancesOperationImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/LocationBasedLaunchBulkInstancesOperationImpl.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/LocationBasedLaunchBulkInstancesOperationImpl.java new file mode 100644 index 000000000000..9538f57780db --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/LocationBasedLaunchBulkInstancesOperationImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.LocationBasedLaunchBulkInstancesOperationInner; +import com.azure.resourcemanager.compute.bulkactions.models.LaunchBulkInstancesOperationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.LocationBasedLaunchBulkInstancesOperation; +import com.azure.resourcemanager.compute.bulkactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.compute.bulkactions.models.Plan; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class LocationBasedLaunchBulkInstancesOperationImpl implements LocationBasedLaunchBulkInstancesOperation, + LocationBasedLaunchBulkInstancesOperation.Definition, LocationBasedLaunchBulkInstancesOperation.Update { + private LocationBasedLaunchBulkInstancesOperationInner innerObject; + + private final com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public LaunchBulkInstancesOperationProperties properties() { + return this.innerModel().properties(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public Plan plan() { + return this.innerModel().plan(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public LocationBasedLaunchBulkInstancesOperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String location; + + private String name; + + public LocationBasedLaunchBulkInstancesOperationImpl withExistingLocation(String resourceGroupName, + String location) { + this.resourceGroupName = resourceGroupName; + this.location = location; + return this; + } + + public LocationBasedLaunchBulkInstancesOperation create() { + this.innerObject = serviceManager.serviceClient() + .getLaunchBulkInstancesOperations() + .createOrUpdate(resourceGroupName, location, name, this.innerModel(), Context.NONE); + return this; + } + + public LocationBasedLaunchBulkInstancesOperation create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLaunchBulkInstancesOperations() + .createOrUpdate(resourceGroupName, location, name, this.innerModel(), context); + return this; + } + + LocationBasedLaunchBulkInstancesOperationImpl(String name, + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager serviceManager) { + this.innerObject = new LocationBasedLaunchBulkInstancesOperationInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public LocationBasedLaunchBulkInstancesOperationImpl update() { + return this; + } + + public LocationBasedLaunchBulkInstancesOperation apply() { + this.innerObject = serviceManager.serviceClient() + .getLaunchBulkInstancesOperations() + .createOrUpdate(resourceGroupName, location, name, this.innerModel(), Context.NONE); + return this; + } + + public LocationBasedLaunchBulkInstancesOperation apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLaunchBulkInstancesOperations() + .createOrUpdate(resourceGroupName, location, name, this.innerModel(), context); + return this; + } + + LocationBasedLaunchBulkInstancesOperationImpl(LocationBasedLaunchBulkInstancesOperationInner innerObject, + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.location = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "locations"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "launchBulkInstancesOperations"); + } + + public LocationBasedLaunchBulkInstancesOperation refresh() { + this.innerObject = serviceManager.serviceClient() + .getLaunchBulkInstancesOperations() + .getWithResponse(resourceGroupName, location, name, Context.NONE) + .getValue(); + return this; + } + + public LocationBasedLaunchBulkInstancesOperation refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLaunchBulkInstancesOperations() + .getWithResponse(resourceGroupName, location, name, context) + .getValue(); + return this; + } + + public void cancel() { + serviceManager.launchBulkInstancesOperations().cancel(resourceGroupName, location, name); + } + + public void cancel(Context context) { + serviceManager.launchBulkInstancesOperations().cancel(resourceGroupName, location, name, context); + } + + public LocationBasedLaunchBulkInstancesOperationImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public LocationBasedLaunchBulkInstancesOperationImpl + withProperties(LaunchBulkInstancesOperationProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public LocationBasedLaunchBulkInstancesOperationImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public LocationBasedLaunchBulkInstancesOperationImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public LocationBasedLaunchBulkInstancesOperationImpl withPlan(Plan plan) { + this.innerModel().withPlan(plan); + return this; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/OperationStatusResultImpl.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/OperationStatusResultImpl.java new file mode 100644 index 000000000000..1d19475685b0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/OperationStatusResultImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.compute.bulkactions.models.OperationStatusResult; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class OperationStatusResultImpl implements OperationStatusResult { + private OperationStatusResultInner innerObject; + + private final com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager serviceManager; + + OperationStatusResultImpl(OperationStatusResultInner innerObject, + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String status() { + return this.innerModel().status(); + } + + public Double percentComplete() { + return this.innerModel().percentComplete(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public List operations() { + List inner = this.innerModel().operations(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new OperationStatusResultImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ManagementError error() { + return this.innerModel().error(); + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public OperationStatusResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/ReimageResourceOperationResponseImpl.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/ReimageResourceOperationResponseImpl.java new file mode 100644 index 000000000000..07a4d8c956a8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/ReimageResourceOperationResponseImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.implementation; + +import com.azure.resourcemanager.compute.bulkactions.fluent.models.ReimageResourceOperationResponseInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.ResourceOperationInner; +import com.azure.resourcemanager.compute.bulkactions.models.ReimageResourceOperationResponse; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperation; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ReimageResourceOperationResponseImpl implements ReimageResourceOperationResponse { + private ReimageResourceOperationResponseInner innerObject; + + private final com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager serviceManager; + + ReimageResourceOperationResponseImpl(ReimageResourceOperationResponseInner innerObject, + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String description() { + return this.innerModel().description(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public List results() { + List inner = this.innerModel().results(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new ResourceOperationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ReimageResourceOperationResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/ResourceOperationImpl.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/ResourceOperationImpl.java new file mode 100644 index 000000000000..f4acc3062251 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/ResourceOperationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.implementation; + +import com.azure.resourcemanager.compute.bulkactions.fluent.models.ResourceOperationInner; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperation; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationDetails; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineInfo; + +public final class ResourceOperationImpl implements ResourceOperation { + private ResourceOperationInner innerObject; + + private final com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager serviceManager; + + ResourceOperationImpl(ResourceOperationInner innerObject, + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public String errorCode() { + return this.innerModel().errorCode(); + } + + public String errorDetails() { + return this.innerModel().errorDetails(); + } + + public ResourceOperationDetails operation() { + return this.innerModel().operation(); + } + + public VirtualMachineInfo virtualMachineInfo() { + return this.innerModel().virtualMachineInfo(); + } + + public ResourceOperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/StartResourceOperationResponseImpl.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/StartResourceOperationResponseImpl.java index 083378673cd1..b2a212528ccf 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/StartResourceOperationResponseImpl.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/StartResourceOperationResponseImpl.java @@ -4,11 +4,13 @@ package com.azure.resourcemanager.compute.bulkactions.implementation; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.ResourceOperationInner; import com.azure.resourcemanager.compute.bulkactions.fluent.models.StartResourceOperationResponseInner; import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperation; import com.azure.resourcemanager.compute.bulkactions.models.StartResourceOperationResponse; import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; public final class StartResourceOperationResponseImpl implements StartResourceOperationResponse { private StartResourceOperationResponseInner innerObject; @@ -34,9 +36,11 @@ public String location() { } public List results() { - List inner = this.innerModel().results(); + List inner = this.innerModel().results(); if (inner != null) { - return Collections.unmodifiableList(inner); + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new ResourceOperationImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { return Collections.emptyList(); } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/VirtualMachineBulkOperationsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/VirtualMachineBulkOperationsClientImpl.java index 9be4dbeda591..107077602376 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/VirtualMachineBulkOperationsClientImpl.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/VirtualMachineBulkOperationsClientImpl.java @@ -6,7 +6,9 @@ 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; @@ -16,23 +18,36 @@ 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.bulkactions.fluent.VirtualMachineBulkOperationsClient; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.AcknowledgeBulkOperationErrorsResponseInner; import com.azure.resourcemanager.compute.bulkactions.fluent.models.CancelOperationsResponseInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.CreateResourceOperationResponseInner; import com.azure.resourcemanager.compute.bulkactions.fluent.models.DeallocateResourceOperationResponseInner; import com.azure.resourcemanager.compute.bulkactions.fluent.models.DeleteResourceOperationResponseInner; import com.azure.resourcemanager.compute.bulkactions.fluent.models.GetOperationStatusResponseInner; import com.azure.resourcemanager.compute.bulkactions.fluent.models.HibernateResourceOperationResponseInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.ReimageResourceOperationResponseInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.ResourceOperationInner; import com.azure.resourcemanager.compute.bulkactions.fluent.models.StartResourceOperationResponseInner; +import com.azure.resourcemanager.compute.bulkactions.implementation.models.ListBulkOperationErrorsResponse; +import com.azure.resourcemanager.compute.bulkactions.models.AcknowledgeBulkOperationErrorsRequest; import com.azure.resourcemanager.compute.bulkactions.models.CancelOperationsContent; +import com.azure.resourcemanager.compute.bulkactions.models.ExecuteCreateContent; import com.azure.resourcemanager.compute.bulkactions.models.ExecuteDeallocateContent; import com.azure.resourcemanager.compute.bulkactions.models.ExecuteDeleteContent; import com.azure.resourcemanager.compute.bulkactions.models.ExecuteHibernateContent; +import com.azure.resourcemanager.compute.bulkactions.models.ExecuteReimageRequest; import com.azure.resourcemanager.compute.bulkactions.models.ExecuteStartContent; +import com.azure.resourcemanager.compute.bulkactions.models.ExecuteVdiCreateRequest; import com.azure.resourcemanager.compute.bulkactions.models.GetOperationStatusContent; import reactor.core.publisher.Mono; @@ -126,6 +141,44 @@ Response bulkStartOperationSync(@HostParam( @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") ExecuteStartContent requestBody, Context context); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/virtualMachinesBulkCreate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> bulkCreateOperation(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExecuteCreateContent requestBody, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/virtualMachinesBulkCreate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response bulkCreateOperationSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExecuteCreateContent requestBody, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/virtualMachinesBulkVdiFlexCreate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> bulkVdiFlexCreateOperation( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExecuteVdiCreateRequest requestBody, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/virtualMachinesBulkVdiFlexCreate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response bulkVdiFlexCreateOperationSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExecuteVdiCreateRequest requestBody, Context context); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/virtualMachinesBulkDelete") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) @@ -179,6 +232,81 @@ Response bulkCancelOperationsSync(@HostParam("end @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") CancelOperationsContent requestBody, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/virtualMachinesBulkReimage") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> bulkReimageOperation( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExecuteReimageRequest requestBody, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/virtualMachinesBulkReimage") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response bulkReimageOperationSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExecuteReimageRequest requestBody, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/listBulkOperationErrors") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> bulkListOperationErrors(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @QueryParam("lookbackInMinutes") Integer lookbackInMinutes, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/listBulkOperationErrors") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response bulkListOperationErrorsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @QueryParam("lookbackInMinutes") Integer lookbackInMinutes, @HeaderParam("Accept") String accept, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/acknowledgeBulkOperationErrors") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> bulkAcknowledgeOperationErrors( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AcknowledgeBulkOperationErrorsRequest body, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/locations/{location}/acknowledgeBulkOperationErrors") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response bulkAcknowledgeOperationErrorsSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AcknowledgeBulkOperationErrorsRequest body, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> bulkListOperationErrorsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response bulkListOperationErrorsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -432,6 +560,173 @@ public StartResourceOperationResponseInner bulkStartOperation(String resourceGro return bulkStartOperationWithResponse(resourceGroupName, location, requestBody, Context.NONE).getValue(); } + /** + * BulkCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as + * Computeschedule receives it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a create request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> bulkCreateOperationWithResponseAsync( + String resourceGroupName, String location, ExecuteCreateContent requestBody) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.bulkCreateOperation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, contentType, accept, requestBody, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * BulkCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as + * Computeschedule receives it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a create request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono bulkCreateOperationAsync(String resourceGroupName, + String location, ExecuteCreateContent requestBody) { + return bulkCreateOperationWithResponseAsync(resourceGroupName, location, requestBody) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * BulkCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as + * Computeschedule receives it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a create request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response bulkCreateOperationWithResponse(String resourceGroupName, + String location, ExecuteCreateContent requestBody, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.bulkCreateOperationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, contentType, accept, requestBody, context); + } + + /** + * BulkCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as + * Computeschedule receives it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a create request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CreateResourceOperationResponseInner bulkCreateOperation(String resourceGroupName, String location, + ExecuteCreateContent requestBody) { + return bulkCreateOperationWithResponse(resourceGroupName, location, requestBody, Context.NONE).getValue(); + } + + /** + * BulkVdiFlexCreate: Bulk create operation for a batch of virtual machines, this operation supports flex properties + * to give options on Sku and zone selection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a create request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> bulkVdiFlexCreateOperationWithResponseAsync( + String resourceGroupName, String location, ExecuteVdiCreateRequest requestBody) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.bulkVdiFlexCreateOperation(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, location, contentType, + accept, requestBody, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * BulkVdiFlexCreate: Bulk create operation for a batch of virtual machines, this operation supports flex properties + * to give options on Sku and zone selection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a create request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono bulkVdiFlexCreateOperationAsync(String resourceGroupName, + String location, ExecuteVdiCreateRequest requestBody) { + return bulkVdiFlexCreateOperationWithResponseAsync(resourceGroupName, location, requestBody) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * BulkVdiFlexCreate: Bulk create operation for a batch of virtual machines, this operation supports flex properties + * to give options on Sku and zone selection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a create request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response bulkVdiFlexCreateOperationWithResponse( + String resourceGroupName, String location, ExecuteVdiCreateRequest requestBody, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.bulkVdiFlexCreateOperationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, contentType, accept, requestBody, context); + } + + /** + * BulkVdiFlexCreate: Bulk create operation for a batch of virtual machines, this operation supports flex properties + * to give options on Sku and zone selection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a create request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CreateResourceOperationResponseInner bulkVdiFlexCreateOperation(String resourceGroupName, String location, + ExecuteVdiCreateRequest requestBody) { + return bulkVdiFlexCreateOperationWithResponse(resourceGroupName, location, requestBody, Context.NONE) + .getValue(); + } + /** * BulkDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as * Computeschedule receives it. @@ -674,4 +969,371 @@ public CancelOperationsResponseInner bulkCancelOperations(String resourceGroupNa CancelOperationsContent requestBody) { return bulkCancelOperationsWithResponse(resourceGroupName, location, requestBody, Context.NONE).getValue(); } + + /** + * BulkReimage: Execute reimage operation for a batch of virtual machines, this operation is triggered as soon as + * Computeschedule receives it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a reimage request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> bulkReimageOperationWithResponseAsync( + String resourceGroupName, String location, ExecuteReimageRequest requestBody) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.bulkReimageOperation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, contentType, accept, requestBody, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * BulkReimage: Execute reimage operation for a batch of virtual machines, this operation is triggered as soon as + * Computeschedule receives it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a reimage request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono bulkReimageOperationAsync(String resourceGroupName, + String location, ExecuteReimageRequest requestBody) { + return bulkReimageOperationWithResponseAsync(resourceGroupName, location, requestBody) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * BulkReimage: Execute reimage operation for a batch of virtual machines, this operation is triggered as soon as + * Computeschedule receives it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a reimage request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response bulkReimageOperationWithResponse(String resourceGroupName, + String location, ExecuteReimageRequest requestBody, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.bulkReimageOperationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, contentType, accept, requestBody, context); + } + + /** + * BulkReimage: Execute reimage operation for a batch of virtual machines, this operation is triggered as soon as + * Computeschedule receives it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a reimage request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReimageResourceOperationResponseInner bulkReimageOperation(String resourceGroupName, String location, + ExecuteReimageRequest requestBody) { + return bulkReimageOperationWithResponse(resourceGroupName, location, requestBody, Context.NONE).getValue(); + } + + /** + * BulkListOperationErrors: List bulk operation errors for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param lookbackInMinutes The number of minutes to look back for errors. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 from listing bulk operation errors along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> bulkListOperationErrorsSinglePageAsync(String resourceGroupName, + String location, Integer lookbackInMinutes) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.bulkListOperationErrors(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, lookbackInMinutes, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * BulkListOperationErrors: List bulk operation errors for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param lookbackInMinutes The number of minutes to look back for errors. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 from listing bulk operation errors as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux bulkListOperationErrorsAsync(String resourceGroupName, String location, + Integer lookbackInMinutes) { + return new PagedFlux<>( + () -> bulkListOperationErrorsSinglePageAsync(resourceGroupName, location, lookbackInMinutes), + nextLink -> bulkListOperationErrorsNextSinglePageAsync(nextLink)); + } + + /** + * BulkListOperationErrors: List bulk operation errors for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 from listing bulk operation errors as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux bulkListOperationErrorsAsync(String resourceGroupName, String location) { + final Integer lookbackInMinutes = null; + return new PagedFlux<>( + () -> bulkListOperationErrorsSinglePageAsync(resourceGroupName, location, lookbackInMinutes), + nextLink -> bulkListOperationErrorsNextSinglePageAsync(nextLink)); + } + + /** + * BulkListOperationErrors: List bulk operation errors for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param lookbackInMinutes The number of minutes to look back for errors. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 from listing bulk operation errors along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse bulkListOperationErrorsSinglePage(String resourceGroupName, + String location, Integer lookbackInMinutes) { + final String accept = "application/json"; + Response res + = service.bulkListOperationErrorsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, lookbackInMinutes, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * BulkListOperationErrors: List bulk operation errors for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param lookbackInMinutes The number of minutes to look back for errors. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 from listing bulk operation errors along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse bulkListOperationErrorsSinglePage(String resourceGroupName, + String location, Integer lookbackInMinutes, Context context) { + final String accept = "application/json"; + Response res + = service.bulkListOperationErrorsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, lookbackInMinutes, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * BulkListOperationErrors: List bulk operation errors for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 from listing bulk operation errors as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable bulkListOperationErrors(String resourceGroupName, String location) { + final Integer lookbackInMinutes = null; + return new PagedIterable<>( + () -> bulkListOperationErrorsSinglePage(resourceGroupName, location, lookbackInMinutes), + nextLink -> bulkListOperationErrorsNextSinglePage(nextLink)); + } + + /** + * BulkListOperationErrors: List bulk operation errors for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param lookbackInMinutes The number of minutes to look back for errors. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 from listing bulk operation errors as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable bulkListOperationErrors(String resourceGroupName, String location, + Integer lookbackInMinutes, Context context) { + return new PagedIterable<>( + () -> bulkListOperationErrorsSinglePage(resourceGroupName, location, lookbackInMinutes, context), + nextLink -> bulkListOperationErrorsNextSinglePage(nextLink, context)); + } + + /** + * BulkAcknowledgeOperationErrors: Acknowledge bulk operation errors for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param body The list of operation ids to acknowledge. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 from acknowledging bulk operation errors along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> bulkAcknowledgeOperationErrorsWithResponseAsync( + String resourceGroupName, String location, AcknowledgeBulkOperationErrorsRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.bulkAcknowledgeOperationErrors(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, location, contentType, + accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * BulkAcknowledgeOperationErrors: Acknowledge bulk operation errors for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param body The list of operation ids to acknowledge. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 from acknowledging bulk operation errors on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono bulkAcknowledgeOperationErrorsAsync( + String resourceGroupName, String location, AcknowledgeBulkOperationErrorsRequest body) { + return bulkAcknowledgeOperationErrorsWithResponseAsync(resourceGroupName, location, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * BulkAcknowledgeOperationErrors: Acknowledge bulk operation errors for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param body The list of operation ids to acknowledge. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 from acknowledging bulk operation errors along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response bulkAcknowledgeOperationErrorsWithResponse( + String resourceGroupName, String location, AcknowledgeBulkOperationErrorsRequest body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.bulkAcknowledgeOperationErrorsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, contentType, accept, body, context); + } + + /** + * BulkAcknowledgeOperationErrors: Acknowledge bulk operation errors for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param body The list of operation ids to acknowledge. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 from acknowledging bulk operation errors. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AcknowledgeBulkOperationErrorsResponseInner bulkAcknowledgeOperationErrors(String resourceGroupName, + String location, AcknowledgeBulkOperationErrorsRequest body) { + return bulkAcknowledgeOperationErrorsWithResponse(resourceGroupName, location, body, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from listing bulk operation errors along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> bulkListOperationErrorsNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.bulkListOperationErrorsNext(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 from listing bulk operation errors along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse bulkListOperationErrorsNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.bulkListOperationErrorsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 from listing bulk operation errors along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse bulkListOperationErrorsNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + Response res + = service.bulkListOperationErrorsNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/VirtualMachineBulkOperationsImpl.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/VirtualMachineBulkOperationsImpl.java index 6b873c9713f6..6b7206e717df 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/VirtualMachineBulkOperationsImpl.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/VirtualMachineBulkOperationsImpl.java @@ -4,28 +4,41 @@ package com.azure.resourcemanager.compute.bulkactions.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.bulkactions.fluent.VirtualMachineBulkOperationsClient; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.AcknowledgeBulkOperationErrorsResponseInner; import com.azure.resourcemanager.compute.bulkactions.fluent.models.CancelOperationsResponseInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.CreateResourceOperationResponseInner; import com.azure.resourcemanager.compute.bulkactions.fluent.models.DeallocateResourceOperationResponseInner; import com.azure.resourcemanager.compute.bulkactions.fluent.models.DeleteResourceOperationResponseInner; import com.azure.resourcemanager.compute.bulkactions.fluent.models.GetOperationStatusResponseInner; import com.azure.resourcemanager.compute.bulkactions.fluent.models.HibernateResourceOperationResponseInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.ReimageResourceOperationResponseInner; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.ResourceOperationInner; import com.azure.resourcemanager.compute.bulkactions.fluent.models.StartResourceOperationResponseInner; +import com.azure.resourcemanager.compute.bulkactions.models.AcknowledgeBulkOperationErrorsRequest; +import com.azure.resourcemanager.compute.bulkactions.models.AcknowledgeBulkOperationErrorsResponse; import com.azure.resourcemanager.compute.bulkactions.models.CancelOperationsContent; import com.azure.resourcemanager.compute.bulkactions.models.CancelOperationsResponse; +import com.azure.resourcemanager.compute.bulkactions.models.CreateResourceOperationResponse; import com.azure.resourcemanager.compute.bulkactions.models.DeallocateResourceOperationResponse; import com.azure.resourcemanager.compute.bulkactions.models.DeleteResourceOperationResponse; +import com.azure.resourcemanager.compute.bulkactions.models.ExecuteCreateContent; import com.azure.resourcemanager.compute.bulkactions.models.ExecuteDeallocateContent; import com.azure.resourcemanager.compute.bulkactions.models.ExecuteDeleteContent; import com.azure.resourcemanager.compute.bulkactions.models.ExecuteHibernateContent; +import com.azure.resourcemanager.compute.bulkactions.models.ExecuteReimageRequest; import com.azure.resourcemanager.compute.bulkactions.models.ExecuteStartContent; +import com.azure.resourcemanager.compute.bulkactions.models.ExecuteVdiCreateRequest; import com.azure.resourcemanager.compute.bulkactions.models.GetOperationStatusContent; import com.azure.resourcemanager.compute.bulkactions.models.GetOperationStatusResponse; import com.azure.resourcemanager.compute.bulkactions.models.HibernateResourceOperationResponse; +import com.azure.resourcemanager.compute.bulkactions.models.ReimageResourceOperationResponse; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperation; import com.azure.resourcemanager.compute.bulkactions.models.StartResourceOperationResponse; import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineBulkOperations; @@ -99,6 +112,44 @@ public StartResourceOperationResponse bulkStartOperation(String resourceGroupNam } } + public Response bulkCreateOperationWithResponse(String resourceGroupName, + String location, ExecuteCreateContent requestBody, Context context) { + Response inner + = this.serviceClient().bulkCreateOperationWithResponse(resourceGroupName, location, requestBody, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CreateResourceOperationResponseImpl(inner.getValue(), this.manager())); + } + + public CreateResourceOperationResponse bulkCreateOperation(String resourceGroupName, String location, + ExecuteCreateContent requestBody) { + CreateResourceOperationResponseInner inner + = this.serviceClient().bulkCreateOperation(resourceGroupName, location, requestBody); + if (inner != null) { + return new CreateResourceOperationResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response bulkVdiFlexCreateOperationWithResponse(String resourceGroupName, + String location, ExecuteVdiCreateRequest requestBody, Context context) { + Response inner = this.serviceClient() + .bulkVdiFlexCreateOperationWithResponse(resourceGroupName, location, requestBody, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CreateResourceOperationResponseImpl(inner.getValue(), this.manager())); + } + + public CreateResourceOperationResponse bulkVdiFlexCreateOperation(String resourceGroupName, String location, + ExecuteVdiCreateRequest requestBody) { + CreateResourceOperationResponseInner inner + = this.serviceClient().bulkVdiFlexCreateOperation(resourceGroupName, location, requestBody); + if (inner != null) { + return new CreateResourceOperationResponseImpl(inner, this.manager()); + } else { + return null; + } + } + public Response bulkDeleteOperationWithResponse(String resourceGroupName, String location, ExecuteDeleteContent requestBody, Context context) { Response inner @@ -156,6 +207,57 @@ public CancelOperationsResponse bulkCancelOperations(String resourceGroupName, S } } + public Response bulkReimageOperationWithResponse(String resourceGroupName, + String location, ExecuteReimageRequest requestBody, Context context) { + Response inner + = this.serviceClient().bulkReimageOperationWithResponse(resourceGroupName, location, requestBody, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ReimageResourceOperationResponseImpl(inner.getValue(), this.manager())); + } + + public ReimageResourceOperationResponse bulkReimageOperation(String resourceGroupName, String location, + ExecuteReimageRequest requestBody) { + ReimageResourceOperationResponseInner inner + = this.serviceClient().bulkReimageOperation(resourceGroupName, location, requestBody); + if (inner != null) { + return new ReimageResourceOperationResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable bulkListOperationErrors(String resourceGroupName, String location) { + PagedIterable inner + = this.serviceClient().bulkListOperationErrors(resourceGroupName, location); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceOperationImpl(inner1, this.manager())); + } + + public PagedIterable bulkListOperationErrors(String resourceGroupName, String location, + Integer lookbackInMinutes, Context context) { + PagedIterable inner + = this.serviceClient().bulkListOperationErrors(resourceGroupName, location, lookbackInMinutes, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceOperationImpl(inner1, this.manager())); + } + + public Response bulkAcknowledgeOperationErrorsWithResponse( + String resourceGroupName, String location, AcknowledgeBulkOperationErrorsRequest body, Context context) { + Response inner = this.serviceClient() + .bulkAcknowledgeOperationErrorsWithResponse(resourceGroupName, location, body, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AcknowledgeBulkOperationErrorsResponseImpl(inner.getValue(), this.manager())); + } + + public AcknowledgeBulkOperationErrorsResponse bulkAcknowledgeOperationErrors(String resourceGroupName, + String location, AcknowledgeBulkOperationErrorsRequest body) { + AcknowledgeBulkOperationErrorsResponseInner inner + = this.serviceClient().bulkAcknowledgeOperationErrors(resourceGroupName, location, body); + if (inner != null) { + return new AcknowledgeBulkOperationErrorsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + private VirtualMachineBulkOperationsClient serviceClient() { return this.innerClient; } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/VirtualMachineImpl.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/VirtualMachineImpl.java new file mode 100644 index 000000000000..77b5862ef580 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/VirtualMachineImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.implementation; + +import com.azure.resourcemanager.compute.bulkactions.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.compute.bulkactions.models.ApiError; +import com.azure.resourcemanager.compute.bulkactions.models.VMOperationStatus; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachine; + +public final class VirtualMachineImpl implements VirtualMachine { + private VirtualMachineInner innerObject; + + private final com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager serviceManager; + + VirtualMachineImpl(VirtualMachineInner innerObject, + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public VMOperationStatus operationStatus() { + return this.innerModel().operationStatus(); + } + + public ApiError error() { + return this.innerModel().error(); + } + + public VirtualMachineInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/models/LaunchBulkInstancesOperationListResult.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/models/LaunchBulkInstancesOperationListResult.java new file mode 100644 index 000000000000..4774e2333229 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/models/LaunchBulkInstancesOperationListResult.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.LocationBasedLaunchBulkInstancesOperationInner; +import java.io.IOException; +import java.util.List; + +/** + * List of LaunchBulkInstancesOperation resources. + */ +@Immutable +public final class LaunchBulkInstancesOperationListResult + implements JsonSerializable { + /* + * The list of LaunchBulkInstancesOperation resources. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of LaunchBulkInstancesOperationListResult class. + */ + private LaunchBulkInstancesOperationListResult() { + } + + /** + * Get the value property: The list of LaunchBulkInstancesOperation resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LaunchBulkInstancesOperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LaunchBulkInstancesOperationListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LaunchBulkInstancesOperationListResult. + */ + public static LaunchBulkInstancesOperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LaunchBulkInstancesOperationListResult deserializedLaunchBulkInstancesOperationListResult + = new LaunchBulkInstancesOperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> LocationBasedLaunchBulkInstancesOperationInner.fromJson(reader1)); + deserializedLaunchBulkInstancesOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLaunchBulkInstancesOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLaunchBulkInstancesOperationListResult; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/models/ListBulkOperationErrorsResponse.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/models/ListBulkOperationErrorsResponse.java new file mode 100644 index 000000000000..ad9701b57dc7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/models/ListBulkOperationErrorsResponse.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.ResourceOperationInner; +import java.io.IOException; +import java.util.List; + +/** + * The response from listing bulk operation errors. + */ +@Immutable +public final class ListBulkOperationErrorsResponse implements JsonSerializable { + /* + * The ResourceOperation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ListBulkOperationErrorsResponse class. + */ + private ListBulkOperationErrorsResponse() { + } + + /** + * Get the value property: The ResourceOperation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListBulkOperationErrorsResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListBulkOperationErrorsResponse if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ListBulkOperationErrorsResponse. + */ + public static ListBulkOperationErrorsResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListBulkOperationErrorsResponse deserializedListBulkOperationErrorsResponse + = new ListBulkOperationErrorsResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ResourceOperationInner.fromJson(reader1)); + deserializedListBulkOperationErrorsResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListBulkOperationErrorsResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListBulkOperationErrorsResponse; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/models/VirtualMachineListResult.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/models/VirtualMachineListResult.java new file mode 100644 index 000000000000..a989c0950402 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/models/VirtualMachineListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.VirtualMachineInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a virtual machine list operation. + */ +@Immutable +public final class VirtualMachineListResult implements JsonSerializable { + /* + * The Virtual Machine items on this page. + */ + private List value; + + /* + * The link to the next page of items. + */ + private String nextLink; + + /** + * Creates an instance of VirtualMachineListResult class. + */ + private VirtualMachineListResult() { + } + + /** + * Get the value property: The Virtual Machine items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualMachineListResult. + */ + public static VirtualMachineListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineListResult deserializedVirtualMachineListResult = new VirtualMachineListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VirtualMachineInner.fromJson(reader1)); + deserializedVirtualMachineListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedVirtualMachineListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineListResult; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AcceleratorManufacturer.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AcceleratorManufacturer.java new file mode 100644 index 000000000000..c228bc295e0c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AcceleratorManufacturer.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Accelerator manufacturers supported by Azure VMs. + */ +public final class AcceleratorManufacturer extends ExpandableStringEnum { + /** + * AMD GpuType. + */ + public static final AcceleratorManufacturer AMD = fromString("AMD"); + + /** + * Nvidia GpuType. + */ + public static final AcceleratorManufacturer NVIDIA = fromString("Nvidia"); + + /** + * Xilinx GpuType. + */ + public static final AcceleratorManufacturer XILINX = fromString("Xilinx"); + + /** + * Creates a new instance of AcceleratorManufacturer value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AcceleratorManufacturer() { + } + + /** + * Creates or finds a AcceleratorManufacturer from its string representation. + * + * @param name a name to look for. + * @return the corresponding AcceleratorManufacturer. + */ + public static AcceleratorManufacturer fromString(String name) { + return fromString(name, AcceleratorManufacturer.class); + } + + /** + * Gets known AcceleratorManufacturer values. + * + * @return known AcceleratorManufacturer values. + */ + public static Collection values() { + return values(AcceleratorManufacturer.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AcceleratorType.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AcceleratorType.java new file mode 100644 index 000000000000..f9bb230eab53 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AcceleratorType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Accelerator types supported by Azure VMs. + */ +public final class AcceleratorType extends ExpandableStringEnum { + /** + * GPU Accelerator. + */ + public static final AcceleratorType GPU = fromString("GPU"); + + /** + * FPGA Accelerator. + */ + public static final AcceleratorType FPGA = fromString("FPGA"); + + /** + * Creates a new instance of AcceleratorType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AcceleratorType() { + } + + /** + * Creates or finds a AcceleratorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AcceleratorType. + */ + public static AcceleratorType fromString(String name) { + return fromString(name, AcceleratorType.class); + } + + /** + * Gets known AcceleratorType values. + * + * @return known AcceleratorType values. + */ + public static Collection values() { + return values(AcceleratorType.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AcknowledgeBulkOperationErrorsRequest.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AcknowledgeBulkOperationErrorsRequest.java new file mode 100644 index 000000000000..c3cdc03894d8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AcknowledgeBulkOperationErrorsRequest.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The request to acknowledge bulk operation errors. + */ +@Fluent +public final class AcknowledgeBulkOperationErrorsRequest + implements JsonSerializable { + /* + * The set of operation ids to acknowledge. + */ + private List operationIds; + + /** + * Creates an instance of AcknowledgeBulkOperationErrorsRequest class. + */ + public AcknowledgeBulkOperationErrorsRequest() { + } + + /** + * Get the operationIds property: The set of operation ids to acknowledge. + * + * @return the operationIds value. + */ + public List operationIds() { + return this.operationIds; + } + + /** + * Set the operationIds property: The set of operation ids to acknowledge. + * + * @param operationIds the operationIds value to set. + * @return the AcknowledgeBulkOperationErrorsRequest object itself. + */ + public AcknowledgeBulkOperationErrorsRequest withOperationIds(List operationIds) { + this.operationIds = operationIds; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("operationIds", this.operationIds, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AcknowledgeBulkOperationErrorsRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AcknowledgeBulkOperationErrorsRequest if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AcknowledgeBulkOperationErrorsRequest. + */ + public static AcknowledgeBulkOperationErrorsRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AcknowledgeBulkOperationErrorsRequest deserializedAcknowledgeBulkOperationErrorsRequest + = new AcknowledgeBulkOperationErrorsRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationIds".equals(fieldName)) { + List operationIds = reader.readArray(reader1 -> reader1.getString()); + deserializedAcknowledgeBulkOperationErrorsRequest.operationIds = operationIds; + } else { + reader.skipChildren(); + } + } + + return deserializedAcknowledgeBulkOperationErrorsRequest; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AcknowledgeBulkOperationErrorsResponse.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AcknowledgeBulkOperationErrorsResponse.java new file mode 100644 index 000000000000..7adc01ea71a5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AcknowledgeBulkOperationErrorsResponse.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.resourcemanager.compute.bulkactions.fluent.models.AcknowledgeBulkOperationErrorsResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of AcknowledgeBulkOperationErrorsResponse. + */ +public interface AcknowledgeBulkOperationErrorsResponse { + /** + * Gets the acknowledged property: The set of operation ids that were newly acknowledged. + * + * @return the acknowledged value. + */ + List acknowledged(); + + /** + * Gets the notFound property: The set of operation ids that were not found in the completed operations store. + * + * @return the notFound value. + */ + List notFound(); + + /** + * Gets the skipped property: The set of operation ids that were skipped because they were already acknowledged, not + * failed, or belong to a different scope. + * + * @return the skipped value. + */ + List skipped(); + + /** + * Gets the inner + * com.azure.resourcemanager.compute.bulkactions.fluent.models.AcknowledgeBulkOperationErrorsResponseInner object. + * + * @return the inner object. + */ + AcknowledgeBulkOperationErrorsResponseInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AdditionalCapabilities.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AdditionalCapabilities.java new file mode 100644 index 000000000000..982e68eb7e1f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AdditionalCapabilities.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Enables or disables a capability on the virtual machine or virtual machine scale set. + */ +@Fluent +public final class AdditionalCapabilities implements JsonSerializable { + /* + * 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. + */ + private Boolean ultraSSDEnabled; + + /* + * The flag that enables or disables hibernation capability on the VM. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("ultraSSDEnabled", this.ultraSSDEnabled); + jsonWriter.writeBooleanField("hibernationEnabled", this.hibernationEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdditionalCapabilities from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdditionalCapabilities if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AdditionalCapabilities. + */ + public static AdditionalCapabilities fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdditionalCapabilities deserializedAdditionalCapabilities = new AdditionalCapabilities(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ultraSSDEnabled".equals(fieldName)) { + deserializedAdditionalCapabilities.ultraSSDEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("hibernationEnabled".equals(fieldName)) { + deserializedAdditionalCapabilities.hibernationEnabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAdditionalCapabilities; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AdditionalUnattendContent.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AdditionalUnattendContent.java new file mode 100644 index 000000000000..9e84b1d759c5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AdditionalUnattendContent.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * 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 implements JsonSerializable { + /* + * The pass name. Currently, the only allowable value is OobeSystem. + */ + private AdditionalUnattendContentPassName passName; + + /* + * The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. + */ + private AdditionalUnattendContentComponentName componentName; + + /* + * Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and + * AutoLogon. + */ + 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. + */ + 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 AdditionalUnattendContentPassName 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(AdditionalUnattendContentPassName 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 AdditionalUnattendContentComponentName 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(AdditionalUnattendContentComponentName 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("passName", this.passName == null ? null : this.passName.toString()); + jsonWriter.writeStringField("componentName", this.componentName == null ? null : this.componentName.toString()); + jsonWriter.writeStringField("settingName", this.settingName == null ? null : this.settingName.toString()); + jsonWriter.writeStringField("content", this.content); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdditionalUnattendContent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdditionalUnattendContent if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AdditionalUnattendContent. + */ + public static AdditionalUnattendContent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdditionalUnattendContent deserializedAdditionalUnattendContent = new AdditionalUnattendContent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("passName".equals(fieldName)) { + deserializedAdditionalUnattendContent.passName + = AdditionalUnattendContentPassName.fromString(reader.getString()); + } else if ("componentName".equals(fieldName)) { + deserializedAdditionalUnattendContent.componentName + = AdditionalUnattendContentComponentName.fromString(reader.getString()); + } else if ("settingName".equals(fieldName)) { + deserializedAdditionalUnattendContent.settingName = SettingNames.fromString(reader.getString()); + } else if ("content".equals(fieldName)) { + deserializedAdditionalUnattendContent.content = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAdditionalUnattendContent; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AdditionalUnattendContentComponentName.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AdditionalUnattendContentComponentName.java new file mode 100644 index 000000000000..efa04a52baec --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AdditionalUnattendContentComponentName.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +/** + * Defines values for AdditionalUnattendContentComponentName. + */ +public enum AdditionalUnattendContentComponentName { + /** + * Enum value Microsoft-Windows-Shell-Setup. + */ + MICROSOFT_WINDOWS_SHELL_SETUP("Microsoft-Windows-Shell-Setup"); + + /** + * The actual serialized value for a AdditionalUnattendContentComponentName instance. + */ + private final String value; + + AdditionalUnattendContentComponentName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AdditionalUnattendContentComponentName instance. + * + * @param value the serialized value to parse. + * @return the parsed AdditionalUnattendContentComponentName object, or null if unable to parse. + */ + public static AdditionalUnattendContentComponentName fromString(String value) { + if (value == null) { + return null; + } + AdditionalUnattendContentComponentName[] items = AdditionalUnattendContentComponentName.values(); + for (AdditionalUnattendContentComponentName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AdditionalUnattendContentPassName.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AdditionalUnattendContentPassName.java new file mode 100644 index 000000000000..30b51dab1f4c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AdditionalUnattendContentPassName.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +/** + * Defines values for AdditionalUnattendContentPassName. + */ +public enum AdditionalUnattendContentPassName { + /** + * Enum value OobeSystem. + */ + OOBE_SYSTEM("OobeSystem"); + + /** + * The actual serialized value for a AdditionalUnattendContentPassName instance. + */ + private final String value; + + AdditionalUnattendContentPassName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AdditionalUnattendContentPassName instance. + * + * @param value the serialized value to parse. + * @return the parsed AdditionalUnattendContentPassName object, or null if unable to parse. + */ + public static AdditionalUnattendContentPassName fromString(String value) { + if (value == null) { + return null; + } + AdditionalUnattendContentPassName[] items = AdditionalUnattendContentPassName.values(); + for (AdditionalUnattendContentPassName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AllInstancesDown.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AllInstancesDown.java new file mode 100644 index 000000000000..b1f8b6cd86d0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AllInstancesDown.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies if Scheduled Events should be auto-approved when all instances are down. + */ +@Fluent +public final class AllInstancesDown implements JsonSerializable { + /* + * Specifies if Scheduled Events should be auto-approved when all instances are down. Its default value is true. + */ + private Boolean allInstancesDownAutomaticallyApprove; + + /** + * Creates an instance of AllInstancesDown class. + */ + public AllInstancesDown() { + } + + /** + * Get the allInstancesDownAutomaticallyApprove property: Specifies if Scheduled Events should be auto-approved when + * all instances are down. Its default value is true. + * + * @return the allInstancesDownAutomaticallyApprove value. + */ + public Boolean allInstancesDownAutomaticallyApprove() { + return this.allInstancesDownAutomaticallyApprove; + } + + /** + * Set the allInstancesDownAutomaticallyApprove property: Specifies if Scheduled Events should be auto-approved when + * all instances are down. Its default value is true. + * + * @param allInstancesDownAutomaticallyApprove the allInstancesDownAutomaticallyApprove value to set. + * @return the AllInstancesDown object itself. + */ + public AllInstancesDown withAllInstancesDownAutomaticallyApprove(Boolean allInstancesDownAutomaticallyApprove) { + this.allInstancesDownAutomaticallyApprove = allInstancesDownAutomaticallyApprove; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("automaticallyApprove", this.allInstancesDownAutomaticallyApprove); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AllInstancesDown from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AllInstancesDown if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AllInstancesDown. + */ + public static AllInstancesDown fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AllInstancesDown deserializedAllInstancesDown = new AllInstancesDown(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("automaticallyApprove".equals(fieldName)) { + deserializedAllInstancesDown.allInstancesDownAutomaticallyApprove + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAllInstancesDown; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AllocationStrategy.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AllocationStrategy.java new file mode 100644 index 000000000000..a206b5e500ea --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AllocationStrategy.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The allocation strategy for VM size selection. + */ +public final class AllocationStrategy extends ExpandableStringEnum { + /** + * Platform prioritizes VM sizes with the lowest hourly cost. + */ + public static final AllocationStrategy LOWEST_PRICE = fromString("LowestPrice"); + + /** + * Customer specifies a rank for each VM size, platform uses VM sizes in rank order. + */ + public static final AllocationStrategy PRIORITIZED = fromString("Prioritized"); + + /** + * Platform prioritizes VM sizes with the highest available capacity first. + */ + public static final AllocationStrategy CAPACITY_OPTIMIZED = fromString("CapacityOptimized"); + + /** + * Creates a new instance of AllocationStrategy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AllocationStrategy() { + } + + /** + * Creates or finds a AllocationStrategy from its string representation. + * + * @param name a name to look for. + * @return the corresponding AllocationStrategy. + */ + public static AllocationStrategy fromString(String name) { + return fromString(name, AllocationStrategy.class); + } + + /** + * Gets known AllocationStrategy values. + * + * @return known AllocationStrategy values. + */ + public static Collection values() { + return values(AllocationStrategy.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ApiEntityReference.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ApiEntityReference.java new file mode 100644 index 000000000000..5e67325ec9b9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ApiEntityReference.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The API entity reference. + */ +@Fluent +public final class ApiEntityReference implements JsonSerializable { + /* + * The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiEntityReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiEntityReference if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ApiEntityReference. + */ + public static ApiEntityReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiEntityReference deserializedApiEntityReference = new ApiEntityReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApiEntityReference.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApiEntityReference; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ApiError.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ApiError.java new file mode 100644 index 000000000000..c53ffdf19160 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ApiError.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * ApiError for Fleet. + */ +@Immutable +public final class ApiError implements JsonSerializable { + /* + * The error code. + */ + private String code; + + /* + * The target of the particular error. + */ + private String target; + + /* + * The error message. + */ + private String message; + + /* + * The API error details + */ + private List details; + + /* + * The API inner error + */ + private InnerError innererror; + + /** + * Creates an instance of ApiError class. + */ + private ApiError() { + } + + /** + * Get the code property: The error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the target property: The target of the particular error. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Get the message property: The error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the details property: The API error details. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Get the innererror property: The API inner error. + * + * @return the innererror value. + */ + public InnerError innererror() { + return this.innererror; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("target", this.target); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeArrayField("details", this.details, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("innererror", this.innererror); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiError if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the ApiError. + */ + public static ApiError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiError deserializedApiError = new ApiError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedApiError.code = reader.getString(); + } else if ("target".equals(fieldName)) { + deserializedApiError.target = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedApiError.message = reader.getString(); + } else if ("details".equals(fieldName)) { + List details = reader.readArray(reader1 -> ApiErrorBase.fromJson(reader1)); + deserializedApiError.details = details; + } else if ("innererror".equals(fieldName)) { + deserializedApiError.innererror = InnerError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApiError; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ApiErrorBase.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ApiErrorBase.java new file mode 100644 index 000000000000..e357312d533e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ApiErrorBase.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * API error base. + */ +@Immutable +public final class ApiErrorBase implements JsonSerializable { + /* + * The error code. + */ + private String code; + + /* + * The target of the particular error. + */ + private String target; + + /* + * The error message. + */ + private String message; + + /** + * Creates an instance of ApiErrorBase class. + */ + private ApiErrorBase() { + } + + /** + * Get the code property: The error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the target property: The target of the particular error. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Get the message property: The error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("target", this.target); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiErrorBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiErrorBase if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ApiErrorBase. + */ + public static ApiErrorBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiErrorBase deserializedApiErrorBase = new ApiErrorBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedApiErrorBase.code = reader.getString(); + } else if ("target".equals(fieldName)) { + deserializedApiErrorBase.target = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedApiErrorBase.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApiErrorBase; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ApplicationProfile.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ApplicationProfile.java new file mode 100644 index 000000000000..6c94978d68af --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ApplicationProfile.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Contains the list of gallery applications that should be made available to the VM. + */ +@Fluent +public final class ApplicationProfile implements JsonSerializable { + /* + * Specifies the gallery applications that should be made available to the VM + */ + 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. + * + * @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. + * + * @param galleryApplications the galleryApplications value to set. + * @return the ApplicationProfile object itself. + */ + public ApplicationProfile withGalleryApplications(List galleryApplications) { + this.galleryApplications = galleryApplications; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("galleryApplications", this.galleryApplications, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationProfile. + */ + public static ApplicationProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationProfile deserializedApplicationProfile = new ApplicationProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("galleryApplications".equals(fieldName)) { + List galleryApplications + = reader.readArray(reader1 -> VMGalleryApplication.fromJson(reader1)); + deserializedApplicationProfile.galleryApplications = galleryApplications; + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationProfile; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ArchitectureType.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ArchitectureType.java new file mode 100644 index 000000000000..4bacb4451ebd --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ArchitectureType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Architecture types supported by Azure VMs. + */ +public final class ArchitectureType extends ExpandableStringEnum { + /** + * ARM64 Architecture. + */ + public static final ArchitectureType ARM64 = fromString("ARM64"); + + /** + * X64 Architecture. + */ + public static final ArchitectureType X64 = fromString("X64"); + + /** + * Creates a new instance of ArchitectureType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ArchitectureType() { + } + + /** + * Creates or finds a ArchitectureType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ArchitectureType. + */ + public static ArchitectureType fromString(String name) { + return fromString(name, ArchitectureType.class); + } + + /** + * Gets known ArchitectureType values. + * + * @return known ArchitectureType values. + */ + public static Collection values() { + return values(ArchitectureType.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/BootDiagnostics.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/BootDiagnostics.java new file mode 100644 index 000000000000..ef1c993bce6a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/BootDiagnostics.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * 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 implements JsonSerializable { + /* + * Whether boot diagnostics should be enabled on the Virtual Machine. + */ + 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. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("storageUri", this.storageUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BootDiagnostics from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BootDiagnostics if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BootDiagnostics. + */ + public static BootDiagnostics fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BootDiagnostics deserializedBootDiagnostics = new BootDiagnostics(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedBootDiagnostics.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("storageUri".equals(fieldName)) { + deserializedBootDiagnostics.storageUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBootDiagnostics; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/BulkActionVmExtensionProperties.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/BulkActionVmExtensionProperties.java new file mode 100644 index 000000000000..8c018e7b825f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/BulkActionVmExtensionProperties.java @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Describes the properties of a Virtual Machine Extension. + */ +@Fluent +public final class BulkActionVmExtensionProperties implements JsonSerializable { + /* + * How the extension handler should be forced to update even if the extension configuration has not changed. + */ + private String forceUpdateTag; + + /* + * The name of the extension handler publisher. + */ + private String publisher; + + /* + * Specifies the type of the extension; an example is 'CustomScriptExtension'. + */ + private String type; + + /* + * Specifies the version of the script handler. + */ + 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. + */ + private Boolean autoUpgradeMinorVersion; + + /* + * Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of + * the extension available. + */ + private Boolean enableAutomaticUpgrade; + + /* + * JSON formatted public settings for the extension. + */ + private Map settings; + + /* + * The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at + * all. + */ + private Map 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. + */ + private Boolean suppressFailures; + + /* + * The extensions protected settings that are passed by reference, and consumed from key vault + */ + private KeyVaultSecretReference protectedSettingsFromKeyVault; + + /* + * Collection of extension names after which this extension needs to be provisioned. + */ + private List provisionAfterExtensions; + + /** + * Creates an instance of BulkActionVmExtensionProperties class. + */ + public BulkActionVmExtensionProperties() { + } + + /** + * 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 BulkActionVmExtensionProperties object itself. + */ + public BulkActionVmExtensionProperties 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 BulkActionVmExtensionProperties object itself. + */ + public BulkActionVmExtensionProperties 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 BulkActionVmExtensionProperties object itself. + */ + public BulkActionVmExtensionProperties 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 BulkActionVmExtensionProperties object itself. + */ + public BulkActionVmExtensionProperties 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 BulkActionVmExtensionProperties object itself. + */ + public BulkActionVmExtensionProperties 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 BulkActionVmExtensionProperties object itself. + */ + public BulkActionVmExtensionProperties withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + + /** + * Get the settings property: JSON formatted public settings for the extension. + * + * @return the settings value. + */ + public Map settings() { + return this.settings; + } + + /** + * Set the settings property: JSON formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the BulkActionVmExtensionProperties object itself. + */ + public BulkActionVmExtensionProperties withSettings(Map 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 Map 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 BulkActionVmExtensionProperties object itself. + */ + public BulkActionVmExtensionProperties withProtectedSettings(Map 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 BulkActionVmExtensionProperties object itself. + */ + public BulkActionVmExtensionProperties 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 BulkActionVmExtensionProperties object itself. + */ + public BulkActionVmExtensionProperties + 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 BulkActionVmExtensionProperties object itself. + */ + public BulkActionVmExtensionProperties withProvisionAfterExtensions(List provisionAfterExtensions) { + this.provisionAfterExtensions = provisionAfterExtensions; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("forceUpdateTag", this.forceUpdateTag); + jsonWriter.writeStringField("publisher", this.publisher); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("typeHandlerVersion", this.typeHandlerVersion); + jsonWriter.writeBooleanField("autoUpgradeMinorVersion", this.autoUpgradeMinorVersion); + jsonWriter.writeBooleanField("enableAutomaticUpgrade", this.enableAutomaticUpgrade); + jsonWriter.writeMapField("settings", this.settings, (writer, element) -> { + if (element == null) { + writer.writeNull(); + } else { + element.writeTo(writer); + } + }); + jsonWriter.writeMapField("protectedSettings", this.protectedSettings, (writer, element) -> { + if (element == null) { + writer.writeNull(); + } else { + element.writeTo(writer); + } + }); + jsonWriter.writeBooleanField("suppressFailures", this.suppressFailures); + jsonWriter.writeJsonField("protectedSettingsFromKeyVault", this.protectedSettingsFromKeyVault); + jsonWriter.writeArrayField("provisionAfterExtensions", this.provisionAfterExtensions, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BulkActionVmExtensionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BulkActionVmExtensionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BulkActionVmExtensionProperties. + */ + public static BulkActionVmExtensionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BulkActionVmExtensionProperties deserializedBulkActionVmExtensionProperties + = new BulkActionVmExtensionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("forceUpdateTag".equals(fieldName)) { + deserializedBulkActionVmExtensionProperties.forceUpdateTag = reader.getString(); + } else if ("publisher".equals(fieldName)) { + deserializedBulkActionVmExtensionProperties.publisher = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBulkActionVmExtensionProperties.type = reader.getString(); + } else if ("typeHandlerVersion".equals(fieldName)) { + deserializedBulkActionVmExtensionProperties.typeHandlerVersion = reader.getString(); + } else if ("autoUpgradeMinorVersion".equals(fieldName)) { + deserializedBulkActionVmExtensionProperties.autoUpgradeMinorVersion + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableAutomaticUpgrade".equals(fieldName)) { + deserializedBulkActionVmExtensionProperties.enableAutomaticUpgrade + = reader.getNullable(JsonReader::getBoolean); + } else if ("settings".equals(fieldName)) { + Map settings = reader.readMap(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + deserializedBulkActionVmExtensionProperties.settings = settings; + } else if ("protectedSettings".equals(fieldName)) { + Map protectedSettings = reader.readMap(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + deserializedBulkActionVmExtensionProperties.protectedSettings = protectedSettings; + } else if ("suppressFailures".equals(fieldName)) { + deserializedBulkActionVmExtensionProperties.suppressFailures + = reader.getNullable(JsonReader::getBoolean); + } else if ("protectedSettingsFromKeyVault".equals(fieldName)) { + deserializedBulkActionVmExtensionProperties.protectedSettingsFromKeyVault + = KeyVaultSecretReference.fromJson(reader); + } else if ("provisionAfterExtensions".equals(fieldName)) { + List provisionAfterExtensions = reader.readArray(reader1 -> reader1.getString()); + deserializedBulkActionVmExtensionProperties.provisionAfterExtensions = provisionAfterExtensions; + } else { + reader.skipChildren(); + } + } + + return deserializedBulkActionVmExtensionProperties; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/BulkactionVMExtension.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/BulkactionVMExtension.java new file mode 100644 index 000000000000..efbc5e6eb948 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/BulkactionVMExtension.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines a virtual machine extension. + */ +@Fluent +public final class BulkactionVMExtension implements JsonSerializable { + /* + * The name of the virtual machine extension. + */ + private String name; + + /* + * Properties of the virtual machine extension. + */ + private BulkActionVmExtensionProperties properties; + + /** + * Creates an instance of BulkactionVMExtension class. + */ + public BulkactionVMExtension() { + } + + /** + * Get the name property: The name of the virtual machine extension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the virtual machine extension. + * + * @param name the name value to set. + * @return the BulkactionVMExtension object itself. + */ + public BulkactionVMExtension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties property: Properties of the virtual machine extension. + * + * @return the properties value. + */ + public BulkActionVmExtensionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the virtual machine extension. + * + * @param properties the properties value to set. + * @return the BulkactionVMExtension object itself. + */ + public BulkactionVMExtension withProperties(BulkActionVmExtensionProperties properties) { + this.properties = properties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BulkactionVMExtension from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BulkactionVMExtension if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BulkactionVMExtension. + */ + public static BulkactionVMExtension fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BulkactionVMExtension deserializedBulkactionVMExtension = new BulkactionVMExtension(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedBulkactionVMExtension.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedBulkactionVMExtension.properties = BulkActionVmExtensionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBulkactionVMExtension; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/BulkactionVMProperties.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/BulkactionVMProperties.java new file mode 100644 index 000000000000..c1071605b043 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/BulkactionVMProperties.java @@ -0,0 +1,526 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes the properties of a Virtual Machine for bulk create. + */ +@Fluent +public final class BulkactionVMProperties implements JsonSerializable { + /* + * Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations + * for the virtual machine. + */ + private ScheduledEventsPolicy scheduledEventsPolicy; + + /* + * Specifies the storage settings for the virtual machine disks. + */ + private StorageProfile storageProfile; + + /* + * Specifies the hardware profile for the virtual machine. + */ + private HardwareProfile hardwareProfile; + + /* + * Specifies additional capabilities enabled or disabled on the virtual machine. + */ + 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. + */ + private OSProfile osProfile; + + /* + * Specifies the network interfaces of the virtual machine. + */ + private NetworkProfile networkProfile; + + /* + * Specifies the Security related profile settings for the virtual machine. + */ + private SecurityProfile securityProfile; + + /* + * Specifies the boot diagnostic settings state. Minimum compute api-version: 2015-06-15. + */ + private DiagnosticsProfile diagnosticsProfile; + + /* + * 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 + */ + private String licenseType; + + /* + * 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 compute api-version: 2020-06-01. + */ + private String extensionsTimeBudget; + + /* + * Specifies Scheduled Event related configurations. + */ + private ScheduledEventsProfile scheduledEventsProfile; + + /* + * UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum compute + * api-version: 2021-03-01. + */ + private String userData; + + /* + * Specifies information about the capacity reservation that is used to allocate virtual machine. Minimum compute + * api-version: 2021-04-01. + */ + private CapacityReservationProfile capacityReservation; + + /* + * Specifies the gallery applications that should be made available to the VM. + */ + private ApplicationProfile applicationProfile; + + /* + * Virtual Machine Extensions Array to be applied to the Virtual Machines. + */ + private List vmExtensions; + + /** + * Creates an instance of BulkactionVMProperties class. + */ + public BulkactionVMProperties() { + } + + /** + * Get the scheduledEventsPolicy property: Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets + * Scheduled Event related configurations for the virtual machine. + * + * @return the scheduledEventsPolicy value. + */ + public ScheduledEventsPolicy scheduledEventsPolicy() { + return this.scheduledEventsPolicy; + } + + /** + * Set the scheduledEventsPolicy property: Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets + * Scheduled Event related configurations for the virtual machine. + * + * @param scheduledEventsPolicy the scheduledEventsPolicy value to set. + * @return the BulkactionVMProperties object itself. + */ + public BulkactionVMProperties withScheduledEventsPolicy(ScheduledEventsPolicy scheduledEventsPolicy) { + this.scheduledEventsPolicy = scheduledEventsPolicy; + 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 BulkactionVMProperties object itself. + */ + public BulkactionVMProperties withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the hardwareProfile property: Specifies the hardware profile for the virtual machine. + * + * @return the hardwareProfile value. + */ + public HardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardwareProfile property: Specifies the hardware profile for the virtual machine. + * + * @param hardwareProfile the hardwareProfile value to set. + * @return the BulkactionVMProperties object itself. + */ + public BulkactionVMProperties withHardwareProfile(HardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + 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 BulkactionVMProperties object itself. + */ + public BulkactionVMProperties 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 BulkactionVMProperties object itself. + */ + public BulkactionVMProperties 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 BulkactionVMProperties object itself. + */ + public BulkactionVMProperties 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 BulkactionVMProperties object itself. + */ + public BulkactionVMProperties withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the diagnosticsProfile property: Specifies the boot diagnostic settings state. Minimum compute 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 compute api-version: + * 2015-06-15. + * + * @param diagnosticsProfile the diagnosticsProfile value to set. + * @return the BulkactionVMProperties object itself. + */ + public BulkactionVMProperties withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { + this.diagnosticsProfile = diagnosticsProfile; + 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 BulkactionVMProperties object itself. + */ + public BulkactionVMProperties withLicenseType(String licenseType) { + this.licenseType = licenseType; + 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 compute 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 compute api-version: 2020-06-01. + * + * @param extensionsTimeBudget the extensionsTimeBudget value to set. + * @return the BulkactionVMProperties object itself. + */ + public BulkactionVMProperties withExtensionsTimeBudget(String extensionsTimeBudget) { + this.extensionsTimeBudget = extensionsTimeBudget; + 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 BulkactionVMProperties object itself. + */ + public BulkactionVMProperties 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 compute 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 compute api-version: 2021-03-01. + * + * @param userData the userData value to set. + * @return the BulkactionVMProperties object itself. + */ + public BulkactionVMProperties 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 compute 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 compute api-version: 2021-04-01. + * + * @param capacityReservation the capacityReservation value to set. + * @return the BulkactionVMProperties object itself. + */ + public BulkactionVMProperties withCapacityReservation(CapacityReservationProfile capacityReservation) { + this.capacityReservation = capacityReservation; + return this; + } + + /** + * Get the applicationProfile property: Specifies the gallery applications that should be made available to the VM. + * + * @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. + * + * @param applicationProfile the applicationProfile value to set. + * @return the BulkactionVMProperties object itself. + */ + public BulkactionVMProperties withApplicationProfile(ApplicationProfile applicationProfile) { + this.applicationProfile = applicationProfile; + return this; + } + + /** + * Get the vmExtensions property: Virtual Machine Extensions Array to be applied to the Virtual Machines. + * + * @return the vmExtensions value. + */ + public List vmExtensions() { + return this.vmExtensions; + } + + /** + * Set the vmExtensions property: Virtual Machine Extensions Array to be applied to the Virtual Machines. + * + * @param vmExtensions the vmExtensions value to set. + * @return the BulkactionVMProperties object itself. + */ + public BulkactionVMProperties withVmExtensions(List vmExtensions) { + this.vmExtensions = vmExtensions; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("scheduledEventsPolicy", this.scheduledEventsPolicy); + jsonWriter.writeJsonField("storageProfile", this.storageProfile); + jsonWriter.writeJsonField("hardwareProfile", this.hardwareProfile); + jsonWriter.writeJsonField("additionalCapabilities", this.additionalCapabilities); + jsonWriter.writeJsonField("osProfile", this.osProfile); + jsonWriter.writeJsonField("networkProfile", this.networkProfile); + jsonWriter.writeJsonField("securityProfile", this.securityProfile); + jsonWriter.writeJsonField("diagnosticsProfile", this.diagnosticsProfile); + jsonWriter.writeStringField("licenseType", this.licenseType); + jsonWriter.writeStringField("extensionsTimeBudget", this.extensionsTimeBudget); + jsonWriter.writeJsonField("scheduledEventsProfile", this.scheduledEventsProfile); + jsonWriter.writeStringField("userData", this.userData); + jsonWriter.writeJsonField("capacityReservation", this.capacityReservation); + jsonWriter.writeJsonField("applicationProfile", this.applicationProfile); + jsonWriter.writeArrayField("vmExtensions", this.vmExtensions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BulkactionVMProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BulkactionVMProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the BulkactionVMProperties. + */ + public static BulkactionVMProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BulkactionVMProperties deserializedBulkactionVMProperties = new BulkactionVMProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scheduledEventsPolicy".equals(fieldName)) { + deserializedBulkactionVMProperties.scheduledEventsPolicy = ScheduledEventsPolicy.fromJson(reader); + } else if ("storageProfile".equals(fieldName)) { + deserializedBulkactionVMProperties.storageProfile = StorageProfile.fromJson(reader); + } else if ("hardwareProfile".equals(fieldName)) { + deserializedBulkactionVMProperties.hardwareProfile = HardwareProfile.fromJson(reader); + } else if ("additionalCapabilities".equals(fieldName)) { + deserializedBulkactionVMProperties.additionalCapabilities = AdditionalCapabilities.fromJson(reader); + } else if ("osProfile".equals(fieldName)) { + deserializedBulkactionVMProperties.osProfile = OSProfile.fromJson(reader); + } else if ("networkProfile".equals(fieldName)) { + deserializedBulkactionVMProperties.networkProfile = NetworkProfile.fromJson(reader); + } else if ("securityProfile".equals(fieldName)) { + deserializedBulkactionVMProperties.securityProfile = SecurityProfile.fromJson(reader); + } else if ("diagnosticsProfile".equals(fieldName)) { + deserializedBulkactionVMProperties.diagnosticsProfile = DiagnosticsProfile.fromJson(reader); + } else if ("licenseType".equals(fieldName)) { + deserializedBulkactionVMProperties.licenseType = reader.getString(); + } else if ("extensionsTimeBudget".equals(fieldName)) { + deserializedBulkactionVMProperties.extensionsTimeBudget = reader.getString(); + } else if ("scheduledEventsProfile".equals(fieldName)) { + deserializedBulkactionVMProperties.scheduledEventsProfile = ScheduledEventsProfile.fromJson(reader); + } else if ("userData".equals(fieldName)) { + deserializedBulkactionVMProperties.userData = reader.getString(); + } else if ("capacityReservation".equals(fieldName)) { + deserializedBulkactionVMProperties.capacityReservation + = CapacityReservationProfile.fromJson(reader); + } else if ("applicationProfile".equals(fieldName)) { + deserializedBulkactionVMProperties.applicationProfile = ApplicationProfile.fromJson(reader); + } else if ("vmExtensions".equals(fieldName)) { + List vmExtensions + = reader.readArray(reader1 -> BulkactionVMExtension.fromJson(reader1)); + deserializedBulkactionVMProperties.vmExtensions = vmExtensions; + } else { + reader.skipChildren(); + } + } + + return deserializedBulkactionVMProperties; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CachingTypes.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CachingTypes.java new file mode 100644 index 000000000000..eafb73fb3260 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CachingTypes.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default values + * are: **None for Standard storage. ReadOnly for Premium storage**. + */ +public final class CachingTypes extends ExpandableStringEnum { + /** + * Caching type:None. + */ + public static final CachingTypes NONE = fromString("None"); + + /** + * Caching type:ReadOnly. + */ + public static final CachingTypes READ_ONLY = fromString("ReadOnly"); + + /** + * Caching type:ReadWrite. + */ + public static final CachingTypes READ_WRITE = fromString("ReadWrite"); + + /** + * Creates a new instance of CachingTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CachingTypes() { + } + + /** + * Creates or finds a CachingTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding CachingTypes. + */ + public static CachingTypes fromString(String name) { + return fromString(name, CachingTypes.class); + } + + /** + * Gets known CachingTypes values. + * + * @return known CachingTypes values. + */ + public static Collection values() { + return values(CachingTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CapacityReservationProfile.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CapacityReservationProfile.java new file mode 100644 index 000000000000..2a96f0d47b39 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CapacityReservationProfile.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The parameters of a capacity reservation Profile. + */ +@Fluent +public final class CapacityReservationProfile implements JsonSerializable { + /* + * Specifies the capacity reservation group resource id that should be used for allocating the virtual machine + * provided enough capacity has been reserved. Please refer to https://aka.ms/CapacityReservation for more details. + */ + 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 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 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("capacityReservationGroup", this.capacityReservationGroup); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapacityReservationProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapacityReservationProfile if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CapacityReservationProfile. + */ + public static CapacityReservationProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapacityReservationProfile deserializedCapacityReservationProfile = new CapacityReservationProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("capacityReservationGroup".equals(fieldName)) { + deserializedCapacityReservationProfile.capacityReservationGroup = SubResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCapacityReservationProfile; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CapacityType.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CapacityType.java new file mode 100644 index 000000000000..81b4d125ea5a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CapacityType.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Capacity types for LaunchBulkInstancesOperation. + */ +public final class CapacityType extends ExpandableStringEnum { + /** + * Default. VM is the default capacity type for LaunchBulkInstancesOperation where capacity is provisioned in terms + * of VMs. + */ + public static final CapacityType VM = fromString("VM"); + + /** + * VCpu is the capacity type for LaunchBulkInstancesOperation where capacity is provisioned in terms of VCpus. If + * VCpu capacity is not exactly divisible by VCpu count in VMSizes, capacity in VCpus will be overprovisioned by + * default. + */ + public static final CapacityType VCPU = fromString("VCpu"); + + /** + * Creates a new instance of CapacityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CapacityType() { + } + + /** + * Creates or finds a CapacityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CapacityType. + */ + public static CapacityType fromString(String name) { + return fromString(name, CapacityType.class); + } + + /** + * Gets known CapacityType values. + * + * @return known CapacityType values. + */ + public static Collection values() { + return values(CapacityType.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ComputeProfile.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ComputeProfile.java new file mode 100644 index 000000000000..24c273687e7b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ComputeProfile.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Compute Profile to configure the Virtual Machines. + */ +@Fluent +public final class ComputeProfile implements JsonSerializable { + /* + * Base Virtual Machine Profile Properties to be specified according to + * specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachine.json + * #/definitions/VirtualMachineProperties + */ + private BulkactionVMProperties virtualMachineProfile; + + /* + * Virtual Machine Extensions Array to be specified according to + * specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachine.json + * #/definitions/VirtualMachineExtension + */ + private List extensions; + + /* + * Specifies the Microsoft.Compute API version to use when creating underlying Virtual Machines. The default value + * will be the latest supported computeApiVersion by LaunchBulkInstancesOperation. + */ + private String computeApiVersion; + + /** + * Creates an instance of ComputeProfile class. + */ + public ComputeProfile() { + } + + /** + * Get the virtualMachineProfile property: Base Virtual Machine Profile Properties to be specified according to + * specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachine.json#/definitions/VirtualMachineProperties. + * + * @return the virtualMachineProfile value. + */ + public BulkactionVMProperties virtualMachineProfile() { + return this.virtualMachineProfile; + } + + /** + * Set the virtualMachineProfile property: Base Virtual Machine Profile Properties to be specified according to + * specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachine.json#/definitions/VirtualMachineProperties. + * + * @param virtualMachineProfile the virtualMachineProfile value to set. + * @return the ComputeProfile object itself. + */ + public ComputeProfile withVirtualMachineProfile(BulkactionVMProperties virtualMachineProfile) { + this.virtualMachineProfile = virtualMachineProfile; + return this; + } + + /** + * Get the extensions property: Virtual Machine Extensions Array to be specified according to + * specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachine.json#/definitions/VirtualMachineExtension. + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions property: Virtual Machine Extensions Array to be specified according to + * specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachine.json#/definitions/VirtualMachineExtension. + * + * @param extensions the extensions value to set. + * @return the ComputeProfile object itself. + */ + public ComputeProfile withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Get the computeApiVersion property: Specifies the Microsoft.Compute API version to use when creating underlying + * Virtual Machines. The default value will be the latest supported computeApiVersion by + * LaunchBulkInstancesOperation. + * + * @return the computeApiVersion value. + */ + public String computeApiVersion() { + return this.computeApiVersion; + } + + /** + * Set the computeApiVersion property: Specifies the Microsoft.Compute API version to use when creating underlying + * Virtual Machines. The default value will be the latest supported computeApiVersion by + * LaunchBulkInstancesOperation. + * + * @param computeApiVersion the computeApiVersion value to set. + * @return the ComputeProfile object itself. + */ + public ComputeProfile withComputeApiVersion(String computeApiVersion) { + this.computeApiVersion = computeApiVersion; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("virtualMachineProfile", this.virtualMachineProfile); + jsonWriter.writeArrayField("extensions", this.extensions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("computeApiVersion", this.computeApiVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ComputeProfile. + */ + public static ComputeProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeProfile deserializedComputeProfile = new ComputeProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualMachineProfile".equals(fieldName)) { + deserializedComputeProfile.virtualMachineProfile = BulkactionVMProperties.fromJson(reader); + } else if ("extensions".equals(fieldName)) { + List extensions + = reader.readArray(reader1 -> BulkactionVMExtension.fromJson(reader1)); + deserializedComputeProfile.extensions = extensions; + } else if ("computeApiVersion".equals(fieldName)) { + deserializedComputeProfile.computeApiVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeProfile; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CpuManufacturer.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CpuManufacturer.java new file mode 100644 index 000000000000..78f838a00ec3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CpuManufacturer.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Cpu Manufacturers supported by Azure VMs. + */ +public final class CpuManufacturer extends ExpandableStringEnum { + /** + * Intel CPU. + */ + public static final CpuManufacturer INTEL = fromString("Intel"); + + /** + * AMD CPU. + */ + public static final CpuManufacturer AMD = fromString("AMD"); + + /** + * Microsoft CPU. + */ + public static final CpuManufacturer MICROSOFT = fromString("Microsoft"); + + /** + * Ampere CPU. + */ + public static final CpuManufacturer AMPERE = fromString("Ampere"); + + /** + * Creates a new instance of CpuManufacturer value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CpuManufacturer() { + } + + /** + * Creates or finds a CpuManufacturer from its string representation. + * + * @param name a name to look for. + * @return the corresponding CpuManufacturer. + */ + public static CpuManufacturer fromString(String name) { + return fromString(name, CpuManufacturer.class); + } + + /** + * Gets known CpuManufacturer values. + * + * @return known CpuManufacturer values. + */ + public static Collection values() { + return values(CpuManufacturer.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CreateResourceOperationResponse.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CreateResourceOperationResponse.java new file mode 100644 index 000000000000..bb6c7c1fb750 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CreateResourceOperationResponse.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.resourcemanager.compute.bulkactions.fluent.models.CreateResourceOperationResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of CreateResourceOperationResponse. + */ +public interface CreateResourceOperationResponse { + /** + * Gets the description property: The description of the operation response. + * + * @return the description value. + */ + String description(); + + /** + * Gets the type property: The type of resources used in the create request eg virtual machines. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The location of the create request eg westus. + * + * @return the location value. + */ + String location(); + + /** + * Gets the results property: The results from the create request if no errors exist. + * + * @return the results value. + */ + List results(); + + /** + * Gets the inner com.azure.resourcemanager.compute.bulkactions.fluent.models.CreateResourceOperationResponseInner + * object. + * + * @return the inner object. + */ + CreateResourceOperationResponseInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DataDisk.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DataDisk.java new file mode 100644 index 000000000000..1b02c32b9509 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DataDisk.java @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a data disk. + */ +@Fluent +public final class DataDisk implements JsonSerializable { + /* + * 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. + */ + private int lun; + + /* + * The disk name. + */ + private String name; + + /* + * The virtual hard disk. + */ + 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. + */ + 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. + */ + private CachingTypes caching; + + /* + * Specifies whether writeAccelerator should be enabled or disabled on the disk. + */ + private Boolean writeAcceleratorEnabled; + + /* + * Specifies how the virtual machine disk should be created. Possible values are Attach, FromImage, Empty, Copy, + * Restore. + */ + 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. + */ + private Integer diskSizeGB; + + /* + * The managed disk parameters. + */ + private ManagedDiskParametersContent managedDisk; + + /* + * The source resource identifier. It can be a snapshot, or disk restore point from which to create a disk. + */ + private ApiEntityReference sourceResource; + + /* + * Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset. + */ + private Boolean toBeDetached; + + /* + * 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. This feature is still in preview. To force-detach a data + * disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. + */ + private DiskDetachOptionTypes detachOption; + + /* + * Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: Delete, Detach. + * The default value is set to Detach. + */ + 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 disk should be created. Possible values are + * Attach, FromImage, Empty, Copy, Restore. + * + * @return the createOption value. + */ + public DiskCreateOptionTypes createOption() { + return this.createOption; + } + + /** + * Set the createOption property: Specifies how the virtual machine disk should be created. Possible values are + * Attach, FromImage, Empty, Copy, Restore. + * + * @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 ManagedDiskParametersContent 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(ManagedDiskParametersContent managedDisk) { + this.managedDisk = managedDisk; + return this; + } + + /** + * Get the sourceResource property: The source resource identifier. It can be a snapshot, or disk restore point from + * which to create a disk. + * + * @return the sourceResource value. + */ + public ApiEntityReference sourceResource() { + return this.sourceResource; + } + + /** + * Set the sourceResource property: The source resource identifier. It can be a snapshot, or disk restore point from + * which to create a disk. + * + * @param sourceResource the sourceResource value to set. + * @return the DataDisk object itself. + */ + public DataDisk withSourceResource(ApiEntityReference sourceResource) { + this.sourceResource = sourceResource; + 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 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. This feature is + * still in preview. 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. This feature is + * still in preview. 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, Detach. 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, Detach. 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("lun", this.lun); + jsonWriter.writeStringField("createOption", this.createOption == null ? null : this.createOption.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("vhd", this.vhd); + jsonWriter.writeJsonField("image", this.image); + jsonWriter.writeStringField("caching", this.caching == null ? null : this.caching.toString()); + jsonWriter.writeBooleanField("writeAcceleratorEnabled", this.writeAcceleratorEnabled); + jsonWriter.writeNumberField("diskSizeGB", this.diskSizeGB); + jsonWriter.writeJsonField("managedDisk", this.managedDisk); + jsonWriter.writeJsonField("sourceResource", this.sourceResource); + jsonWriter.writeBooleanField("toBeDetached", this.toBeDetached); + jsonWriter.writeStringField("detachOption", this.detachOption == null ? null : this.detachOption.toString()); + jsonWriter.writeStringField("deleteOption", this.deleteOption == null ? null : this.deleteOption.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataDisk from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataDisk if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataDisk. + */ + public static DataDisk fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataDisk deserializedDataDisk = new DataDisk(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("lun".equals(fieldName)) { + deserializedDataDisk.lun = reader.getInt(); + } else if ("createOption".equals(fieldName)) { + deserializedDataDisk.createOption = DiskCreateOptionTypes.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedDataDisk.name = reader.getString(); + } else if ("vhd".equals(fieldName)) { + deserializedDataDisk.vhd = VirtualHardDisk.fromJson(reader); + } else if ("image".equals(fieldName)) { + deserializedDataDisk.image = VirtualHardDisk.fromJson(reader); + } else if ("caching".equals(fieldName)) { + deserializedDataDisk.caching = CachingTypes.fromString(reader.getString()); + } else if ("writeAcceleratorEnabled".equals(fieldName)) { + deserializedDataDisk.writeAcceleratorEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("diskSizeGB".equals(fieldName)) { + deserializedDataDisk.diskSizeGB = reader.getNullable(JsonReader::getInt); + } else if ("managedDisk".equals(fieldName)) { + deserializedDataDisk.managedDisk = ManagedDiskParametersContent.fromJson(reader); + } else if ("sourceResource".equals(fieldName)) { + deserializedDataDisk.sourceResource = ApiEntityReference.fromJson(reader); + } else if ("toBeDetached".equals(fieldName)) { + deserializedDataDisk.toBeDetached = reader.getNullable(JsonReader::getBoolean); + } else if ("detachOption".equals(fieldName)) { + deserializedDataDisk.detachOption = DiskDetachOptionTypes.fromString(reader.getString()); + } else if ("deleteOption".equals(fieldName)) { + deserializedDataDisk.deleteOption = DiskDeleteOptionTypes.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDataDisk; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DeleteOptions.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DeleteOptions.java new file mode 100644 index 000000000000..ca934d35ec80 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DeleteOptions.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specify what happens to the network interface when the VM is deleted. + */ +public final class DeleteOptions extends ExpandableStringEnum { + /** + * Delete network interface when the VM is deleted. + */ + public static final DeleteOptions DELETE = fromString("Delete"); + + /** + * Detach network interface when the VM is deleted. + */ + 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiagnosticsProfile.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiagnosticsProfile.java new file mode 100644 index 000000000000..0f1de3e1da4a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiagnosticsProfile.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies the boot diagnostic settings state. Minimum compute api-version: 2015-06-15. + */ +@Fluent +public final class DiagnosticsProfile implements JsonSerializable { + /* + * 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. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("bootDiagnostics", this.bootDiagnostics); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnosticsProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnosticsProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DiagnosticsProfile. + */ + public static DiagnosticsProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnosticsProfile deserializedDiagnosticsProfile = new DiagnosticsProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bootDiagnostics".equals(fieldName)) { + deserializedDiagnosticsProfile.bootDiagnostics = BootDiagnostics.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnosticsProfile; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiffDiskOptions.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiffDiskOptions.java new file mode 100644 index 000000000000..3058dbc930b1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiffDiskOptions.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the ephemeral disk option for operating system disk. + */ +public final class DiffDiskOptions extends ExpandableStringEnum { + /** + * Local Ephemeral disk option: Local. + */ + 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiffDiskPlacement.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiffDiskPlacement.java new file mode 100644 index 000000000000..515746f55653 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiffDiskPlacement.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +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, resource disk or nvme 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. Minimum api-version for + * NvmeDisk: 2024-03-01. + */ +public final class DiffDiskPlacement extends ExpandableStringEnum { + /** + * CacheDisk disk placement. + */ + public static final DiffDiskPlacement CACHE_DISK = fromString("CacheDisk"); + + /** + * ResourceDisk disk placement. + */ + public static final DiffDiskPlacement RESOURCE_DISK = fromString("ResourceDisk"); + + /** + * NvmeDisk disk placement. + */ + public static final DiffDiskPlacement NVME_DISK = fromString("NvmeDisk"); + + /** + * 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiffDiskSettings.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiffDiskSettings.java new file mode 100644 index 000000000000..ca10b47187b6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiffDiskSettings.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * 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 implements JsonSerializable { + /* + * Specifies the ephemeral disk settings for operating system disk. + */ + private DiffDiskOptions option; + + /* + * Specifies the ephemeral disk placement for operating system disk. Possible values are: CacheDisk, ResourceDisk, + * NvmeDisk. The defaulting behavior is: CacheDisk if one is configured for the VM size otherwise ResourceDisk or + * NvmeDisk is used. Minimum api-version for NvmeDisk: 2024-03-01. + */ + 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, NvmeDisk. The defaulting behavior is: CacheDisk if one is configured for the VM + * size otherwise ResourceDisk or NvmeDisk is used. Minimum api-version for NvmeDisk: 2024-03-01. + * + * @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, NvmeDisk. The defaulting behavior is: CacheDisk if one is configured for the VM + * size otherwise ResourceDisk or NvmeDisk is used. Minimum api-version for NvmeDisk: 2024-03-01. + * + * @param placement the placement value to set. + * @return the DiffDiskSettings object itself. + */ + public DiffDiskSettings withPlacement(DiffDiskPlacement placement) { + this.placement = placement; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("option", this.option == null ? null : this.option.toString()); + jsonWriter.writeStringField("placement", this.placement == null ? null : this.placement.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiffDiskSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiffDiskSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DiffDiskSettings. + */ + public static DiffDiskSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiffDiskSettings deserializedDiffDiskSettings = new DiffDiskSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("option".equals(fieldName)) { + deserializedDiffDiskSettings.option = DiffDiskOptions.fromString(reader.getString()); + } else if ("placement".equals(fieldName)) { + deserializedDiffDiskSettings.placement = DiffDiskPlacement.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDiffDiskSettings; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskControllerTypes.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskControllerTypes.java new file mode 100644 index 000000000000..c1dad56e3a83 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskControllerTypes.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +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 { + /** + * SCSI disk controller type. + */ + public static final DiskControllerTypes SCSI = fromString("SCSI"); + + /** + * NVMe disk controller type. + */ + 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskCreateOptionTypes.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskCreateOptionTypes.java new file mode 100644 index 000000000000..f06d8466b5ae --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskCreateOptionTypes.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies how the virtual machine disk 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. **Empty:** This value is used when creating an empty data disk. **Copy:** This value is used to create a + * data disk from a snapshot or another disk. **Restore:** This value is used to create a data disk from a disk restore + * point. + */ +public final class DiskCreateOptionTypes extends ExpandableStringEnum { + /** + * Create disk FromImage. + */ + public static final DiskCreateOptionTypes FROM_IMAGE = fromString("FromImage"); + + /** + * Empty value. + */ + public static final DiskCreateOptionTypes EMPTY = fromString("Empty"); + + /** + * Create disk by Attach. + */ + public static final DiskCreateOptionTypes ATTACH = fromString("Attach"); + + /** + * Create disk by Copy. + */ + public static final DiskCreateOptionTypes COPY = fromString("Copy"); + + /** + * Create disk by Restore. + */ + public static final DiskCreateOptionTypes RESTORE = fromString("Restore"); + + /** + * 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskDeleteOptionTypes.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskDeleteOptionTypes.java new file mode 100644 index 000000000000..18b05b825538 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskDeleteOptionTypes.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +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 { + /** + * Delete the disk upon VM deletion. + */ + public static final DiskDeleteOptionTypes DELETE = fromString("Delete"); + + /** + * Detach the disk upon VM deletion. + */ + 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskDetachOptionTypes.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskDetachOptionTypes.java new file mode 100644 index 000000000000..244e54b34b22 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskDetachOptionTypes.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +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**. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: + * 'ForceDetach'. + */ +public final class DiskDetachOptionTypes extends ExpandableStringEnum { + /** + * ForceDetach the disk. + */ + 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskEncryptionSetParametersContent.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskEncryptionSetParametersContent.java new file mode 100644 index 000000000000..eb6990e96afc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskEncryptionSetParametersContent.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * 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 DiskEncryptionSetParametersContent extends SubResource { + /** + * Creates an instance of DiskEncryptionSetParametersContent class. + */ + public DiskEncryptionSetParametersContent() { + } + + /** + * {@inheritDoc} + */ + @Override + public DiskEncryptionSetParametersContent withId(String id) { + super.withId(id); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiskEncryptionSetParametersContent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiskEncryptionSetParametersContent if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiskEncryptionSetParametersContent. + */ + public static DiskEncryptionSetParametersContent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiskEncryptionSetParametersContent deserializedDiskEncryptionSetParametersContent + = new DiskEncryptionSetParametersContent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDiskEncryptionSetParametersContent.withId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDiskEncryptionSetParametersContent; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskEncryptionSettings.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskEncryptionSettings.java new file mode 100644 index 000000000000..b5598c03625f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskEncryptionSettings.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a Encryption Settings for a Disk. + */ +@Fluent +public final class DiskEncryptionSettings implements JsonSerializable { + /* + * Specifies the location of the disk encryption key, which is a Key Vault Secret. + */ + private KeyVaultSecretReference diskEncryptionKey; + + /* + * Specifies the location of the key encryption key in Key Vault. + */ + private KeyVaultKeyReference keyEncryptionKey; + + /* + * Specifies whether disk encryption should be enabled on the virtual machine. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("diskEncryptionKey", this.diskEncryptionKey); + jsonWriter.writeJsonField("keyEncryptionKey", this.keyEncryptionKey); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiskEncryptionSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiskEncryptionSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiskEncryptionSettings. + */ + public static DiskEncryptionSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiskEncryptionSettings deserializedDiskEncryptionSettings = new DiskEncryptionSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("diskEncryptionKey".equals(fieldName)) { + deserializedDiskEncryptionSettings.diskEncryptionKey = KeyVaultSecretReference.fromJson(reader); + } else if ("keyEncryptionKey".equals(fieldName)) { + deserializedDiskEncryptionSettings.keyEncryptionKey = KeyVaultKeyReference.fromJson(reader); + } else if ("enabled".equals(fieldName)) { + deserializedDiskEncryptionSettings.enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedDiskEncryptionSettings; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DistributionStrategy.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DistributionStrategy.java new file mode 100644 index 000000000000..f72bb3d20f05 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DistributionStrategy.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The distribution strategy for zone allocation. + */ +public final class DistributionStrategy extends ExpandableStringEnum { + /** + * Platform attempts to place as many VMs as possible in a single zone, falls back to multiple zones if needed. + */ + public static final DistributionStrategy BEST_EFFORT_SINGLE_ZONE = fromString("BestEffortSingleZone"); + + /** + * Platform uses customer-provided zone rankings to allocate VMs. + */ + public static final DistributionStrategy PRIORITIZED = fromString("Prioritized"); + + /** + * Platform attempts to evenly distribute VMs across all available zones with best effort. + */ + public static final DistributionStrategy BEST_EFFORT_BALANCED = fromString("BestEffortBalanced"); + + /** + * Platform must evenly distribute VMs across zones, request is rejected if exact balance cannot be achieved. + */ + public static final DistributionStrategy STRICT_BALANCED = fromString("StrictBalanced"); + + /** + * Creates a new instance of DistributionStrategy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DistributionStrategy() { + } + + /** + * Creates or finds a DistributionStrategy from its string representation. + * + * @param name a name to look for. + * @return the corresponding DistributionStrategy. + */ + public static DistributionStrategy fromString(String name) { + return fromString(name, DistributionStrategy.class); + } + + /** + * Gets known DistributionStrategy values. + * + * @return known DistributionStrategy values. + */ + public static Collection values() { + return values(DistributionStrategy.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DomainNameLabelScopeTypes.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DomainNameLabelScopeTypes.java new file mode 100644 index 000000000000..e235ee9eaa7e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DomainNameLabelScopeTypes.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The Domain name label scope.The concatenation of the hashed domain name label that generated according to the policy + * from domain name label scope and vm index will be the domain name labels of the PublicIPAddress resources that will + * be created. + */ +public final class DomainNameLabelScopeTypes extends ExpandableStringEnum { + /** + * TenantReuse scope type. + */ + public static final DomainNameLabelScopeTypes TENANT_REUSE = fromString("TenantReuse"); + + /** + * SubscriptionReuse scope type. + */ + public static final DomainNameLabelScopeTypes SUBSCRIPTION_REUSE = fromString("SubscriptionReuse"); + + /** + * ResourceGroupReuse scope type. + */ + public static final DomainNameLabelScopeTypes RESOURCE_GROUP_REUSE = fromString("ResourceGroupReuse"); + + /** + * NoReuse scope type. + */ + public static final DomainNameLabelScopeTypes NO_REUSE = fromString("NoReuse"); + + /** + * Creates a new instance of DomainNameLabelScopeTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DomainNameLabelScopeTypes() { + } + + /** + * Creates or finds a DomainNameLabelScopeTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding DomainNameLabelScopeTypes. + */ + public static DomainNameLabelScopeTypes fromString(String name) { + return fromString(name, DomainNameLabelScopeTypes.class); + } + + /** + * Gets known DomainNameLabelScopeTypes values. + * + * @return known DomainNameLabelScopeTypes values. + */ + public static Collection values() { + return values(DomainNameLabelScopeTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/EncryptionIdentity.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/EncryptionIdentity.java new file mode 100644 index 000000000000..c9c5588d1ec5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/EncryptionIdentity.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies the Managed Identity used by ADE to get access token for keyvault operations. + */ +@Fluent +public final class EncryptionIdentity implements JsonSerializable { + /* + * Specifies ARM Resource ID of one of the user identities associated with the VM. + */ + private String userAssignedIdentityResourceId; + + /** + * Creates an instance of EncryptionIdentity class. + */ + public EncryptionIdentity() { + } + + /** + * Get the userAssignedIdentityResourceId property: Specifies ARM Resource ID of one of the user identities + * associated with the VM. + * + * @return the userAssignedIdentityResourceId value. + */ + public String userAssignedIdentityResourceId() { + return this.userAssignedIdentityResourceId; + } + + /** + * Set the userAssignedIdentityResourceId property: Specifies ARM Resource ID of one of the user identities + * associated with the VM. + * + * @param userAssignedIdentityResourceId the userAssignedIdentityResourceId value to set. + * @return the EncryptionIdentity object itself. + */ + public EncryptionIdentity withUserAssignedIdentityResourceId(String userAssignedIdentityResourceId) { + this.userAssignedIdentityResourceId = userAssignedIdentityResourceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userAssignedIdentityResourceId", this.userAssignedIdentityResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionIdentity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EncryptionIdentity. + */ + public static EncryptionIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionIdentity deserializedEncryptionIdentity = new EncryptionIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userAssignedIdentityResourceId".equals(fieldName)) { + deserializedEncryptionIdentity.userAssignedIdentityResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionIdentity; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/EventGridAndResourceGraph.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/EventGridAndResourceGraph.java new file mode 100644 index 000000000000..4aa5123558c8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/EventGridAndResourceGraph.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies eventGridAndResourceGraph related Scheduled Event related configurations. + */ +@Fluent +public final class EventGridAndResourceGraph implements JsonSerializable { + /* + * Specifies if event grid and resource graph is enabled for Scheduled event related configurations. + */ + private Boolean enable; + + /* + * Specifies the api-version to determine which Scheduled Events configuration schema version will be delivered. + */ + private String scheduledEventsApiVersion; + + /** + * Creates an instance of EventGridAndResourceGraph class. + */ + public EventGridAndResourceGraph() { + } + + /** + * Get the enable property: Specifies if event grid and resource graph is enabled for Scheduled event related + * configurations. + * + * @return the enable value. + */ + public Boolean enable() { + return this.enable; + } + + /** + * Set the enable property: Specifies if event grid and resource graph is enabled for Scheduled event related + * configurations. + * + * @param enable the enable value to set. + * @return the EventGridAndResourceGraph object itself. + */ + public EventGridAndResourceGraph withEnable(Boolean enable) { + this.enable = enable; + return this; + } + + /** + * Get the scheduledEventsApiVersion property: Specifies the api-version to determine which Scheduled Events + * configuration schema version will be delivered. + * + * @return the scheduledEventsApiVersion value. + */ + public String scheduledEventsApiVersion() { + return this.scheduledEventsApiVersion; + } + + /** + * Set the scheduledEventsApiVersion property: Specifies the api-version to determine which Scheduled Events + * configuration schema version will be delivered. + * + * @param scheduledEventsApiVersion the scheduledEventsApiVersion value to set. + * @return the EventGridAndResourceGraph object itself. + */ + public EventGridAndResourceGraph withScheduledEventsApiVersion(String scheduledEventsApiVersion) { + this.scheduledEventsApiVersion = scheduledEventsApiVersion; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enable", this.enable); + jsonWriter.writeStringField("scheduledEventsApiVersion", this.scheduledEventsApiVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EventGridAndResourceGraph from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EventGridAndResourceGraph if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EventGridAndResourceGraph. + */ + public static EventGridAndResourceGraph fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EventGridAndResourceGraph deserializedEventGridAndResourceGraph = new EventGridAndResourceGraph(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enable".equals(fieldName)) { + deserializedEventGridAndResourceGraph.enable = reader.getNullable(JsonReader::getBoolean); + } else if ("scheduledEventsApiVersion".equals(fieldName)) { + deserializedEventGridAndResourceGraph.scheduledEventsApiVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEventGridAndResourceGraph; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/EvictionPolicy.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/EvictionPolicy.java new file mode 100644 index 000000000000..98896786d867 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/EvictionPolicy.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Different kind of eviction policies. + */ +public final class EvictionPolicy extends ExpandableStringEnum { + /** + * When evicted, the Spot VM will be deleted and the corresponding capacity will be updated to reflect this. + */ + public static final EvictionPolicy DELETE = fromString("Delete"); + + /** + * When evicted, the Spot VM will be deallocated/stopped. + */ + public static final EvictionPolicy DEALLOCATE = fromString("Deallocate"); + + /** + * Creates a new instance of EvictionPolicy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EvictionPolicy() { + } + + /** + * Creates or finds a EvictionPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding EvictionPolicy. + */ + public static EvictionPolicy fromString(String name) { + return fromString(name, EvictionPolicy.class); + } + + /** + * Gets known EvictionPolicy values. + * + * @return known EvictionPolicy values. + */ + public static Collection values() { + return values(EvictionPolicy.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteCreateContent.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteCreateContent.java new file mode 100644 index 000000000000..40ec7f0d7455 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteCreateContent.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ExecuteCreateRequest request for create operations. + */ +@Fluent +public final class ExecuteCreateContent implements JsonSerializable { + /* + * resource creation payload + */ + private ResourceProvisionPayload resourceConfigParameters; + + /* + * The execution parameters for the request + */ + private ExecutionParameters executionParameters; + + /** + * Creates an instance of ExecuteCreateContent class. + */ + public ExecuteCreateContent() { + } + + /** + * Get the resourceConfigParameters property: resource creation payload. + * + * @return the resourceConfigParameters value. + */ + public ResourceProvisionPayload resourceConfigParameters() { + return this.resourceConfigParameters; + } + + /** + * Set the resourceConfigParameters property: resource creation payload. + * + * @param resourceConfigParameters the resourceConfigParameters value to set. + * @return the ExecuteCreateContent object itself. + */ + public ExecuteCreateContent withResourceConfigParameters(ResourceProvisionPayload resourceConfigParameters) { + this.resourceConfigParameters = resourceConfigParameters; + return this; + } + + /** + * Get the executionParameters property: The execution parameters for the request. + * + * @return the executionParameters value. + */ + public ExecutionParameters executionParameters() { + return this.executionParameters; + } + + /** + * Set the executionParameters property: The execution parameters for the request. + * + * @param executionParameters the executionParameters value to set. + * @return the ExecuteCreateContent object itself. + */ + public ExecuteCreateContent withExecutionParameters(ExecutionParameters executionParameters) { + this.executionParameters = executionParameters; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("resourceConfigParameters", this.resourceConfigParameters); + jsonWriter.writeJsonField("executionParameters", this.executionParameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecuteCreateContent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecuteCreateContent if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExecuteCreateContent. + */ + public static ExecuteCreateContent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecuteCreateContent deserializedExecuteCreateContent = new ExecuteCreateContent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceConfigParameters".equals(fieldName)) { + deserializedExecuteCreateContent.resourceConfigParameters + = ResourceProvisionPayload.fromJson(reader); + } else if ("executionParameters".equals(fieldName)) { + deserializedExecuteCreateContent.executionParameters = ExecutionParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExecuteCreateContent; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteDeallocateContent.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteDeallocateContent.java index af527ead26fd..c022d3b76ff3 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteDeallocateContent.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteDeallocateContent.java @@ -26,6 +26,12 @@ public final class ExecuteDeallocateContent implements JsonSerializable { + /* + * The execution parameters for the request + */ + private ExecutionParameters executionParameters; + + /* + * The resources for the request + */ + private Resources resources; + + /* + * The resources for the request with resource context information. Cannot be provided together with `resources` - + * exactly one must be specified. + */ + private ResourcesWithContext resourcesWithContext; + + /* + * Reimage parameters including base profile and per-resource overrides + */ + private ReimagePayload reimageParameters; + + /** + * Creates an instance of ExecuteReimageRequest class. + */ + public ExecuteReimageRequest() { + } + + /** + * Get the executionParameters property: The execution parameters for the request. + * + * @return the executionParameters value. + */ + public ExecutionParameters executionParameters() { + return this.executionParameters; + } + + /** + * Set the executionParameters property: The execution parameters for the request. + * + * @param executionParameters the executionParameters value to set. + * @return the ExecuteReimageRequest object itself. + */ + public ExecuteReimageRequest withExecutionParameters(ExecutionParameters executionParameters) { + this.executionParameters = executionParameters; + return this; + } + + /** + * Get the resources property: The resources for the request. + * + * @return the resources value. + */ + public Resources resources() { + return this.resources; + } + + /** + * Set the resources property: The resources for the request. + * + * @param resources the resources value to set. + * @return the ExecuteReimageRequest object itself. + */ + public ExecuteReimageRequest withResources(Resources resources) { + this.resources = resources; + return this; + } + + /** + * Get the resourcesWithContext property: The resources for the request with resource context information. Cannot be + * provided together with `resources` - exactly one must be specified. + * + * @return the resourcesWithContext value. + */ + public ResourcesWithContext resourcesWithContext() { + return this.resourcesWithContext; + } + + /** + * Set the resourcesWithContext property: The resources for the request with resource context information. Cannot be + * provided together with `resources` - exactly one must be specified. + * + * @param resourcesWithContext the resourcesWithContext value to set. + * @return the ExecuteReimageRequest object itself. + */ + public ExecuteReimageRequest withResourcesWithContext(ResourcesWithContext resourcesWithContext) { + this.resourcesWithContext = resourcesWithContext; + return this; + } + + /** + * Get the reimageParameters property: Reimage parameters including base profile and per-resource overrides. + * + * @return the reimageParameters value. + */ + public ReimagePayload reimageParameters() { + return this.reimageParameters; + } + + /** + * Set the reimageParameters property: Reimage parameters including base profile and per-resource overrides. + * + * @param reimageParameters the reimageParameters value to set. + * @return the ExecuteReimageRequest object itself. + */ + public ExecuteReimageRequest withReimageParameters(ReimagePayload reimageParameters) { + this.reimageParameters = reimageParameters; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("executionParameters", this.executionParameters); + jsonWriter.writeJsonField("resources", this.resources); + jsonWriter.writeJsonField("resourcesWithContext", this.resourcesWithContext); + jsonWriter.writeJsonField("reimageParameters", this.reimageParameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecuteReimageRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecuteReimageRequest if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExecuteReimageRequest. + */ + public static ExecuteReimageRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecuteReimageRequest deserializedExecuteReimageRequest = new ExecuteReimageRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("executionParameters".equals(fieldName)) { + deserializedExecuteReimageRequest.executionParameters = ExecutionParameters.fromJson(reader); + } else if ("resources".equals(fieldName)) { + deserializedExecuteReimageRequest.resources = Resources.fromJson(reader); + } else if ("resourcesWithContext".equals(fieldName)) { + deserializedExecuteReimageRequest.resourcesWithContext = ResourcesWithContext.fromJson(reader); + } else if ("reimageParameters".equals(fieldName)) { + deserializedExecuteReimageRequest.reimageParameters = ReimagePayload.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExecuteReimageRequest; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteStartContent.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteStartContent.java index a3a7c0457562..298e1bc6f560 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteStartContent.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteStartContent.java @@ -26,6 +26,12 @@ public final class ExecuteStartContent implements JsonSerializable { + /* + * resource creation payload + */ + private ResourceProvisionVdiPayload resourceConfigParameters; + + /* + * The execution parameters for the request + */ + private ExecutionParameters executionParameters; + + /** + * Creates an instance of ExecuteVdiCreateRequest class. + */ + public ExecuteVdiCreateRequest() { + } + + /** + * Get the resourceConfigParameters property: resource creation payload. + * + * @return the resourceConfigParameters value. + */ + public ResourceProvisionVdiPayload resourceConfigParameters() { + return this.resourceConfigParameters; + } + + /** + * Set the resourceConfigParameters property: resource creation payload. + * + * @param resourceConfigParameters the resourceConfigParameters value to set. + * @return the ExecuteVdiCreateRequest object itself. + */ + public ExecuteVdiCreateRequest withResourceConfigParameters(ResourceProvisionVdiPayload resourceConfigParameters) { + this.resourceConfigParameters = resourceConfigParameters; + return this; + } + + /** + * Get the executionParameters property: The execution parameters for the request. + * + * @return the executionParameters value. + */ + public ExecutionParameters executionParameters() { + return this.executionParameters; + } + + /** + * Set the executionParameters property: The execution parameters for the request. + * + * @param executionParameters the executionParameters value to set. + * @return the ExecuteVdiCreateRequest object itself. + */ + public ExecuteVdiCreateRequest withExecutionParameters(ExecutionParameters executionParameters) { + this.executionParameters = executionParameters; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("resourceConfigParameters", this.resourceConfigParameters); + jsonWriter.writeJsonField("executionParameters", this.executionParameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecuteVdiCreateRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecuteVdiCreateRequest if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExecuteVdiCreateRequest. + */ + public static ExecuteVdiCreateRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecuteVdiCreateRequest deserializedExecuteVdiCreateRequest = new ExecuteVdiCreateRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceConfigParameters".equals(fieldName)) { + deserializedExecuteVdiCreateRequest.resourceConfigParameters + = ResourceProvisionVdiPayload.fromJson(reader); + } else if ("executionParameters".equals(fieldName)) { + deserializedExecuteVdiCreateRequest.executionParameters = ExecutionParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExecuteVdiCreateRequest; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecutionParameters.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecutionParameters.java index 6934839fb15c..a1045a76cb1b 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecutionParameters.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecutionParameters.java @@ -21,6 +21,12 @@ public final class ExecutionParameters implements JsonSerializable { + /* + * The list of VM size profiles to use for flex creation + */ + private List vmSizeProfiles; + + /* + * The operating system type for the VMs + */ + private OsType osType; + + /* + * The priority profile for VM allocation + */ + private PriorityProfile priorityProfile; + + /* + * The zone allocation policy for distributing VMs across availability zones + */ + private ZoneAllocationPolicy zoneAllocationPolicy; + + /* + * The minimum number of VMs that must be successfully created for the request to proceed. If fewer than this number + * can be allocated, the entire request is automatically rejected. + */ + private Integer minCapacity; + + /** + * Creates an instance of FlexProperties class. + */ + public FlexProperties() { + } + + /** + * Get the vmSizeProfiles property: The list of VM size profiles to use for flex creation. + * + * @return the vmSizeProfiles value. + */ + public List vmSizeProfiles() { + return this.vmSizeProfiles; + } + + /** + * Set the vmSizeProfiles property: The list of VM size profiles to use for flex creation. + * + * @param vmSizeProfiles the vmSizeProfiles value to set. + * @return the FlexProperties object itself. + */ + public FlexProperties withVmSizeProfiles(List vmSizeProfiles) { + this.vmSizeProfiles = vmSizeProfiles; + return this; + } + + /** + * Get the osType property: The operating system type for the VMs. + * + * @return the osType value. + */ + public OsType osType() { + return this.osType; + } + + /** + * Set the osType property: The operating system type for the VMs. + * + * @param osType the osType value to set. + * @return the FlexProperties object itself. + */ + public FlexProperties withOsType(OsType osType) { + this.osType = osType; + return this; + } + + /** + * Get the priorityProfile property: The priority profile for VM allocation. + * + * @return the priorityProfile value. + */ + public PriorityProfile priorityProfile() { + return this.priorityProfile; + } + + /** + * Set the priorityProfile property: The priority profile for VM allocation. + * + * @param priorityProfile the priorityProfile value to set. + * @return the FlexProperties object itself. + */ + public FlexProperties withPriorityProfile(PriorityProfile priorityProfile) { + this.priorityProfile = priorityProfile; + return this; + } + + /** + * Get the zoneAllocationPolicy property: The zone allocation policy for distributing VMs across availability zones. + * + * @return the zoneAllocationPolicy value. + */ + public ZoneAllocationPolicy zoneAllocationPolicy() { + return this.zoneAllocationPolicy; + } + + /** + * Set the zoneAllocationPolicy property: The zone allocation policy for distributing VMs across availability zones. + * + * @param zoneAllocationPolicy the zoneAllocationPolicy value to set. + * @return the FlexProperties object itself. + */ + public FlexProperties withZoneAllocationPolicy(ZoneAllocationPolicy zoneAllocationPolicy) { + this.zoneAllocationPolicy = zoneAllocationPolicy; + return this; + } + + /** + * Get the minCapacity property: The minimum number of VMs that must be successfully created for the request to + * proceed. If fewer than this number can be allocated, the entire request is automatically rejected. + * + * @return the minCapacity value. + */ + public Integer minCapacity() { + return this.minCapacity; + } + + /** + * Set the minCapacity property: The minimum number of VMs that must be successfully created for the request to + * proceed. If fewer than this number can be allocated, the entire request is automatically rejected. + * + * @param minCapacity the minCapacity value to set. + * @return the FlexProperties object itself. + */ + public FlexProperties withMinCapacity(Integer minCapacity) { + this.minCapacity = minCapacity; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("vmSizeProfiles", this.vmSizeProfiles, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("osType", this.osType == null ? null : this.osType.toString()); + jsonWriter.writeJsonField("priorityProfile", this.priorityProfile); + jsonWriter.writeJsonField("zoneAllocationPolicy", this.zoneAllocationPolicy); + jsonWriter.writeNumberField("minCapacity", this.minCapacity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlexProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlexProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FlexProperties. + */ + public static FlexProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlexProperties deserializedFlexProperties = new FlexProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmSizeProfiles".equals(fieldName)) { + List vmSizeProfiles = reader.readArray(reader1 -> VmSizeProfile.fromJson(reader1)); + deserializedFlexProperties.vmSizeProfiles = vmSizeProfiles; + } else if ("osType".equals(fieldName)) { + deserializedFlexProperties.osType = OsType.fromString(reader.getString()); + } else if ("priorityProfile".equals(fieldName)) { + deserializedFlexProperties.priorityProfile = PriorityProfile.fromJson(reader); + } else if ("zoneAllocationPolicy".equals(fieldName)) { + deserializedFlexProperties.zoneAllocationPolicy = ZoneAllocationPolicy.fromJson(reader); + } else if ("minCapacity".equals(fieldName)) { + deserializedFlexProperties.minCapacity = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedFlexProperties; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/HardwareProfile.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/HardwareProfile.java new file mode 100644 index 000000000000..6d4f400fc31a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/HardwareProfile.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies the hardware profile for the virtual machine. + */ +@Fluent +public final class HardwareProfile implements JsonSerializable { + /* + * 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. + */ + private String 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. + */ + 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 String 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(String 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vmSize", this.vmSize); + jsonWriter.writeJsonField("vmSizeProperties", this.vmSizeProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HardwareProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HardwareProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HardwareProfile. + */ + public static HardwareProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HardwareProfile deserializedHardwareProfile = new HardwareProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmSize".equals(fieldName)) { + deserializedHardwareProfile.vmSize = reader.getString(); + } else if ("vmSizeProperties".equals(fieldName)) { + deserializedHardwareProfile.vmSizeProperties = VmSizeProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHardwareProfile; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/HostEndpointSettings.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/HostEndpointSettings.java new file mode 100644 index 000000000000..224c2018865b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/HostEndpointSettings.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies particular host endpoint settings. + */ +@Fluent +public final class HostEndpointSettings implements JsonSerializable { + /* + * Specifies the execution mode. In Audit mode, the system acts as if it is enforcing the access control policy, + * including emitting access denial entries in the logs but it does not actually deny any requests to host + * endpoints. In Enforce mode, the system will enforce the access control and it is the recommended mode of + * operation. + */ + private Modes mode; + + /* + * Specifies the InVMAccessControlProfileVersion resource id in the format of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{ + * galleryName}/inVMAccessControlProfiles/{profile}/versions/{version} + */ + private String inVMAccessControlProfileReferenceId; + + /** + * Creates an instance of HostEndpointSettings class. + */ + public HostEndpointSettings() { + } + + /** + * Get the mode property: Specifies the execution mode. In Audit mode, the system acts as if it is enforcing the + * access control policy, including emitting access denial entries in the logs but it does not actually deny any + * requests to host endpoints. In Enforce mode, the system will enforce the access control and it is the recommended + * mode of operation. + * + * @return the mode value. + */ + public Modes mode() { + return this.mode; + } + + /** + * Set the mode property: Specifies the execution mode. In Audit mode, the system acts as if it is enforcing the + * access control policy, including emitting access denial entries in the logs but it does not actually deny any + * requests to host endpoints. In Enforce mode, the system will enforce the access control and it is the recommended + * mode of operation. + * + * @param mode the mode value to set. + * @return the HostEndpointSettings object itself. + */ + public HostEndpointSettings withMode(Modes mode) { + this.mode = mode; + return this; + } + + /** + * Get the inVMAccessControlProfileReferenceId property: Specifies the InVMAccessControlProfileVersion resource id + * in the format of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{profile}/versions/{version}. + * + * @return the inVMAccessControlProfileReferenceId value. + */ + public String inVMAccessControlProfileReferenceId() { + return this.inVMAccessControlProfileReferenceId; + } + + /** + * Set the inVMAccessControlProfileReferenceId property: Specifies the InVMAccessControlProfileVersion resource id + * in the format of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{profile}/versions/{version}. + * + * @param inVMAccessControlProfileReferenceId the inVMAccessControlProfileReferenceId value to set. + * @return the HostEndpointSettings object itself. + */ + public HostEndpointSettings withInVMAccessControlProfileReferenceId(String inVMAccessControlProfileReferenceId) { + this.inVMAccessControlProfileReferenceId = inVMAccessControlProfileReferenceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeStringField("inVMAccessControlProfileReferenceId", this.inVMAccessControlProfileReferenceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostEndpointSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostEndpointSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the HostEndpointSettings. + */ + public static HostEndpointSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostEndpointSettings deserializedHostEndpointSettings = new HostEndpointSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedHostEndpointSettings.mode = Modes.fromString(reader.getString()); + } else if ("inVMAccessControlProfileReferenceId".equals(fieldName)) { + deserializedHostEndpointSettings.inVMAccessControlProfileReferenceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHostEndpointSettings; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/HyperVGeneration.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/HyperVGeneration.java new file mode 100644 index 000000000000..3a99fd170594 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/HyperVGeneration.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * HyperVGenerations supported by Azure VMs. + */ +public final class HyperVGeneration extends ExpandableStringEnum { + /** + * Gen1 hyperV. + */ + public static final HyperVGeneration GEN1 = fromString("Gen1"); + + /** + * Gen2 hyperV. + */ + public static final HyperVGeneration GEN2 = fromString("Gen2"); + + /** + * 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/IPVersions.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/IPVersions.java new file mode 100644 index 000000000000..e24ac4adbf95 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/IPVersions.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Available from compute 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 IPVersions extends ExpandableStringEnum { + /** + * IPv4 version. + */ + public static final IPVersions IPV4 = fromString("IPv4"); + + /** + * IPv6 version. + */ + 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ImageReference.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ImageReference.java new file mode 100644 index 000000000000..218aba93ac25 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ImageReference.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * 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. + */ + private String publisher; + + /* + * Specifies the offer of the platform image or marketplace image used to create the virtual machine. + */ + private String offer; + + /* + * The image 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. + */ + private String version; + + /* + * Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image GET + * call. + */ + private String sharedGalleryImageId; + + /* + * Specified the community gallery image unique id for vm deployment. This can be fetched from community gallery + * image GET call. + */ + 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 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("publisher", this.publisher); + jsonWriter.writeStringField("offer", this.offer); + jsonWriter.writeStringField("sku", this.sku); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeStringField("sharedGalleryImageId", this.sharedGalleryImageId); + jsonWriter.writeStringField("communityGalleryImageId", this.communityGalleryImageId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageReference if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageReference. + */ + public static ImageReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageReference deserializedImageReference = new ImageReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedImageReference.withId(reader.getString()); + } else if ("publisher".equals(fieldName)) { + deserializedImageReference.publisher = reader.getString(); + } else if ("offer".equals(fieldName)) { + deserializedImageReference.offer = reader.getString(); + } else if ("sku".equals(fieldName)) { + deserializedImageReference.sku = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedImageReference.version = reader.getString(); + } else if ("sharedGalleryImageId".equals(fieldName)) { + deserializedImageReference.sharedGalleryImageId = reader.getString(); + } else if ("communityGalleryImageId".equals(fieldName)) { + deserializedImageReference.communityGalleryImageId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedImageReference; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/InnerError.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/InnerError.java new file mode 100644 index 000000000000..c6fa03a49d48 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/InnerError.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Inner error details. + */ +@Immutable +public final class InnerError implements JsonSerializable { + /* + * The exception type. + */ + private String exceptionType; + + /* + * The internal error message or exception dump. + */ + private String errorDetail; + + /** + * Creates an instance of InnerError class. + */ + private InnerError() { + } + + /** + * Get the exceptionType property: The exception type. + * + * @return the exceptionType value. + */ + public String exceptionType() { + return this.exceptionType; + } + + /** + * Get the errorDetail property: The internal error message or exception dump. + * + * @return the errorDetail value. + */ + public String errorDetail() { + return this.errorDetail; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("exceptionType", this.exceptionType); + jsonWriter.writeStringField("errorDetail", this.errorDetail); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InnerError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InnerError if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the InnerError. + */ + public static InnerError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InnerError deserializedInnerError = new InnerError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("exceptionType".equals(fieldName)) { + deserializedInnerError.exceptionType = reader.getString(); + } else if ("errorDetail".equals(fieldName)) { + deserializedInnerError.errorDetail = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInnerError; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/KeyVaultKeyReference.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/KeyVaultKeyReference.java new file mode 100644 index 000000000000..f0fab0ffcf23 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/KeyVaultKeyReference.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a reference to Key Vault Key. + */ +@Fluent +public final class KeyVaultKeyReference implements JsonSerializable { + /* + * The URL referencing a key encryption key in Key Vault. + */ + private String keyUrl; + + /* + * The relative URL of the Key Vault containing the key. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyUrl", this.keyUrl); + jsonWriter.writeJsonField("sourceVault", this.sourceVault); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyVaultKeyReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyVaultKeyReference if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KeyVaultKeyReference. + */ + public static KeyVaultKeyReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyVaultKeyReference deserializedKeyVaultKeyReference = new KeyVaultKeyReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyUrl".equals(fieldName)) { + deserializedKeyVaultKeyReference.keyUrl = reader.getString(); + } else if ("sourceVault".equals(fieldName)) { + deserializedKeyVaultKeyReference.sourceVault = SubResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyVaultKeyReference; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/KeyVaultSecretReference.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/KeyVaultSecretReference.java new file mode 100644 index 000000000000..dc1035e33808 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/KeyVaultSecretReference.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a reference to Key Vault Secret. + */ +@Fluent +public final class KeyVaultSecretReference implements JsonSerializable { + /* + * The URL referencing a secret in a Key Vault. + */ + private String secretUrl; + + /* + * The relative URL of the Key Vault containing the secret. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("secretUrl", this.secretUrl); + jsonWriter.writeJsonField("sourceVault", this.sourceVault); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyVaultSecretReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyVaultSecretReference if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KeyVaultSecretReference. + */ + public static KeyVaultSecretReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyVaultSecretReference deserializedKeyVaultSecretReference = new KeyVaultSecretReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("secretUrl".equals(fieldName)) { + deserializedKeyVaultSecretReference.secretUrl = reader.getString(); + } else if ("sourceVault".equals(fieldName)) { + deserializedKeyVaultSecretReference.sourceVault = SubResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyVaultSecretReference; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LaunchBulkInstancesOperationProperties.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LaunchBulkInstancesOperationProperties.java new file mode 100644 index 000000000000..9502f8c9d139 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LaunchBulkInstancesOperationProperties.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Details of the LaunchBulkInstancesOperation. + */ +@Fluent +public final class LaunchBulkInstancesOperationProperties + implements JsonSerializable { + /* + * The UTC time the LaunchBulkInstancesOperation resource was created. + */ + private OffsetDateTime createdTime; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /* + * Total capacity to achieve. It can be in terms of VMs or vCPUs. + */ + private int capacity; + + /* + * Specifies capacity type for launching instances. It can be in terms of VMs or vCPUs. + */ + private CapacityType capacityType; + + /* + * Configuration Options for Regular or Spot instances in LaunchBulkInstancesOperation. + */ + private PriorityProfile priorityProfile; + + /* + * List of VM sizes supported for LaunchBulkInstancesOperation + */ + private List vmSizesProfile; + + /* + * Attributes to launch instances. + */ + private VMAttributes vmAttributes; + + /* + * Compute Profile to configure the Virtual Machines. + */ + private ComputeProfile computeProfile; + + /* + * Zone Allocation Policy for launching instances. + */ + private ZoneAllocationPolicy zoneAllocationPolicy; + + /* + * Retry policy the user can pass + */ + private RetryPolicy retryPolicy; + + /** + * Creates an instance of LaunchBulkInstancesOperationProperties class. + */ + public LaunchBulkInstancesOperationProperties() { + } + + /** + * Get the createdTime property: The UTC time the LaunchBulkInstancesOperation resource was created. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.createdTime; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the capacity property: Total capacity to achieve. It can be in terms of VMs or vCPUs. + * + * @return the capacity value. + */ + public int capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Total capacity to achieve. It can be in terms of VMs or vCPUs. + * + * @param capacity the capacity value to set. + * @return the LaunchBulkInstancesOperationProperties object itself. + */ + public LaunchBulkInstancesOperationProperties withCapacity(int capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the capacityType property: Specifies capacity type for launching instances. It can be in terms of VMs or + * vCPUs. + * + * @return the capacityType value. + */ + public CapacityType capacityType() { + return this.capacityType; + } + + /** + * Set the capacityType property: Specifies capacity type for launching instances. It can be in terms of VMs or + * vCPUs. + * + * @param capacityType the capacityType value to set. + * @return the LaunchBulkInstancesOperationProperties object itself. + */ + public LaunchBulkInstancesOperationProperties withCapacityType(CapacityType capacityType) { + this.capacityType = capacityType; + return this; + } + + /** + * Get the priorityProfile property: Configuration Options for Regular or Spot instances in + * LaunchBulkInstancesOperation. + * + * @return the priorityProfile value. + */ + public PriorityProfile priorityProfile() { + return this.priorityProfile; + } + + /** + * Set the priorityProfile property: Configuration Options for Regular or Spot instances in + * LaunchBulkInstancesOperation. + * + * @param priorityProfile the priorityProfile value to set. + * @return the LaunchBulkInstancesOperationProperties object itself. + */ + public LaunchBulkInstancesOperationProperties withPriorityProfile(PriorityProfile priorityProfile) { + this.priorityProfile = priorityProfile; + return this; + } + + /** + * Get the vmSizesProfile property: List of VM sizes supported for LaunchBulkInstancesOperation. + * + * @return the vmSizesProfile value. + */ + public List vmSizesProfile() { + return this.vmSizesProfile; + } + + /** + * Set the vmSizesProfile property: List of VM sizes supported for LaunchBulkInstancesOperation. + * + * @param vmSizesProfile the vmSizesProfile value to set. + * @return the LaunchBulkInstancesOperationProperties object itself. + */ + public LaunchBulkInstancesOperationProperties withVmSizesProfile(List vmSizesProfile) { + this.vmSizesProfile = vmSizesProfile; + return this; + } + + /** + * Get the vmAttributes property: Attributes to launch instances. + * + * @return the vmAttributes value. + */ + public VMAttributes vmAttributes() { + return this.vmAttributes; + } + + /** + * Set the vmAttributes property: Attributes to launch instances. + * + * @param vmAttributes the vmAttributes value to set. + * @return the LaunchBulkInstancesOperationProperties object itself. + */ + public LaunchBulkInstancesOperationProperties withVmAttributes(VMAttributes vmAttributes) { + this.vmAttributes = vmAttributes; + return this; + } + + /** + * Get the computeProfile property: Compute Profile to configure the Virtual Machines. + * + * @return the computeProfile value. + */ + public ComputeProfile computeProfile() { + return this.computeProfile; + } + + /** + * Set the computeProfile property: Compute Profile to configure the Virtual Machines. + * + * @param computeProfile the computeProfile value to set. + * @return the LaunchBulkInstancesOperationProperties object itself. + */ + public LaunchBulkInstancesOperationProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the zoneAllocationPolicy property: Zone Allocation Policy for launching instances. + * + * @return the zoneAllocationPolicy value. + */ + public ZoneAllocationPolicy zoneAllocationPolicy() { + return this.zoneAllocationPolicy; + } + + /** + * Set the zoneAllocationPolicy property: Zone Allocation Policy for launching instances. + * + * @param zoneAllocationPolicy the zoneAllocationPolicy value to set. + * @return the LaunchBulkInstancesOperationProperties object itself. + */ + public LaunchBulkInstancesOperationProperties withZoneAllocationPolicy(ZoneAllocationPolicy zoneAllocationPolicy) { + this.zoneAllocationPolicy = zoneAllocationPolicy; + return this; + } + + /** + * Get the retryPolicy property: Retry policy the user can pass. + * + * @return the retryPolicy value. + */ + public RetryPolicy retryPolicy() { + return this.retryPolicy; + } + + /** + * Set the retryPolicy property: Retry policy the user can pass. + * + * @param retryPolicy the retryPolicy value to set. + * @return the LaunchBulkInstancesOperationProperties object itself. + */ + public LaunchBulkInstancesOperationProperties withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("capacity", this.capacity); + jsonWriter.writeJsonField("priorityProfile", this.priorityProfile); + jsonWriter.writeJsonField("computeProfile", this.computeProfile); + jsonWriter.writeStringField("capacityType", this.capacityType == null ? null : this.capacityType.toString()); + jsonWriter.writeArrayField("vmSizesProfile", this.vmSizesProfile, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("vmAttributes", this.vmAttributes); + jsonWriter.writeJsonField("zoneAllocationPolicy", this.zoneAllocationPolicy); + jsonWriter.writeJsonField("retryPolicy", this.retryPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LaunchBulkInstancesOperationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LaunchBulkInstancesOperationProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LaunchBulkInstancesOperationProperties. + */ + public static LaunchBulkInstancesOperationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LaunchBulkInstancesOperationProperties deserializedLaunchBulkInstancesOperationProperties + = new LaunchBulkInstancesOperationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("capacity".equals(fieldName)) { + deserializedLaunchBulkInstancesOperationProperties.capacity = reader.getInt(); + } else if ("priorityProfile".equals(fieldName)) { + deserializedLaunchBulkInstancesOperationProperties.priorityProfile + = PriorityProfile.fromJson(reader); + } else if ("computeProfile".equals(fieldName)) { + deserializedLaunchBulkInstancesOperationProperties.computeProfile = ComputeProfile.fromJson(reader); + } else if ("createdTime".equals(fieldName)) { + deserializedLaunchBulkInstancesOperationProperties.createdTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("provisioningState".equals(fieldName)) { + deserializedLaunchBulkInstancesOperationProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("capacityType".equals(fieldName)) { + deserializedLaunchBulkInstancesOperationProperties.capacityType + = CapacityType.fromString(reader.getString()); + } else if ("vmSizesProfile".equals(fieldName)) { + List vmSizesProfile = reader.readArray(reader1 -> VmSizeProfile.fromJson(reader1)); + deserializedLaunchBulkInstancesOperationProperties.vmSizesProfile = vmSizesProfile; + } else if ("vmAttributes".equals(fieldName)) { + deserializedLaunchBulkInstancesOperationProperties.vmAttributes = VMAttributes.fromJson(reader); + } else if ("zoneAllocationPolicy".equals(fieldName)) { + deserializedLaunchBulkInstancesOperationProperties.zoneAllocationPolicy + = ZoneAllocationPolicy.fromJson(reader); + } else if ("retryPolicy".equals(fieldName)) { + deserializedLaunchBulkInstancesOperationProperties.retryPolicy = RetryPolicy.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLaunchBulkInstancesOperationProperties; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LaunchBulkInstancesOperations.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LaunchBulkInstancesOperations.java new file mode 100644 index 000000000000..842e922ee8c2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LaunchBulkInstancesOperations.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.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 LaunchBulkInstancesOperations. + */ +public interface LaunchBulkInstancesOperations { + /** + * Gets an instance of LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of LaunchBulkInstancesOperations along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String location, + String name, Context context); + + /** + * Gets an instance of LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of LaunchBulkInstancesOperations. + */ + LocationBasedLaunchBulkInstancesOperation get(String resourceGroupName, String location, String name); + + /** + * Get the status of a LaunchBulkInstancesOperation. + * + * @param location The location name. + * @param asyncOperationId The async operation id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a LaunchBulkInstancesOperation along with {@link Response}. + */ + Response getOperationStatusWithResponse(String location, String asyncOperationId, + Context context); + + /** + * Get the status of a LaunchBulkInstancesOperation. + * + * @param location The location name. + * @param asyncOperationId The async operation id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a LaunchBulkInstancesOperation. + */ + OperationStatusResult getOperationStatus(String location, String asyncOperationId); + + /** + * Deletes LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 location, String name); + + /** + * Deletes LaunchBulkInstancesOperations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param deleteInstances When true, deletes all virtual machines created by this BulkAction Operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String location, String name, Boolean deleteInstances, Context context); + + /** + * Cancels LaunchBulkInstancesOperation instances that have not yet launched. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(String resourceGroupName, String location, String name); + + /** + * Cancels LaunchBulkInstancesOperation instances that have not yet launched. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(String resourceGroupName, String location, String name, Context context); + + /** + * List LaunchBulkInstancesOperation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, + String location); + + /** + * List LaunchBulkInstancesOperation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, + String location, Context context); + + /** + * List LaunchBulkInstancesOperation resources by subscriptionId. + * + * @param location The location name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources as paginated response with {@link PagedIterable}. + */ + PagedIterable listBySubscription(String location); + + /** + * List LaunchBulkInstancesOperation resources by subscriptionId. + * + * @param location The location name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of LaunchBulkInstancesOperation resources as paginated response with {@link PagedIterable}. + */ + PagedIterable listBySubscription(String location, Context context); + + /** + * List VirtualMachine resources of a LaunchBulkInstancesOperation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a virtual machine list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listVirtualMachines(String resourceGroupName, String location, String name); + + /** + * List VirtualMachine resources of a LaunchBulkInstancesOperation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param name The name of the LaunchBulkInstancesOperation. + * @param filter Filter expression to filter the virtual machines. + * @param skiptoken Skip token for pagination. Uses the token from a previous response to fetch the next page of + * results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a virtual machine list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listVirtualMachines(String resourceGroupName, String location, String name, + String filter, String skiptoken, Context context); + + /** + * Gets an instance of LaunchBulkInstancesOperations. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of LaunchBulkInstancesOperations along with {@link Response}. + */ + LocationBasedLaunchBulkInstancesOperation getById(String id); + + /** + * Gets an instance of LaunchBulkInstancesOperations. + * + * @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 an instance of LaunchBulkInstancesOperations along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes LaunchBulkInstancesOperations. + * + * @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 LaunchBulkInstancesOperations. + * + * @param id the resource ID. + * @param deleteInstances When true, deletes all virtual machines created by this BulkAction Operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Boolean deleteInstances, Context context); + + /** + * Begins definition for a new LocationBasedLaunchBulkInstancesOperation resource. + * + * @param name resource name. + * @return the first stage of the new LocationBasedLaunchBulkInstancesOperation definition. + */ + LocationBasedLaunchBulkInstancesOperation.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxConfiguration.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxConfiguration.java new file mode 100644 index 000000000000..0ad6428ae600 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxConfiguration.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * 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 implements JsonSerializable { + /* + * Specifies whether password authentication should be disabled. + */ + private Boolean disablePasswordAuthentication; + + /* + * Specifies the ssh key configuration for a Linux OS. + */ + 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. + */ + private Boolean provisionVMAgent; + + /* + * [Preview Feature] Specifies settings related to VM Guest Patching on Linux. + */ + private LinuxPatchSettings patchSettings; + + /* + * Indicates whether VMAgent Platform Updates is enabled for the Linux virtual machine. Default value is false. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("disablePasswordAuthentication", this.disablePasswordAuthentication); + jsonWriter.writeJsonField("ssh", this.ssh); + jsonWriter.writeBooleanField("provisionVMAgent", this.provisionVMAgent); + jsonWriter.writeJsonField("patchSettings", this.patchSettings); + jsonWriter.writeBooleanField("enableVMAgentPlatformUpdates", this.enableVMAgentPlatformUpdates); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LinuxConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LinuxConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LinuxConfiguration. + */ + public static LinuxConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LinuxConfiguration deserializedLinuxConfiguration = new LinuxConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("disablePasswordAuthentication".equals(fieldName)) { + deserializedLinuxConfiguration.disablePasswordAuthentication + = reader.getNullable(JsonReader::getBoolean); + } else if ("ssh".equals(fieldName)) { + deserializedLinuxConfiguration.ssh = SshConfiguration.fromJson(reader); + } else if ("provisionVMAgent".equals(fieldName)) { + deserializedLinuxConfiguration.provisionVMAgent = reader.getNullable(JsonReader::getBoolean); + } else if ("patchSettings".equals(fieldName)) { + deserializedLinuxConfiguration.patchSettings = LinuxPatchSettings.fromJson(reader); + } else if ("enableVMAgentPlatformUpdates".equals(fieldName)) { + deserializedLinuxConfiguration.enableVMAgentPlatformUpdates + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedLinuxConfiguration; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxPatchAssessmentMode.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxPatchAssessmentMode.java new file mode 100644 index 000000000000..011887b6905a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxPatchAssessmentMode.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +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 { + /** + * ImageDefault mode. + */ + public static final LinuxPatchAssessmentMode IMAGE_DEFAULT = fromString("ImageDefault"); + + /** + * AutomaticByPlatform mode. + */ + 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxPatchSettings.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxPatchSettings.java new file mode 100644 index 000000000000..6e8a19edd7cb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxPatchSettings.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies settings related to VM Guest Patching on Linux. + */ +@Fluent +public final class LinuxPatchSettings implements JsonSerializable { + /* + * 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 + */ + 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. + */ + private LinuxPatchAssessmentMode assessmentMode; + + /* + * Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Linux. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("patchMode", this.patchMode == null ? null : this.patchMode.toString()); + jsonWriter.writeStringField("assessmentMode", + this.assessmentMode == null ? null : this.assessmentMode.toString()); + jsonWriter.writeJsonField("automaticByPlatformSettings", this.automaticByPlatformSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LinuxPatchSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LinuxPatchSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LinuxPatchSettings. + */ + public static LinuxPatchSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LinuxPatchSettings deserializedLinuxPatchSettings = new LinuxPatchSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("patchMode".equals(fieldName)) { + deserializedLinuxPatchSettings.patchMode = LinuxVMGuestPatchMode.fromString(reader.getString()); + } else if ("assessmentMode".equals(fieldName)) { + deserializedLinuxPatchSettings.assessmentMode + = LinuxPatchAssessmentMode.fromString(reader.getString()); + } else if ("automaticByPlatformSettings".equals(fieldName)) { + deserializedLinuxPatchSettings.automaticByPlatformSettings + = LinuxVMGuestPatchAutomaticByPlatformSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLinuxPatchSettings; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxVMGuestPatchAutomaticByPlatformRebootSetting.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxVMGuestPatchAutomaticByPlatformRebootSetting.java new file mode 100644 index 000000000000..6acee2c1cca9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxVMGuestPatchAutomaticByPlatformRebootSetting.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the reboot setting for all AutomaticByPlatform patch installation operations. + */ +public final class LinuxVMGuestPatchAutomaticByPlatformRebootSetting + extends ExpandableStringEnum { + /** + * Unknown reboot setting. + */ + public static final LinuxVMGuestPatchAutomaticByPlatformRebootSetting UNKNOWN = fromString("Unknown"); + + /** + * Reboot if required. + */ + public static final LinuxVMGuestPatchAutomaticByPlatformRebootSetting IF_REQUIRED = fromString("IfRequired"); + + /** + * Never reboot. + */ + public static final LinuxVMGuestPatchAutomaticByPlatformRebootSetting NEVER = fromString("Never"); + + /** + * Always reboot. + */ + 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxVMGuestPatchAutomaticByPlatformSettings.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxVMGuestPatchAutomaticByPlatformSettings.java new file mode 100644 index 000000000000..853f2d792523 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxVMGuestPatchAutomaticByPlatformSettings.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies additional settings to be applied when patch mode AutomaticByPlatform is selected in Linux patch settings. + */ +@Fluent +public final class LinuxVMGuestPatchAutomaticByPlatformSettings + implements JsonSerializable { + /* + * Specifies the reboot setting for all AutomaticByPlatform patch installation operations. + */ + private LinuxVMGuestPatchAutomaticByPlatformRebootSetting rebootSetting; + + /* + * Enables customer to schedule patching without accidental upgrades + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("rebootSetting", this.rebootSetting == null ? null : this.rebootSetting.toString()); + jsonWriter.writeBooleanField("bypassPlatformSafetyChecksOnUserSchedule", + this.bypassPlatformSafetyChecksOnUserSchedule); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LinuxVMGuestPatchAutomaticByPlatformSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LinuxVMGuestPatchAutomaticByPlatformSettings if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LinuxVMGuestPatchAutomaticByPlatformSettings. + */ + public static LinuxVMGuestPatchAutomaticByPlatformSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LinuxVMGuestPatchAutomaticByPlatformSettings deserializedLinuxVMGuestPatchAutomaticByPlatformSettings + = new LinuxVMGuestPatchAutomaticByPlatformSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rebootSetting".equals(fieldName)) { + deserializedLinuxVMGuestPatchAutomaticByPlatformSettings.rebootSetting + = LinuxVMGuestPatchAutomaticByPlatformRebootSetting.fromString(reader.getString()); + } else if ("bypassPlatformSafetyChecksOnUserSchedule".equals(fieldName)) { + deserializedLinuxVMGuestPatchAutomaticByPlatformSettings.bypassPlatformSafetyChecksOnUserSchedule + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedLinuxVMGuestPatchAutomaticByPlatformSettings; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxVMGuestPatchMode.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxVMGuestPatchMode.java new file mode 100644 index 000000000000..bd795ba5b9e2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxVMGuestPatchMode.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +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 { + /** + * ImageDefault linux VM guest patch mode. + */ + public static final LinuxVMGuestPatchMode IMAGE_DEFAULT = fromString("ImageDefault"); + + /** + * AutomaticByPlatform linux VM guest patch mode. + */ + 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LocalStorageDiskType.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LocalStorageDiskType.java new file mode 100644 index 000000000000..361e98f90bdb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LocalStorageDiskType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Local storage disk types supported by Azure VMs. + */ +public final class LocalStorageDiskType extends ExpandableStringEnum { + /** + * HDD DiskType. + */ + public static final LocalStorageDiskType HDD = fromString("HDD"); + + /** + * SSD DiskType. + */ + public static final LocalStorageDiskType SSD = fromString("SSD"); + + /** + * Creates a new instance of LocalStorageDiskType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LocalStorageDiskType() { + } + + /** + * Creates or finds a LocalStorageDiskType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LocalStorageDiskType. + */ + public static LocalStorageDiskType fromString(String name) { + return fromString(name, LocalStorageDiskType.class); + } + + /** + * Gets known LocalStorageDiskType values. + * + * @return known LocalStorageDiskType values. + */ + public static Collection values() { + return values(LocalStorageDiskType.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LocationBasedLaunchBulkInstancesOperation.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LocationBasedLaunchBulkInstancesOperation.java new file mode 100644 index 000000000000..c579e1ea5244 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LocationBasedLaunchBulkInstancesOperation.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.LocationBasedLaunchBulkInstancesOperationInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of LocationBasedLaunchBulkInstancesOperation. + */ +public interface LocationBasedLaunchBulkInstancesOperation { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + LaunchBulkInstancesOperationProperties properties(); + + /** + * Gets the zones property: Zones in which the LaunchBulkInstancesOperation is available. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the plan property: Details of the resource plan. + * + * @return the plan value. + */ + Plan plan(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner + * com.azure.resourcemanager.compute.bulkactions.fluent.models.LocationBasedLaunchBulkInstancesOperationInner + * object. + * + * @return the inner object. + */ + LocationBasedLaunchBulkInstancesOperationInner innerModel(); + + /** + * The entirety of the LocationBasedLaunchBulkInstancesOperation definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The LocationBasedLaunchBulkInstancesOperation definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the LocationBasedLaunchBulkInstancesOperation definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the LocationBasedLaunchBulkInstancesOperation definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, location. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @return the next definition stage. + */ + WithCreate withExistingLocation(String resourceGroupName, String location); + } + + /** + * The stage of the LocationBasedLaunchBulkInstancesOperation 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.WithZones, DefinitionStages.WithIdentity, DefinitionStages.WithPlan { + /** + * Executes the create request. + * + * @return the created resource. + */ + LocationBasedLaunchBulkInstancesOperation create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LocationBasedLaunchBulkInstancesOperation create(Context context); + } + + /** + * The stage of the LocationBasedLaunchBulkInstancesOperation 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 LocationBasedLaunchBulkInstancesOperation definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(LaunchBulkInstancesOperationProperties properties); + } + + /** + * The stage of the LocationBasedLaunchBulkInstancesOperation definition allowing to specify zones. + */ + interface WithZones { + /** + * Specifies the zones property: Zones in which the LaunchBulkInstancesOperation is available. + * + * @param zones Zones in which the LaunchBulkInstancesOperation is available. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + + /** + * The stage of the LocationBasedLaunchBulkInstancesOperation definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the LocationBasedLaunchBulkInstancesOperation definition allowing to specify plan. + */ + interface WithPlan { + /** + * Specifies the plan property: Details of the resource plan.. + * + * @param plan Details of the resource plan. + * @return the next definition stage. + */ + WithCreate withPlan(Plan plan); + } + } + + /** + * Begins update for the LocationBasedLaunchBulkInstancesOperation resource. + * + * @return the stage of resource update. + */ + LocationBasedLaunchBulkInstancesOperation.Update update(); + + /** + * The template for LocationBasedLaunchBulkInstancesOperation update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithZones, + UpdateStages.WithIdentity, UpdateStages.WithPlan { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LocationBasedLaunchBulkInstancesOperation apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LocationBasedLaunchBulkInstancesOperation apply(Context context); + } + + /** + * The LocationBasedLaunchBulkInstancesOperation update stages. + */ + interface UpdateStages { + /** + * The stage of the LocationBasedLaunchBulkInstancesOperation 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 LocationBasedLaunchBulkInstancesOperation update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(LaunchBulkInstancesOperationProperties properties); + } + + /** + * The stage of the LocationBasedLaunchBulkInstancesOperation update allowing to specify zones. + */ + interface WithZones { + /** + * Specifies the zones property: Zones in which the LaunchBulkInstancesOperation is available. + * + * @param zones Zones in which the LaunchBulkInstancesOperation is available. + * @return the next definition stage. + */ + Update withZones(List zones); + } + + /** + * The stage of the LocationBasedLaunchBulkInstancesOperation update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the LocationBasedLaunchBulkInstancesOperation update allowing to specify plan. + */ + interface WithPlan { + /** + * Specifies the plan property: Details of the resource plan.. + * + * @param plan Details of the resource plan. + * @return the next definition stage. + */ + Update withPlan(Plan plan); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LocationBasedLaunchBulkInstancesOperation refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LocationBasedLaunchBulkInstancesOperation refresh(Context context); + + /** + * Cancels LaunchBulkInstancesOperation instances that have not yet launched. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(); + + /** + * Cancels LaunchBulkInstancesOperation instances that have not yet launched. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ManagedDiskParametersContent.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ManagedDiskParametersContent.java new file mode 100644 index 000000000000..979d3a289027 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ManagedDiskParametersContent.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The parameters of a managed disk. + */ +@Fluent +public final class ManagedDiskParametersContent 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. + */ + private StorageAccountTypes storageAccountType; + + /* + * Specifies the customer managed disk encryption set resource id for the managed disk. + */ + private DiskEncryptionSetParametersContent diskEncryptionSet; + + /* + * Specifies the security profile for the managed disk. + */ + private VMDiskSecurityProfile securityProfile; + + /** + * Creates an instance of ManagedDiskParametersContent class. + */ + public ManagedDiskParametersContent() { + } + + /** + * 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 ManagedDiskParametersContent object itself. + */ + public ManagedDiskParametersContent 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 DiskEncryptionSetParametersContent 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 ManagedDiskParametersContent object itself. + */ + public ManagedDiskParametersContent withDiskEncryptionSet(DiskEncryptionSetParametersContent 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 ManagedDiskParametersContent object itself. + */ + public ManagedDiskParametersContent withSecurityProfile(VMDiskSecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedDiskParametersContent withId(String id) { + super.withId(id); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("storageAccountType", + this.storageAccountType == null ? null : this.storageAccountType.toString()); + jsonWriter.writeJsonField("diskEncryptionSet", this.diskEncryptionSet); + jsonWriter.writeJsonField("securityProfile", this.securityProfile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedDiskParametersContent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedDiskParametersContent if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedDiskParametersContent. + */ + public static ManagedDiskParametersContent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedDiskParametersContent deserializedManagedDiskParametersContent = new ManagedDiskParametersContent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedManagedDiskParametersContent.withId(reader.getString()); + } else if ("storageAccountType".equals(fieldName)) { + deserializedManagedDiskParametersContent.storageAccountType + = StorageAccountTypes.fromString(reader.getString()); + } else if ("diskEncryptionSet".equals(fieldName)) { + deserializedManagedDiskParametersContent.diskEncryptionSet + = DiskEncryptionSetParametersContent.fromJson(reader); + } else if ("securityProfile".equals(fieldName)) { + deserializedManagedDiskParametersContent.securityProfile = VMDiskSecurityProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedDiskParametersContent; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ManagedServiceIdentity.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..dbd7f156e00a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ManagedServiceIdentity.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class ManagedServiceIdentity implements JsonSerializable { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private String principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private String tenantId; + + /* + * The type of managed identity assigned to this resource. + */ + private ManagedServiceIdentityType type; + + /* + * The identities assigned to this resource by the user. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of managed identity assigned to this resource. + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity assigned to this resource. + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId = reader.getString(); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ManagedServiceIdentityType.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..71bdc45a8a7f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ManagedServiceIdentityType.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** + * No managed identity. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * System assigned managed identity. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * User assigned managed identity. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * System and user assigned managed identity. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Mode.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Mode.java new file mode 100644 index 000000000000..c6f7301d1848 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Mode.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the mode that ProxyAgent will execute on if the feature is enabled. ProxyAgent will start to audit or + * monitor but not enforce access control over requests to host endpoints in Audit mode, while in Enforce mode it will + * enforce access control. The default value is Enforce mode. + */ +public final class Mode extends ExpandableStringEnum { + /** + * Audit mode. + */ + public static final Mode AUDIT = fromString("Audit"); + + /** + * Enforce mode. + */ + public static final Mode ENFORCE = fromString("Enforce"); + + /** + * Creates a new instance of Mode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Mode() { + } + + /** + * Creates or finds a Mode from its string representation. + * + * @param name a name to look for. + * @return the corresponding Mode. + */ + public static Mode fromString(String name) { + return fromString(name, Mode.class); + } + + /** + * Gets known Mode values. + * + * @return known Mode values. + */ + public static Collection values() { + return values(Mode.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Modes.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Modes.java new file mode 100644 index 000000000000..2bfb504b9a07 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Modes.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the execution mode. In Audit mode, the system acts as if it is enforcing the access control policy, + * including emitting access denial entries in the logs but it does not actually deny any requests to host endpoints. In + * Enforce mode, the system will enforce the access control and it is the recommended mode of operation. + */ +public final class Modes extends ExpandableStringEnum { + /** + * Audit mode. + */ + public static final Modes AUDIT = fromString("Audit"); + + /** + * Enforce mode. + */ + public static final Modes ENFORCE = fromString("Enforce"); + + /** + * Disabled mode. + */ + public static final Modes DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of Modes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Modes() { + } + + /** + * Creates or finds a Modes from its string representation. + * + * @param name a name to look for. + * @return the corresponding Modes. + */ + public static Modes fromString(String name) { + return fromString(name, Modes.class); + } + + /** + * Gets known Modes values. + * + * @return known Modes values. + */ + public static Collection values() { + return values(Modes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkApiVersion.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkApiVersion.java new file mode 100644 index 000000000000..7535f0f392ab --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkApiVersion.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +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 { + /** + * 2020-11-01 version. + */ + public static final NetworkApiVersion TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE = fromString("2020-11-01"); + + /** + * 2022-11-01 version. + */ + public static final NetworkApiVersion TWO_ZERO_TWO_TWO_ONE_ONE_ZERO_ONE = fromString("2022-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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkInterfaceAuxiliaryMode.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkInterfaceAuxiliaryMode.java new file mode 100644 index 000000000000..8f695f9b4489 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkInterfaceAuxiliaryMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies whether the Auxiliary mode is enabled for the Network Interface resource. + */ +public final class NetworkInterfaceAuxiliaryMode extends ExpandableStringEnum { + /** + * None mode. + */ + public static final NetworkInterfaceAuxiliaryMode NONE = fromString("None"); + + /** + * AcceleratedConnections mode. + */ + public static final NetworkInterfaceAuxiliaryMode ACCELERATED_CONNECTIONS = fromString("AcceleratedConnections"); + + /** + * Floating mode. + */ + public static final NetworkInterfaceAuxiliaryMode FLOATING = fromString("Floating"); + + /** + * Creates a new instance of NetworkInterfaceAuxiliaryMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkInterfaceAuxiliaryMode() { + } + + /** + * Creates or finds a NetworkInterfaceAuxiliaryMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkInterfaceAuxiliaryMode. + */ + public static NetworkInterfaceAuxiliaryMode fromString(String name) { + return fromString(name, NetworkInterfaceAuxiliaryMode.class); + } + + /** + * Gets known NetworkInterfaceAuxiliaryMode values. + * + * @return known NetworkInterfaceAuxiliaryMode values. + */ + public static Collection values() { + return values(NetworkInterfaceAuxiliaryMode.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkInterfaceAuxiliarySku.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkInterfaceAuxiliarySku.java new file mode 100644 index 000000000000..006ae4972003 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkInterfaceAuxiliarySku.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies whether the Auxiliary sku is enabled for the Network Interface resource. + */ +public final class NetworkInterfaceAuxiliarySku extends ExpandableStringEnum { + /** + * None: None sku. + */ + public static final NetworkInterfaceAuxiliarySku NONE = fromString("None"); + + /** + * A1 sku. + */ + public static final NetworkInterfaceAuxiliarySku A1 = fromString("A1"); + + /** + * A2 sku. + */ + public static final NetworkInterfaceAuxiliarySku A2 = fromString("A2"); + + /** + * A4 sku. + */ + public static final NetworkInterfaceAuxiliarySku A4 = fromString("A4"); + + /** + * A8 sku. + */ + public static final NetworkInterfaceAuxiliarySku A8 = fromString("A8"); + + /** + * Creates a new instance of NetworkInterfaceAuxiliarySku value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkInterfaceAuxiliarySku() { + } + + /** + * Creates or finds a NetworkInterfaceAuxiliarySku from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkInterfaceAuxiliarySku. + */ + public static NetworkInterfaceAuxiliarySku fromString(String name) { + return fromString(name, NetworkInterfaceAuxiliarySku.class); + } + + /** + * Gets known NetworkInterfaceAuxiliarySku values. + * + * @return known NetworkInterfaceAuxiliarySku values. + */ + public static Collection values() { + return values(NetworkInterfaceAuxiliarySku.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkInterfaceReference.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkInterfaceReference.java new file mode 100644 index 000000000000..21d120c7c1dd --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkInterfaceReference.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a network interface reference. + */ +@Fluent +public final class NetworkInterfaceReference extends SubResource { + /* + * Describes a network interface reference properties. + */ + private NetworkInterfaceReferenceProperties properties; + + /** + * Creates an instance of NetworkInterfaceReference class. + */ + public NetworkInterfaceReference() { + } + + /** + * Get the properties property: Describes a network interface reference properties. + * + * @return the properties value. + */ + public NetworkInterfaceReferenceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Describes a network interface reference properties. + * + * @param properties the properties value to set. + * @return the NetworkInterfaceReference object itself. + */ + public NetworkInterfaceReference withProperties(NetworkInterfaceReferenceProperties properties) { + this.properties = properties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkInterfaceReference withId(String id) { + super.withId(id); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfaceReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfaceReference if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfaceReference. + */ + public static NetworkInterfaceReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfaceReference deserializedNetworkInterfaceReference = new NetworkInterfaceReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkInterfaceReference.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedNetworkInterfaceReference.properties + = NetworkInterfaceReferenceProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfaceReference; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkInterfaceReferenceProperties.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkInterfaceReferenceProperties.java new file mode 100644 index 000000000000..79274b83aba7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkInterfaceReferenceProperties.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a network interface reference properties. + */ +@Fluent +public final class NetworkInterfaceReferenceProperties + implements JsonSerializable { + /* + * Specifies the primary network interface in case the virtual machine has more than 1 network interface. + */ + private Boolean primary; + + /* + * Specify what happens to the network interface when the VM is deleted + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("primary", this.primary); + jsonWriter.writeStringField("deleteOption", this.deleteOption == null ? null : this.deleteOption.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfaceReferenceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfaceReferenceProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfaceReferenceProperties. + */ + public static NetworkInterfaceReferenceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfaceReferenceProperties deserializedNetworkInterfaceReferenceProperties + = new NetworkInterfaceReferenceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("primary".equals(fieldName)) { + deserializedNetworkInterfaceReferenceProperties.primary + = reader.getNullable(JsonReader::getBoolean); + } else if ("deleteOption".equals(fieldName)) { + deserializedNetworkInterfaceReferenceProperties.deleteOption + = DeleteOptions.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfaceReferenceProperties; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkProfile.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkProfile.java new file mode 100644 index 000000000000..7527eb7fadb0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkProfile.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Specifies the network interfaces or the networking configuration of the virtual machine. + */ +@Fluent +public final class NetworkProfile implements JsonSerializable { + /* + * Specifies the list of resource Ids for the network interfaces associated with the virtual machine. + */ + private List networkInterfaces; + + /* + * specifies the Microsoft.Network API version used when creating networking resources in the Network Interface + * Configurations + */ + private NetworkApiVersion networkApiVersion; + + /* + * Specifies the networking configurations that will be used to create the virtual machine networking resources. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("networkInterfaces", this.networkInterfaces, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("networkApiVersion", + this.networkApiVersion == null ? null : this.networkApiVersion.toString()); + jsonWriter.writeArrayField("networkInterfaceConfigurations", this.networkInterfaceConfigurations, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkProfile. + */ + public static NetworkProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkProfile deserializedNetworkProfile = new NetworkProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkInterfaces".equals(fieldName)) { + List networkInterfaces + = reader.readArray(reader1 -> NetworkInterfaceReference.fromJson(reader1)); + deserializedNetworkProfile.networkInterfaces = networkInterfaces; + } else if ("networkApiVersion".equals(fieldName)) { + deserializedNetworkProfile.networkApiVersion = NetworkApiVersion.fromString(reader.getString()); + } else if ("networkInterfaceConfigurations".equals(fieldName)) { + List networkInterfaceConfigurations + = reader.readArray(reader1 -> VirtualMachineNetworkInterfaceConfiguration.fromJson(reader1)); + deserializedNetworkProfile.networkInterfaceConfigurations = networkInterfaceConfigurations; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkProfile; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OSDisk.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OSDisk.java new file mode 100644 index 000000000000..22a08a427bfe --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OSDisk.java @@ -0,0 +1,431 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * 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 implements JsonSerializable { + /* + * 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. + */ + private OperatingSystemTypes osType; + + /* + * Specifies the encryption settings for the OS Disk. Minimum compute api-version: 2015-06-15. + */ + private DiskEncryptionSettings encryptionSettings; + + /* + * The disk name. + */ + private String name; + + /* + * The virtual hard disk. + */ + 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. + */ + 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. + */ + private CachingTypes caching; + + /* + * Specifies whether writeAccelerator should be enabled or disabled on the disk. + */ + private Boolean writeAcceleratorEnabled; + + /* + * Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. + */ + private DiffDiskSettings diffDiskSettings; + + /* + * Specifies how the virtual machine disk should be created. Possible values are Attach, FromImage. 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. + */ + 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. + */ + private Integer diskSizeGB; + + /* + * The managed disk parameters. + */ + private ManagedDiskParametersContent managedDisk; + + /* + * Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: Delete, Detach. + * 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. + */ + 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 compute + * 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 compute + * 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 disk should be created. Possible values are + * Attach, FromImage. 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 disk should be created. Possible values are + * Attach, FromImage. 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 ManagedDiskParametersContent 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(ManagedDiskParametersContent 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, Detach. 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, Detach. 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createOption", this.createOption == null ? null : this.createOption.toString()); + jsonWriter.writeStringField("osType", this.osType == null ? null : this.osType.toString()); + jsonWriter.writeJsonField("encryptionSettings", this.encryptionSettings); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("vhd", this.vhd); + jsonWriter.writeJsonField("image", this.image); + jsonWriter.writeStringField("caching", this.caching == null ? null : this.caching.toString()); + jsonWriter.writeBooleanField("writeAcceleratorEnabled", this.writeAcceleratorEnabled); + jsonWriter.writeJsonField("diffDiskSettings", this.diffDiskSettings); + jsonWriter.writeNumberField("diskSizeGB", this.diskSizeGB); + jsonWriter.writeJsonField("managedDisk", this.managedDisk); + jsonWriter.writeStringField("deleteOption", this.deleteOption == null ? null : this.deleteOption.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OSDisk from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OSDisk if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OSDisk. + */ + public static OSDisk fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OSDisk deserializedOSDisk = new OSDisk(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("createOption".equals(fieldName)) { + deserializedOSDisk.createOption = DiskCreateOptionTypes.fromString(reader.getString()); + } else if ("osType".equals(fieldName)) { + deserializedOSDisk.osType = OperatingSystemTypes.fromString(reader.getString()); + } else if ("encryptionSettings".equals(fieldName)) { + deserializedOSDisk.encryptionSettings = DiskEncryptionSettings.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedOSDisk.name = reader.getString(); + } else if ("vhd".equals(fieldName)) { + deserializedOSDisk.vhd = VirtualHardDisk.fromJson(reader); + } else if ("image".equals(fieldName)) { + deserializedOSDisk.image = VirtualHardDisk.fromJson(reader); + } else if ("caching".equals(fieldName)) { + deserializedOSDisk.caching = CachingTypes.fromString(reader.getString()); + } else if ("writeAcceleratorEnabled".equals(fieldName)) { + deserializedOSDisk.writeAcceleratorEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("diffDiskSettings".equals(fieldName)) { + deserializedOSDisk.diffDiskSettings = DiffDiskSettings.fromJson(reader); + } else if ("diskSizeGB".equals(fieldName)) { + deserializedOSDisk.diskSizeGB = reader.getNullable(JsonReader::getInt); + } else if ("managedDisk".equals(fieldName)) { + deserializedOSDisk.managedDisk = ManagedDiskParametersContent.fromJson(reader); + } else if ("deleteOption".equals(fieldName)) { + deserializedOSDisk.deleteOption = DiskDeleteOptionTypes.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOSDisk; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OSImageNotificationProfile.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OSImageNotificationProfile.java new file mode 100644 index 000000000000..5ccf84768afa --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OSImageNotificationProfile.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Profile for the OS Image Scheduled event. + */ +@Fluent +public final class OSImageNotificationProfile implements JsonSerializable { + /* + * 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) + */ + private String notBeforeTimeout; + + /* + * Specifies whether the OS Image Scheduled event is enabled or disabled. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("notBeforeTimeout", this.notBeforeTimeout); + jsonWriter.writeBooleanField("enable", this.enable); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OSImageNotificationProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OSImageNotificationProfile if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OSImageNotificationProfile. + */ + public static OSImageNotificationProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OSImageNotificationProfile deserializedOSImageNotificationProfile = new OSImageNotificationProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("notBeforeTimeout".equals(fieldName)) { + deserializedOSImageNotificationProfile.notBeforeTimeout = reader.getString(); + } else if ("enable".equals(fieldName)) { + deserializedOSImageNotificationProfile.enable = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedOSImageNotificationProfile; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OSProfile.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OSProfile.java new file mode 100644 index 000000000000..8aa8271e85b4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OSProfile.java @@ -0,0 +1,411 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * 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 implements JsonSerializable { + /* + * 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). + */ + 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. + */ + 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) + */ + 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). + */ + private String customData; + + /* + * Specifies Windows operating system settings on the virtual machine. + */ + 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). + */ + 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). + */ + 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. + */ + private Boolean allowExtensionOperations; + + /* + * Optional property which must either be set to True or omitted. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computerName", this.computerName); + jsonWriter.writeStringField("adminUsername", this.adminUsername); + jsonWriter.writeStringField("adminPassword", this.adminPassword); + jsonWriter.writeStringField("customData", this.customData); + jsonWriter.writeJsonField("windowsConfiguration", this.windowsConfiguration); + jsonWriter.writeJsonField("linuxConfiguration", this.linuxConfiguration); + jsonWriter.writeArrayField("secrets", this.secrets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("allowExtensionOperations", this.allowExtensionOperations); + jsonWriter.writeBooleanField("requireGuestProvisionSignal", this.requireGuestProvisionSignal); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OSProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OSProfile if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the OSProfile. + */ + public static OSProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OSProfile deserializedOSProfile = new OSProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computerName".equals(fieldName)) { + deserializedOSProfile.computerName = reader.getString(); + } else if ("adminUsername".equals(fieldName)) { + deserializedOSProfile.adminUsername = reader.getString(); + } else if ("adminPassword".equals(fieldName)) { + deserializedOSProfile.adminPassword = reader.getString(); + } else if ("customData".equals(fieldName)) { + deserializedOSProfile.customData = reader.getString(); + } else if ("windowsConfiguration".equals(fieldName)) { + deserializedOSProfile.windowsConfiguration = WindowsConfiguration.fromJson(reader); + } else if ("linuxConfiguration".equals(fieldName)) { + deserializedOSProfile.linuxConfiguration = LinuxConfiguration.fromJson(reader); + } else if ("secrets".equals(fieldName)) { + List secrets = reader.readArray(reader1 -> VaultSecretGroup.fromJson(reader1)); + deserializedOSProfile.secrets = secrets; + } else if ("allowExtensionOperations".equals(fieldName)) { + deserializedOSProfile.allowExtensionOperations = reader.getNullable(JsonReader::getBoolean); + } else if ("requireGuestProvisionSignal".equals(fieldName)) { + deserializedOSProfile.requireGuestProvisionSignal = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedOSProfile; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OSProfileProvisioningData.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OSProfileProvisioningData.java new file mode 100644 index 000000000000..e491a000f950 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OSProfileProvisioningData.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Additional parameters for Reimaging Non-Ephemeral Virtual Machine. + */ +@Fluent +public final class OSProfileProvisioningData implements JsonSerializable { + /* + * 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) + */ + 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). + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("adminPassword", this.adminPassword); + jsonWriter.writeStringField("customData", this.customData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OSProfileProvisioningData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OSProfileProvisioningData if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OSProfileProvisioningData. + */ + public static OSProfileProvisioningData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OSProfileProvisioningData deserializedOSProfileProvisioningData = new OSProfileProvisioningData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("adminPassword".equals(fieldName)) { + deserializedOSProfileProvisioningData.adminPassword = reader.getString(); + } else if ("customData".equals(fieldName)) { + deserializedOSProfileProvisioningData.customData = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOSProfileProvisioningData; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OperatingSystemTypes.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OperatingSystemTypes.java new file mode 100644 index 000000000000..111f448133af --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OperatingSystemTypes.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * This property allows you to specify the supported type of the OS that application is built for. Possible values are: + * **Windows,** **Linux.**. + */ +public final class OperatingSystemTypes extends ExpandableStringEnum { + /** + * Windows OS. + */ + public static final OperatingSystemTypes WINDOWS = fromString("Windows"); + + /** + * Linux OS. + */ + public static final OperatingSystemTypes LINUX = fromString("Linux"); + + /** + * Creates a new instance of OperatingSystemTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OperatingSystemTypes() { + } + + /** + * Creates or finds a OperatingSystemTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperatingSystemTypes. + */ + public static OperatingSystemTypes fromString(String name) { + return fromString(name, OperatingSystemTypes.class); + } + + /** + * Gets known OperatingSystemTypes values. + * + * @return known OperatingSystemTypes values. + */ + public static Collection values() { + return values(OperatingSystemTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OperationStatusResult.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OperationStatusResult.java new file mode 100644 index 000000000000..54314fc89324 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OperationStatusResult.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.OperationStatusResultInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of OperationStatusResult. + */ +public interface OperationStatusResult { + /** + * Gets the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the async operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: Operation status. + * + * @return the status value. + */ + String status(); + + /** + * Gets the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + Double percentComplete(); + + /** + * Gets the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the operations property: The operations list. + * + * @return the operations value. + */ + List operations(); + + /** + * Gets the error property: If present, details of the operation error. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + String resourceId(); + + /** + * Gets the inner com.azure.resourcemanager.compute.bulkactions.fluent.models.OperationStatusResultInner object. + * + * @return the inner object. + */ + OperationStatusResultInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OsType.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OsType.java new file mode 100644 index 000000000000..3d7078335620 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OsType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The supported operating system types for flex VM creation. + */ +public final class OsType extends ExpandableStringEnum { + /** + * Windows operating system. + */ + public static final OsType WINDOWS = fromString("Windows"); + + /** + * Linux operating system. + */ + public static final OsType LINUX = fromString("Linux"); + + /** + * Creates a new instance of OsType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OsType() { + } + + /** + * Creates or finds a OsType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OsType. + */ + public static OsType fromString(String name) { + return fromString(name, OsType.class); + } + + /** + * Gets known OsType values. + * + * @return known OsType values. + */ + public static Collection values() { + return values(OsType.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PatchSettings.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PatchSettings.java new file mode 100644 index 000000000000..b2582b4df712 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PatchSettings.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies settings related to VM Guest Patching on Windows. + */ +@Fluent +public final class PatchSettings implements JsonSerializable { + /* + * 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 + */ + 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'. + */ + 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. + */ + private WindowsPatchAssessmentMode assessmentMode; + + /* + * Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Windows. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("patchMode", this.patchMode == null ? null : this.patchMode.toString()); + jsonWriter.writeBooleanField("enableHotpatching", this.enableHotpatching); + jsonWriter.writeStringField("assessmentMode", + this.assessmentMode == null ? null : this.assessmentMode.toString()); + jsonWriter.writeJsonField("automaticByPlatformSettings", this.automaticByPlatformSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatchSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatchSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PatchSettings. + */ + public static PatchSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PatchSettings deserializedPatchSettings = new PatchSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("patchMode".equals(fieldName)) { + deserializedPatchSettings.patchMode = WindowsVMGuestPatchMode.fromString(reader.getString()); + } else if ("enableHotpatching".equals(fieldName)) { + deserializedPatchSettings.enableHotpatching = reader.getNullable(JsonReader::getBoolean); + } else if ("assessmentMode".equals(fieldName)) { + deserializedPatchSettings.assessmentMode + = WindowsPatchAssessmentMode.fromString(reader.getString()); + } else if ("automaticByPlatformSettings".equals(fieldName)) { + deserializedPatchSettings.automaticByPlatformSettings + = WindowsVMGuestPatchAutomaticByPlatformSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPatchSettings; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Plan.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Plan.java new file mode 100644 index 000000000000..5bbf493d9dc0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Plan.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Plan for the resource. + */ +@Fluent +public final class Plan implements JsonSerializable { + /* + * A user defined name of the 3rd Party Artifact that is being procured. + */ + private String name; + + /* + * The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic + */ + private String publisher; + + /* + * The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the + * artifact at the time of Data Market onboarding. + */ + private String product; + + /* + * A publisher provided promotion code as provisioned in Data Market for the said product/artifact. + */ + private String promotionCode; + + /* + * The version of the desired product/artifact. + */ + private String version; + + /** + * Creates an instance of Plan class. + */ + public Plan() { + } + + /** + * Get the name property: A user defined name of the 3rd Party Artifact that is being procured. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A user defined name of the 3rd Party Artifact that is being procured. + * + * @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 of the 3rd Party Artifact that is being bought. E.g. NewRelic. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + * + * @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: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the + * OfferID specified for the artifact at the time of Data Market onboarding. + * + * @return the product value. + */ + public String product() { + return this.product; + } + + /** + * Set the product property: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the + * OfferID specified for the artifact at the time of Data Market onboarding. + * + * @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: A publisher provided promotion code as provisioned in Data Market for the said + * product/artifact. + * + * @return the promotionCode value. + */ + public String promotionCode() { + return this.promotionCode; + } + + /** + * Set the promotionCode property: A publisher provided promotion code as provisioned in Data Market for the said + * product/artifact. + * + * @param promotionCode the promotionCode value to set. + * @return the Plan object itself. + */ + public Plan withPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** + * Get the version property: The version of the desired product/artifact. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of the desired product/artifact. + * + * @param version the version value to set. + * @return the Plan object itself. + */ + public Plan withVersion(String version) { + this.version = version; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("publisher", this.publisher); + jsonWriter.writeStringField("product", this.product); + jsonWriter.writeStringField("promotionCode", this.promotionCode); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Plan from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Plan if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Plan. + */ + public static Plan fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Plan deserializedPlan = new Plan(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPlan.name = reader.getString(); + } else if ("publisher".equals(fieldName)) { + deserializedPlan.publisher = reader.getString(); + } else if ("product".equals(fieldName)) { + deserializedPlan.product = reader.getString(); + } else if ("promotionCode".equals(fieldName)) { + deserializedPlan.promotionCode = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedPlan.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPlan; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PriorityProfile.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PriorityProfile.java new file mode 100644 index 000000000000..4d4982caec93 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PriorityProfile.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The priority profile for flex VM creation. + */ +@Fluent +public final class PriorityProfile implements JsonSerializable { + /* + * The priority type for VM allocation + */ + private PriorityType type; + + /* + * Price per hour of each Spot VM will never exceed this. Available from 2026-04-06-preview. + */ + private Double maxPricePerVM; + + /* + * Eviction Policy to follow when evicting Spot VMs. Available from 2026-04-06-preview. + */ + private EvictionPolicy evictionPolicy; + + /* + * The allocation strategy for VM size selection + */ + private AllocationStrategy allocationStrategy; + + /** + * Creates an instance of PriorityProfile class. + */ + public PriorityProfile() { + } + + /** + * Get the type property: The priority type for VM allocation. + * + * @return the type value. + */ + public PriorityType type() { + return this.type; + } + + /** + * Set the type property: The priority type for VM allocation. + * + * @param type the type value to set. + * @return the PriorityProfile object itself. + */ + public PriorityProfile withType(PriorityType type) { + this.type = type; + return this; + } + + /** + * Get the maxPricePerVM property: Price per hour of each Spot VM will never exceed this. Available from + * 2026-04-06-preview. + * + * @return the maxPricePerVM value. + */ + public Double maxPricePerVM() { + return this.maxPricePerVM; + } + + /** + * Set the maxPricePerVM property: Price per hour of each Spot VM will never exceed this. Available from + * 2026-04-06-preview. + * + * @param maxPricePerVM the maxPricePerVM value to set. + * @return the PriorityProfile object itself. + */ + public PriorityProfile withMaxPricePerVM(Double maxPricePerVM) { + this.maxPricePerVM = maxPricePerVM; + return this; + } + + /** + * Get the evictionPolicy property: Eviction Policy to follow when evicting Spot VMs. Available from + * 2026-04-06-preview. + * + * @return the evictionPolicy value. + */ + public EvictionPolicy evictionPolicy() { + return this.evictionPolicy; + } + + /** + * Set the evictionPolicy property: Eviction Policy to follow when evicting Spot VMs. Available from + * 2026-04-06-preview. + * + * @param evictionPolicy the evictionPolicy value to set. + * @return the PriorityProfile object itself. + */ + public PriorityProfile withEvictionPolicy(EvictionPolicy evictionPolicy) { + this.evictionPolicy = evictionPolicy; + return this; + } + + /** + * Get the allocationStrategy property: The allocation strategy for VM size selection. + * + * @return the allocationStrategy value. + */ + public AllocationStrategy allocationStrategy() { + return this.allocationStrategy; + } + + /** + * Set the allocationStrategy property: The allocation strategy for VM size selection. + * + * @param allocationStrategy the allocationStrategy value to set. + * @return the PriorityProfile object itself. + */ + public PriorityProfile withAllocationStrategy(AllocationStrategy allocationStrategy) { + this.allocationStrategy = allocationStrategy; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeNumberField("maxPricePerVM", this.maxPricePerVM); + jsonWriter.writeStringField("evictionPolicy", + this.evictionPolicy == null ? null : this.evictionPolicy.toString()); + jsonWriter.writeStringField("allocationStrategy", + this.allocationStrategy == null ? null : this.allocationStrategy.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PriorityProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PriorityProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PriorityProfile. + */ + public static PriorityProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PriorityProfile deserializedPriorityProfile = new PriorityProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedPriorityProfile.type = PriorityType.fromString(reader.getString()); + } else if ("maxPricePerVM".equals(fieldName)) { + deserializedPriorityProfile.maxPricePerVM = reader.getNullable(JsonReader::getDouble); + } else if ("evictionPolicy".equals(fieldName)) { + deserializedPriorityProfile.evictionPolicy = EvictionPolicy.fromString(reader.getString()); + } else if ("allocationStrategy".equals(fieldName)) { + deserializedPriorityProfile.allocationStrategy = AllocationStrategy.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPriorityProfile; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PriorityType.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PriorityType.java new file mode 100644 index 000000000000..6d1a103e6e55 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PriorityType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The priority type for VM allocation. + */ +public final class PriorityType extends ExpandableStringEnum { + /** + * Regular priority VMs. + */ + public static final PriorityType REGULAR = fromString("Regular"); + + /** + * Spot priority VMs. + */ + public static final PriorityType SPOT = fromString("Spot"); + + /** + * Creates a new instance of PriorityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PriorityType() { + } + + /** + * Creates or finds a PriorityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PriorityType. + */ + public static PriorityType fromString(String name) { + return fromString(name, PriorityType.class); + } + + /** + * Gets known PriorityType values. + * + * @return known PriorityType values. + */ + public static Collection values() { + return values(PriorityType.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ProtocolTypes.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ProtocolTypes.java new file mode 100644 index 000000000000..d6204a82871b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ProtocolTypes.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the protocol of WinRM listener. Possible values are: **http,** **https.**. + */ +public final class ProtocolTypes extends ExpandableStringEnum { + /** + * Http protocol. + */ + public static final ProtocolTypes HTTP = fromString("Http"); + + /** + * Https protocol. + */ + public static final ProtocolTypes HTTPS = fromString("Https"); + + /** + * Creates a new instance of ProtocolTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProtocolTypes() { + } + + /** + * Creates or finds a ProtocolTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProtocolTypes. + */ + public static ProtocolTypes fromString(String name) { + return fromString(name, ProtocolTypes.class); + } + + /** + * Gets known ProtocolTypes values. + * + * @return known ProtocolTypes values. + */ + public static Collection values() { + return values(ProtocolTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ProvisioningState.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ProvisioningState.java new file mode 100644 index 000000000000..c5069abd362d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ProvisioningState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of the LaunchBulkInstancesOperation. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Initial creation in progress. + */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** + * The operation has completed successfully. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * The operation has failed. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Deletion in progress. + */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** + * The operation has been canceled. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ProxyAgentSettings.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ProxyAgentSettings.java new file mode 100644 index 000000000000..f5fea146f4f6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ProxyAgentSettings.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies ProxyAgent settings for the virtual machine or virtual machine scale set. Minimum api-version: 2023-09-01. + */ +@Fluent +public final class ProxyAgentSettings implements JsonSerializable { + /* + * Specifies whether ProxyAgent feature should be enabled on the virtual machine or virtual machine scale set. + */ + private Boolean enabled; + + /* + * Specifies the mode that ProxyAgent will execute on. Warning: this property has been deprecated, please specify + * 'mode' under particular hostendpoint setting. + */ + private Mode mode; + + /* + * Increase the value of this property allows users to reset the key used for securing communication channel between + * guest and host. + */ + private Integer keyIncarnationId; + + /* + * Specifies the Wire Server endpoint settings while creating the virtual machine or virtual machine scale set. + * Minimum api-version: 2024-03-01. + */ + private HostEndpointSettings wireServer; + + /* + * Specifies the IMDS endpoint settings while creating the virtual machine or virtual machine scale set. Minimum + * api-version: 2024-03-01. + */ + private HostEndpointSettings imds; + + /* + * Specify whether to implicitly install the ProxyAgent Extension. This option is currently applicable only for + * Linux Os. + */ + private Boolean addProxyAgentExtension; + + /** + * Creates an instance of ProxyAgentSettings class. + */ + public ProxyAgentSettings() { + } + + /** + * Get the enabled property: Specifies whether ProxyAgent feature should be enabled on the virtual machine or + * virtual machine scale set. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Specifies whether ProxyAgent feature should be enabled on the virtual machine or + * virtual machine scale set. + * + * @param enabled the enabled value to set. + * @return the ProxyAgentSettings object itself. + */ + public ProxyAgentSettings withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the mode property: Specifies the mode that ProxyAgent will execute on. Warning: this property has been + * deprecated, please specify 'mode' under particular hostendpoint setting. + * + * @return the mode value. + */ + public Mode mode() { + return this.mode; + } + + /** + * Set the mode property: Specifies the mode that ProxyAgent will execute on. Warning: this property has been + * deprecated, please specify 'mode' under particular hostendpoint setting. + * + * @param mode the mode value to set. + * @return the ProxyAgentSettings object itself. + */ + public ProxyAgentSettings withMode(Mode mode) { + this.mode = mode; + return this; + } + + /** + * Get the keyIncarnationId property: Increase the value of this property allows users to reset the key used for + * securing communication channel between guest and host. + * + * @return the keyIncarnationId value. + */ + public Integer keyIncarnationId() { + return this.keyIncarnationId; + } + + /** + * Set the keyIncarnationId property: Increase the value of this property allows users to reset the key used for + * securing communication channel between guest and host. + * + * @param keyIncarnationId the keyIncarnationId value to set. + * @return the ProxyAgentSettings object itself. + */ + public ProxyAgentSettings withKeyIncarnationId(Integer keyIncarnationId) { + this.keyIncarnationId = keyIncarnationId; + return this; + } + + /** + * Get the wireServer property: Specifies the Wire Server endpoint settings while creating the virtual machine or + * virtual machine scale set. Minimum api-version: 2024-03-01. + * + * @return the wireServer value. + */ + public HostEndpointSettings wireServer() { + return this.wireServer; + } + + /** + * Set the wireServer property: Specifies the Wire Server endpoint settings while creating the virtual machine or + * virtual machine scale set. Minimum api-version: 2024-03-01. + * + * @param wireServer the wireServer value to set. + * @return the ProxyAgentSettings object itself. + */ + public ProxyAgentSettings withWireServer(HostEndpointSettings wireServer) { + this.wireServer = wireServer; + return this; + } + + /** + * Get the imds property: Specifies the IMDS endpoint settings while creating the virtual machine or virtual machine + * scale set. Minimum api-version: 2024-03-01. + * + * @return the imds value. + */ + public HostEndpointSettings imds() { + return this.imds; + } + + /** + * Set the imds property: Specifies the IMDS endpoint settings while creating the virtual machine or virtual machine + * scale set. Minimum api-version: 2024-03-01. + * + * @param imds the imds value to set. + * @return the ProxyAgentSettings object itself. + */ + public ProxyAgentSettings withImds(HostEndpointSettings imds) { + this.imds = imds; + return this; + } + + /** + * Get the addProxyAgentExtension property: Specify whether to implicitly install the ProxyAgent Extension. This + * option is currently applicable only for Linux Os. + * + * @return the addProxyAgentExtension value. + */ + public Boolean addProxyAgentExtension() { + return this.addProxyAgentExtension; + } + + /** + * Set the addProxyAgentExtension property: Specify whether to implicitly install the ProxyAgent Extension. This + * option is currently applicable only for Linux Os. + * + * @param addProxyAgentExtension the addProxyAgentExtension value to set. + * @return the ProxyAgentSettings object itself. + */ + public ProxyAgentSettings withAddProxyAgentExtension(Boolean addProxyAgentExtension) { + this.addProxyAgentExtension = addProxyAgentExtension; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeNumberField("keyIncarnationId", this.keyIncarnationId); + jsonWriter.writeJsonField("wireServer", this.wireServer); + jsonWriter.writeJsonField("imds", this.imds); + jsonWriter.writeBooleanField("addProxyAgentExtension", this.addProxyAgentExtension); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProxyAgentSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProxyAgentSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProxyAgentSettings. + */ + public static ProxyAgentSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProxyAgentSettings deserializedProxyAgentSettings = new ProxyAgentSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedProxyAgentSettings.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("mode".equals(fieldName)) { + deserializedProxyAgentSettings.mode = Mode.fromString(reader.getString()); + } else if ("keyIncarnationId".equals(fieldName)) { + deserializedProxyAgentSettings.keyIncarnationId = reader.getNullable(JsonReader::getInt); + } else if ("wireServer".equals(fieldName)) { + deserializedProxyAgentSettings.wireServer = HostEndpointSettings.fromJson(reader); + } else if ("imds".equals(fieldName)) { + deserializedProxyAgentSettings.imds = HostEndpointSettings.fromJson(reader); + } else if ("addProxyAgentExtension".equals(fieldName)) { + deserializedProxyAgentSettings.addProxyAgentExtension = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedProxyAgentSettings; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PublicIPAddressSku.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PublicIPAddressSku.java new file mode 100644 index 000000000000..6495003f35bf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PublicIPAddressSku.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. + */ +@Fluent +public final class PublicIPAddressSku implements JsonSerializable { + /* + * Specify public IP sku name + */ + private PublicIPAddressSkuName name; + + /* + * Specify public IP sku 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublicIPAddressSku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublicIPAddressSku if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PublicIPAddressSku. + */ + public static PublicIPAddressSku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublicIPAddressSku deserializedPublicIPAddressSku = new PublicIPAddressSku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPublicIPAddressSku.name = PublicIPAddressSkuName.fromString(reader.getString()); + } else if ("tier".equals(fieldName)) { + deserializedPublicIPAddressSku.tier = PublicIPAddressSkuTier.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPublicIPAddressSku; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PublicIPAddressSkuName.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PublicIPAddressSkuName.java new file mode 100644 index 000000000000..97dd4d18ec68 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PublicIPAddressSkuName.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specify public IP sku name. + */ +public final class PublicIPAddressSkuName extends ExpandableStringEnum { + /** + * Basic IP sku name. + */ + public static final PublicIPAddressSkuName BASIC = fromString("Basic"); + + /** + * Standard IP sku name. + */ + 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PublicIPAddressSkuTier.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PublicIPAddressSkuTier.java new file mode 100644 index 000000000000..421ca9f9d8c8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PublicIPAddressSkuTier.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specify public IP sku tier. + */ +public final class PublicIPAddressSkuTier extends ExpandableStringEnum { + /** + * Regional IP address sku tier. + */ + public static final PublicIPAddressSkuTier REGIONAL = fromString("Regional"); + + /** + * Global IP address sku tier. + */ + 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PublicIPAllocationMethod.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PublicIPAllocationMethod.java new file mode 100644 index 000000000000..b996bbd319e9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PublicIPAllocationMethod.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specify the public IP allocation type. + */ +public final class PublicIPAllocationMethod extends ExpandableStringEnum { + /** + * Dynamic IP allocation. + */ + public static final PublicIPAllocationMethod DYNAMIC = fromString("Dynamic"); + + /** + * Static IP allocation. + */ + 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ReimagePayload.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ReimagePayload.java new file mode 100644 index 000000000000..8c63795dfef9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ReimagePayload.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Reimage payload with common profile and per-resource overrides. + */ +@Fluent +public final class ReimagePayload implements JsonSerializable { + /* + * Common reimage profile applied to all resources unless overridden + */ + private VirtualMachineReimageParameters baseProfile; + + /* + * Per-resource reimage overrides + */ + private List resourceOverrides; + + /** + * Creates an instance of ReimagePayload class. + */ + public ReimagePayload() { + } + + /** + * Get the baseProfile property: Common reimage profile applied to all resources unless overridden. + * + * @return the baseProfile value. + */ + public VirtualMachineReimageParameters baseProfile() { + return this.baseProfile; + } + + /** + * Set the baseProfile property: Common reimage profile applied to all resources unless overridden. + * + * @param baseProfile the baseProfile value to set. + * @return the ReimagePayload object itself. + */ + public ReimagePayload withBaseProfile(VirtualMachineReimageParameters baseProfile) { + this.baseProfile = baseProfile; + return this; + } + + /** + * Get the resourceOverrides property: Per-resource reimage overrides. + * + * @return the resourceOverrides value. + */ + public List resourceOverrides() { + return this.resourceOverrides; + } + + /** + * Set the resourceOverrides property: Per-resource reimage overrides. + * + * @param resourceOverrides the resourceOverrides value to set. + * @return the ReimagePayload object itself. + */ + public ReimagePayload withResourceOverrides(List resourceOverrides) { + this.resourceOverrides = resourceOverrides; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("baseProfile", this.baseProfile); + jsonWriter.writeArrayField("resourceOverrides", this.resourceOverrides, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReimagePayload from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReimagePayload if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ReimagePayload. + */ + public static ReimagePayload fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReimagePayload deserializedReimagePayload = new ReimagePayload(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("baseProfile".equals(fieldName)) { + deserializedReimagePayload.baseProfile = VirtualMachineReimageParameters.fromJson(reader); + } else if ("resourceOverrides".equals(fieldName)) { + List resourceOverrides + = reader.readArray(reader1 -> ReimageResourceOverride.fromJson(reader1)); + deserializedReimagePayload.resourceOverrides = resourceOverrides; + } else { + reader.skipChildren(); + } + } + + return deserializedReimagePayload; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ReimageResourceOperationResponse.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ReimageResourceOperationResponse.java new file mode 100644 index 000000000000..fa904cf06303 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ReimageResourceOperationResponse.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.resourcemanager.compute.bulkactions.fluent.models.ReimageResourceOperationResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of ReimageResourceOperationResponse. + */ +public interface ReimageResourceOperationResponse { + /** + * Gets the description property: The description of the operation response. + * + * @return the description value. + */ + String description(); + + /** + * Gets the type property: The type of resources used in the reimage request eg virtual machines. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The location of the reimage request eg westus. + * + * @return the location value. + */ + String location(); + + /** + * Gets the results property: The results from the reimage request if no errors exist. + * + * @return the results value. + */ + List results(); + + /** + * Gets the inner com.azure.resourcemanager.compute.bulkactions.fluent.models.ReimageResourceOperationResponseInner + * object. + * + * @return the inner object. + */ + ReimageResourceOperationResponseInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ReimageResourceOverride.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ReimageResourceOverride.java new file mode 100644 index 000000000000..41b0ecbf8caa --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ReimageResourceOverride.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Per-resource override entry for reimage requests. + */ +@Fluent +public final class ReimageResourceOverride implements JsonSerializable { + /* + * The Azure resource ID of the virtual machine for this override + */ + private String resourceId; + + /* + * Per-resource reimage profile override + */ + private VirtualMachineReimageParameters profile; + + /** + * Creates an instance of ReimageResourceOverride class. + */ + public ReimageResourceOverride() { + } + + /** + * Get the resourceId property: The Azure resource ID of the virtual machine for this override. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The Azure resource ID of the virtual machine for this override. + * + * @param resourceId the resourceId value to set. + * @return the ReimageResourceOverride object itself. + */ + public ReimageResourceOverride withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the profile property: Per-resource reimage profile override. + * + * @return the profile value. + */ + public VirtualMachineReimageParameters profile() { + return this.profile; + } + + /** + * Set the profile property: Per-resource reimage profile override. + * + * @param profile the profile value to set. + * @return the ReimageResourceOverride object itself. + */ + public ReimageResourceOverride withProfile(VirtualMachineReimageParameters profile) { + this.profile = profile; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeJsonField("profile", this.profile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReimageResourceOverride from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReimageResourceOverride if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ReimageResourceOverride. + */ + public static ReimageResourceOverride fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReimageResourceOverride deserializedReimageResourceOverride = new ReimageResourceOverride(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedReimageResourceOverride.resourceId = reader.getString(); + } else if ("profile".equals(fieldName)) { + deserializedReimageResourceOverride.profile = VirtualMachineReimageParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedReimageResourceOverride; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceNotificationDetails.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceNotificationDetails.java new file mode 100644 index 000000000000..8db13580acfa --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceNotificationDetails.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Resource notification details containing notification metadata like the resource context. + */ +@Immutable +public final class ResourceNotificationDetails implements JsonSerializable { + /* + * Resource context for notification tracking + */ + private String resourceContext; + + /** + * Creates an instance of ResourceNotificationDetails class. + */ + private ResourceNotificationDetails() { + } + + /** + * Get the resourceContext property: Resource context for notification tracking. + * + * @return the resourceContext value. + */ + public String resourceContext() { + return this.resourceContext; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceContext", this.resourceContext); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceNotificationDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceNotificationDetails if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceNotificationDetails. + */ + public static ResourceNotificationDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceNotificationDetails deserializedResourceNotificationDetails = new ResourceNotificationDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceContext".equals(fieldName)) { + deserializedResourceNotificationDetails.resourceContext = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceNotificationDetails; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceOperation.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceOperation.java index e6690a195587..0b810ca9d036 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceOperation.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceOperation.java @@ -4,123 +4,52 @@ package com.azure.resourcemanager.compute.bulkactions.models; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.ResourceOperationInner; /** - * High level response from an operation on a resource. + * An immutable client-side representation of ResourceOperation. */ -@Immutable -public final class ResourceOperation implements JsonSerializable { - /* - * Unique identifier for the resource involved in the operation, for example Azure resource ID - */ - private String resourceId; - - /* - * Resource level error code if it exists - */ - private String errorCode; - - /* - * Resource level error details if they exist - */ - private String errorDetails; - - /* - * Details of the operation performed on a resource - */ - private ResourceOperationDetails operation; - - /** - * Creates an instance of ResourceOperation class. - */ - private ResourceOperation() { - } - +public interface ResourceOperation { /** - * Get the resourceId property: Unique identifier for the resource involved in the operation, for example Azure + * Gets the resourceId property: Unique identifier for the resource involved in the operation, for example Azure * resource ID. * * @return the resourceId value. */ - public String resourceId() { - return this.resourceId; - } + String resourceId(); /** - * Get the errorCode property: Resource level error code if it exists. + * Gets the errorCode property: Resource level error code if it exists. * * @return the errorCode value. */ - public String errorCode() { - return this.errorCode; - } + String errorCode(); /** - * Get the errorDetails property: Resource level error details if they exist. + * Gets the errorDetails property: Resource level error details if they exist. * * @return the errorDetails value. */ - public String errorDetails() { - return this.errorDetails; - } + String errorDetails(); /** - * Get the operation property: Details of the operation performed on a resource. + * Gets the operation property: Details of the operation performed on a resource. * * @return the operation value. */ - public ResourceOperationDetails operation() { - return this.operation; - } + ResourceOperationDetails operation(); /** - * {@inheritDoc} + * Gets the virtualMachineInfo property: Information about the virtual machine. + * + * @return the virtualMachineInfo value. */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resourceId", this.resourceId); - jsonWriter.writeStringField("errorCode", this.errorCode); - jsonWriter.writeStringField("errorDetails", this.errorDetails); - jsonWriter.writeJsonField("operation", this.operation); - return jsonWriter.writeEndObject(); - } + VirtualMachineInfo virtualMachineInfo(); /** - * Reads an instance of ResourceOperation from the JsonReader. + * Gets the inner com.azure.resourcemanager.compute.bulkactions.fluent.models.ResourceOperationInner object. * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceOperation if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the ResourceOperation. + * @return the inner object. */ - public static ResourceOperation fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceOperation deserializedResourceOperation = new ResourceOperation(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceId".equals(fieldName)) { - deserializedResourceOperation.resourceId = reader.getString(); - } else if ("errorCode".equals(fieldName)) { - deserializedResourceOperation.errorCode = reader.getString(); - } else if ("errorDetails".equals(fieldName)) { - deserializedResourceOperation.errorDetails = reader.getString(); - } else if ("operation".equals(fieldName)) { - deserializedResourceOperation.operation = ResourceOperationDetails.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedResourceOperation; - }); - } + ResourceOperationInner innerModel(); } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceOperationDetails.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceOperationDetails.java index 6de8e2d66126..49bbc9b5bf5a 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceOperationDetails.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceOperationDetails.java @@ -79,6 +79,11 @@ public final class ResourceOperationDetails implements JsonSerializable CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("retryPolicy".equals(fieldName)) { deserializedResourceOperationDetails.retryPolicy = RetryPolicy.fromJson(reader); + } else if ("resourceNotificationDetails".equals(fieldName)) { + deserializedResourceOperationDetails.resourceNotificationDetails + = ResourceNotificationDetails.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceOperationType.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceOperationType.java index 4b96b710dec5..ae32af2d05ab 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceOperationType.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceOperationType.java @@ -41,6 +41,12 @@ public final class ResourceOperationType extends ExpandableStringEnum { + /* + * Bulk Actions Virtual Machine Profile object that contains VM properties that are common across all VMs in this + * batch + */ + private Map baseProfile; + + /* + * Bulk Actions Virtual Machine Profile array, that contains VM properties that should be overridden for each VM in + * the batch + */ + private List> resourceOverrides; + + /* + * Number of VMs to be created + */ + private int resourceCount; + + /* + * If resourceOverrides doesn't contain "name", the service will create a name based on the prefix and + * ResourceCount, e.g., resourceprefix-0, resourceprefix-1.. + */ + private String resourcePrefix; + + /** + * Creates an instance of ResourceProvisionPayload class. + */ + public ResourceProvisionPayload() { + } + + /** + * Get the baseProfile property: Bulk Actions Virtual Machine Profile object that contains VM properties that are + * common across all VMs in this batch. + * + * @return the baseProfile value. + */ + public Map baseProfile() { + return this.baseProfile; + } + + /** + * Set the baseProfile property: Bulk Actions Virtual Machine Profile object that contains VM properties that are + * common across all VMs in this batch. + * + * @param baseProfile the baseProfile value to set. + * @return the ResourceProvisionPayload object itself. + */ + public ResourceProvisionPayload withBaseProfile(Map baseProfile) { + this.baseProfile = baseProfile; + return this; + } + + /** + * Get the resourceOverrides property: Bulk Actions Virtual Machine Profile array, that contains VM properties that + * should be overridden for each VM in the batch. + * + * @return the resourceOverrides value. + */ + public List> resourceOverrides() { + return this.resourceOverrides; + } + + /** + * Set the resourceOverrides property: Bulk Actions Virtual Machine Profile array, that contains VM properties that + * should be overridden for each VM in the batch. + * + * @param resourceOverrides the resourceOverrides value to set. + * @return the ResourceProvisionPayload object itself. + */ + public ResourceProvisionPayload withResourceOverrides(List> resourceOverrides) { + this.resourceOverrides = resourceOverrides; + return this; + } + + /** + * Get the resourceCount property: Number of VMs to be created. + * + * @return the resourceCount value. + */ + public int resourceCount() { + return this.resourceCount; + } + + /** + * Set the resourceCount property: Number of VMs to be created. + * + * @param resourceCount the resourceCount value to set. + * @return the ResourceProvisionPayload object itself. + */ + public ResourceProvisionPayload withResourceCount(int resourceCount) { + this.resourceCount = resourceCount; + return this; + } + + /** + * Get the resourcePrefix property: If resourceOverrides doesn't contain "name", the service will create a name + * based on the prefix and ResourceCount, e.g., resourceprefix-0, resourceprefix-1.. + * + * @return the resourcePrefix value. + */ + public String resourcePrefix() { + return this.resourcePrefix; + } + + /** + * Set the resourcePrefix property: If resourceOverrides doesn't contain "name", the service will create a name + * based on the prefix and ResourceCount, e.g., resourceprefix-0, resourceprefix-1.. + * + * @param resourcePrefix the resourcePrefix value to set. + * @return the ResourceProvisionPayload object itself. + */ + public ResourceProvisionPayload withResourcePrefix(String resourcePrefix) { + this.resourcePrefix = resourcePrefix; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("resourceCount", this.resourceCount); + jsonWriter.writeMapField("baseProfile", this.baseProfile, (writer, element) -> { + if (element == null) { + writer.writeNull(); + } else { + element.writeTo(writer); + } + }); + jsonWriter.writeArrayField("resourceOverrides", this.resourceOverrides, + (writer, element) -> writer.writeMap(element, (writer1, element1) -> { + if (element1 == null) { + writer1.writeNull(); + } else { + element1.writeTo(writer1); + } + })); + jsonWriter.writeStringField("resourcePrefix", this.resourcePrefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceProvisionPayload from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceProvisionPayload if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceProvisionPayload. + */ + public static ResourceProvisionPayload fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceProvisionPayload deserializedResourceProvisionPayload = new ResourceProvisionPayload(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceCount".equals(fieldName)) { + deserializedResourceProvisionPayload.resourceCount = reader.getInt(); + } else if ("baseProfile".equals(fieldName)) { + Map baseProfile = reader.readMap(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + deserializedResourceProvisionPayload.baseProfile = baseProfile; + } else if ("resourceOverrides".equals(fieldName)) { + List> resourceOverrides + = reader.readArray(reader1 -> reader1.readMap(reader2 -> reader2 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())))); + deserializedResourceProvisionPayload.resourceOverrides = resourceOverrides; + } else if ("resourcePrefix".equals(fieldName)) { + deserializedResourceProvisionPayload.resourcePrefix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceProvisionPayload; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceProvisionVdiPayload.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceProvisionVdiPayload.java new file mode 100644 index 000000000000..7eb29ae9d4a9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceProvisionVdiPayload.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Resource creation data model with Flex properties for VDI scenarios. + */ +@Fluent +public final class ResourceProvisionVdiPayload implements JsonSerializable { + /* + * Bulk Actions Virtual Machine Profile object that contains VM properties that are common across all VMs in this + * batch + */ + private Map baseProfile; + + /* + * Bulk Actions Virtual Machine Profile array, that contains VM properties that should be overridden for each VM in + * the batch + */ + private List> resourceOverrides; + + /* + * Number of VMs to be created + */ + private int resourceCount; + + /* + * If resourceOverrides doesn't contain "name", the service will create a name based on the prefix and + * ResourceCount, e.g., resourceprefix-0, resourceprefix-1.. + */ + private String resourcePrefix; + + /* + * Flex properties used for VDI resource creation scenarios + */ + private FlexProperties flexProperties; + + /** + * Creates an instance of ResourceProvisionVdiPayload class. + */ + public ResourceProvisionVdiPayload() { + } + + /** + * Get the baseProfile property: Bulk Actions Virtual Machine Profile object that contains VM properties that are + * common across all VMs in this batch. + * + * @return the baseProfile value. + */ + public Map baseProfile() { + return this.baseProfile; + } + + /** + * Set the baseProfile property: Bulk Actions Virtual Machine Profile object that contains VM properties that are + * common across all VMs in this batch. + * + * @param baseProfile the baseProfile value to set. + * @return the ResourceProvisionVdiPayload object itself. + */ + public ResourceProvisionVdiPayload withBaseProfile(Map baseProfile) { + this.baseProfile = baseProfile; + return this; + } + + /** + * Get the resourceOverrides property: Bulk Actions Virtual Machine Profile array, that contains VM properties that + * should be overridden for each VM in the batch. + * + * @return the resourceOverrides value. + */ + public List> resourceOverrides() { + return this.resourceOverrides; + } + + /** + * Set the resourceOverrides property: Bulk Actions Virtual Machine Profile array, that contains VM properties that + * should be overridden for each VM in the batch. + * + * @param resourceOverrides the resourceOverrides value to set. + * @return the ResourceProvisionVdiPayload object itself. + */ + public ResourceProvisionVdiPayload withResourceOverrides(List> resourceOverrides) { + this.resourceOverrides = resourceOverrides; + return this; + } + + /** + * Get the resourceCount property: Number of VMs to be created. + * + * @return the resourceCount value. + */ + public int resourceCount() { + return this.resourceCount; + } + + /** + * Set the resourceCount property: Number of VMs to be created. + * + * @param resourceCount the resourceCount value to set. + * @return the ResourceProvisionVdiPayload object itself. + */ + public ResourceProvisionVdiPayload withResourceCount(int resourceCount) { + this.resourceCount = resourceCount; + return this; + } + + /** + * Get the resourcePrefix property: If resourceOverrides doesn't contain "name", the service will create a name + * based on the prefix and ResourceCount, e.g., resourceprefix-0, resourceprefix-1.. + * + * @return the resourcePrefix value. + */ + public String resourcePrefix() { + return this.resourcePrefix; + } + + /** + * Set the resourcePrefix property: If resourceOverrides doesn't contain "name", the service will create a name + * based on the prefix and ResourceCount, e.g., resourceprefix-0, resourceprefix-1.. + * + * @param resourcePrefix the resourcePrefix value to set. + * @return the ResourceProvisionVdiPayload object itself. + */ + public ResourceProvisionVdiPayload withResourcePrefix(String resourcePrefix) { + this.resourcePrefix = resourcePrefix; + return this; + } + + /** + * Get the flexProperties property: Flex properties used for VDI resource creation scenarios. + * + * @return the flexProperties value. + */ + public FlexProperties flexProperties() { + return this.flexProperties; + } + + /** + * Set the flexProperties property: Flex properties used for VDI resource creation scenarios. + * + * @param flexProperties the flexProperties value to set. + * @return the ResourceProvisionVdiPayload object itself. + */ + public ResourceProvisionVdiPayload withFlexProperties(FlexProperties flexProperties) { + this.flexProperties = flexProperties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("resourceCount", this.resourceCount); + jsonWriter.writeJsonField("flexProperties", this.flexProperties); + jsonWriter.writeMapField("baseProfile", this.baseProfile, (writer, element) -> { + if (element == null) { + writer.writeNull(); + } else { + element.writeTo(writer); + } + }); + jsonWriter.writeArrayField("resourceOverrides", this.resourceOverrides, + (writer, element) -> writer.writeMap(element, (writer1, element1) -> { + if (element1 == null) { + writer1.writeNull(); + } else { + element1.writeTo(writer1); + } + })); + jsonWriter.writeStringField("resourcePrefix", this.resourcePrefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceProvisionVdiPayload from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceProvisionVdiPayload if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceProvisionVdiPayload. + */ + public static ResourceProvisionVdiPayload fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceProvisionVdiPayload deserializedResourceProvisionVdiPayload = new ResourceProvisionVdiPayload(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceCount".equals(fieldName)) { + deserializedResourceProvisionVdiPayload.resourceCount = reader.getInt(); + } else if ("flexProperties".equals(fieldName)) { + deserializedResourceProvisionVdiPayload.flexProperties = FlexProperties.fromJson(reader); + } else if ("baseProfile".equals(fieldName)) { + Map baseProfile = reader.readMap(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + deserializedResourceProvisionVdiPayload.baseProfile = baseProfile; + } else if ("resourceOverrides".equals(fieldName)) { + List> resourceOverrides + = reader.readArray(reader1 -> reader1.readMap(reader2 -> reader2 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())))); + deserializedResourceProvisionVdiPayload.resourceOverrides = resourceOverrides; + } else if ("resourcePrefix".equals(fieldName)) { + deserializedResourceProvisionVdiPayload.resourcePrefix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceProvisionVdiPayload; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceWithContext.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceWithContext.java new file mode 100644 index 000000000000..05b85d1755fd --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceWithContext.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The resources needed for the user request with the resourceContext. + */ +@Fluent +public final class ResourceWithContext implements JsonSerializable { + /* + * The resource ids used for the request + */ + private String resourceId; + + /* + * The operational context of the resourceId + */ + private String resourceContext; + + /** + * Creates an instance of ResourceWithContext class. + */ + public ResourceWithContext() { + } + + /** + * Get the resourceId property: The resource ids used for the request. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource ids used for the request. + * + * @param resourceId the resourceId value to set. + * @return the ResourceWithContext object itself. + */ + public ResourceWithContext withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the resourceContext property: The operational context of the resourceId. + * + * @return the resourceContext value. + */ + public String resourceContext() { + return this.resourceContext; + } + + /** + * Set the resourceContext property: The operational context of the resourceId. + * + * @param resourceContext the resourceContext value to set. + * @return the ResourceWithContext object itself. + */ + public ResourceWithContext withResourceContext(String resourceContext) { + this.resourceContext = resourceContext; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("resourceContext", this.resourceContext); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceWithContext from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceWithContext if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceWithContext. + */ + public static ResourceWithContext fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceWithContext deserializedResourceWithContext = new ResourceWithContext(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedResourceWithContext.resourceId = reader.getString(); + } else if ("resourceContext".equals(fieldName)) { + deserializedResourceWithContext.resourceContext = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceWithContext; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourcesWithContext.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourcesWithContext.java new file mode 100644 index 000000000000..dada23e3db46 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourcesWithContext.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The resources needed for the user request with the context for tracking purposes. + */ +@Fluent +public final class ResourcesWithContext implements JsonSerializable { + /* + * The resource ids used for the request + */ + private List resources; + + /** + * Creates an instance of ResourcesWithContext class. + */ + public ResourcesWithContext() { + } + + /** + * Get the resources property: The resource ids used for the request. + * + * @return the resources value. + */ + public List resources() { + return this.resources; + } + + /** + * Set the resources property: The resource ids used for the request. + * + * @param resources the resources value to set. + * @return the ResourcesWithContext object itself. + */ + public ResourcesWithContext withResources(List resources) { + this.resources = resources; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("resources", this.resources, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourcesWithContext from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourcesWithContext if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourcesWithContext. + */ + public static ResourcesWithContext fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourcesWithContext deserializedResourcesWithContext = new ResourcesWithContext(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resources".equals(fieldName)) { + List resources + = reader.readArray(reader1 -> ResourceWithContext.fromJson(reader1)); + deserializedResourcesWithContext.resources = resources; + } else { + reader.skipChildren(); + } + } + + return deserializedResourcesWithContext; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ScheduledEventsAdditionalPublishingTargets.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ScheduledEventsAdditionalPublishingTargets.java new file mode 100644 index 000000000000..c2545ecc8421 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ScheduledEventsAdditionalPublishingTargets.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies additional publishing targets for scheduled events. + */ +@Fluent +public final class ScheduledEventsAdditionalPublishingTargets + implements JsonSerializable { + /* + * The configuration parameters used while creating eventGridAndResourceGraph Scheduled Event setting. + */ + private EventGridAndResourceGraph eventGridAndResourceGraph; + + /** + * Creates an instance of ScheduledEventsAdditionalPublishingTargets class. + */ + public ScheduledEventsAdditionalPublishingTargets() { + } + + /** + * Get the eventGridAndResourceGraph property: The configuration parameters used while creating + * eventGridAndResourceGraph Scheduled Event setting. + * + * @return the eventGridAndResourceGraph value. + */ + public EventGridAndResourceGraph eventGridAndResourceGraph() { + return this.eventGridAndResourceGraph; + } + + /** + * Set the eventGridAndResourceGraph property: The configuration parameters used while creating + * eventGridAndResourceGraph Scheduled Event setting. + * + * @param eventGridAndResourceGraph the eventGridAndResourceGraph value to set. + * @return the ScheduledEventsAdditionalPublishingTargets object itself. + */ + public ScheduledEventsAdditionalPublishingTargets + withEventGridAndResourceGraph(EventGridAndResourceGraph eventGridAndResourceGraph) { + this.eventGridAndResourceGraph = eventGridAndResourceGraph; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("eventGridAndResourceGraph", this.eventGridAndResourceGraph); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScheduledEventsAdditionalPublishingTargets from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScheduledEventsAdditionalPublishingTargets if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ScheduledEventsAdditionalPublishingTargets. + */ + public static ScheduledEventsAdditionalPublishingTargets fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScheduledEventsAdditionalPublishingTargets deserializedScheduledEventsAdditionalPublishingTargets + = new ScheduledEventsAdditionalPublishingTargets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("eventGridAndResourceGraph".equals(fieldName)) { + deserializedScheduledEventsAdditionalPublishingTargets.eventGridAndResourceGraph + = EventGridAndResourceGraph.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedScheduledEventsAdditionalPublishingTargets; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ScheduledEventsPolicy.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ScheduledEventsPolicy.java new file mode 100644 index 000000000000..9b94b147f582 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ScheduledEventsPolicy.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations. + */ +@Fluent +public final class ScheduledEventsPolicy implements JsonSerializable { + /* + * The configuration parameters used while creating userInitiatedRedeploy scheduled event setting creation. + */ + private UserInitiatedRedeploy userInitiatedRedeploy; + + /* + * The configuration parameters used while creating userInitiatedReboot scheduled event setting creation. + */ + private UserInitiatedReboot userInitiatedReboot; + + /* + * The configuration parameters used while publishing scheduledEventsAdditionalPublishingTargets. + */ + private ScheduledEventsAdditionalPublishingTargets scheduledEventsAdditionalPublishingTargets; + + /* + * The configuration parameters used while creating AllInstancesDown scheduled event setting creation. + */ + private AllInstancesDown allInstancesDown; + + /** + * Creates an instance of ScheduledEventsPolicy class. + */ + public ScheduledEventsPolicy() { + } + + /** + * Get the userInitiatedRedeploy property: The configuration parameters used while creating userInitiatedRedeploy + * scheduled event setting creation. + * + * @return the userInitiatedRedeploy value. + */ + public UserInitiatedRedeploy userInitiatedRedeploy() { + return this.userInitiatedRedeploy; + } + + /** + * Set the userInitiatedRedeploy property: The configuration parameters used while creating userInitiatedRedeploy + * scheduled event setting creation. + * + * @param userInitiatedRedeploy the userInitiatedRedeploy value to set. + * @return the ScheduledEventsPolicy object itself. + */ + public ScheduledEventsPolicy withUserInitiatedRedeploy(UserInitiatedRedeploy userInitiatedRedeploy) { + this.userInitiatedRedeploy = userInitiatedRedeploy; + return this; + } + + /** + * Get the userInitiatedReboot property: The configuration parameters used while creating userInitiatedReboot + * scheduled event setting creation. + * + * @return the userInitiatedReboot value. + */ + public UserInitiatedReboot userInitiatedReboot() { + return this.userInitiatedReboot; + } + + /** + * Set the userInitiatedReboot property: The configuration parameters used while creating userInitiatedReboot + * scheduled event setting creation. + * + * @param userInitiatedReboot the userInitiatedReboot value to set. + * @return the ScheduledEventsPolicy object itself. + */ + public ScheduledEventsPolicy withUserInitiatedReboot(UserInitiatedReboot userInitiatedReboot) { + this.userInitiatedReboot = userInitiatedReboot; + return this; + } + + /** + * Get the scheduledEventsAdditionalPublishingTargets property: The configuration parameters used while publishing + * scheduledEventsAdditionalPublishingTargets. + * + * @return the scheduledEventsAdditionalPublishingTargets value. + */ + public ScheduledEventsAdditionalPublishingTargets scheduledEventsAdditionalPublishingTargets() { + return this.scheduledEventsAdditionalPublishingTargets; + } + + /** + * Set the scheduledEventsAdditionalPublishingTargets property: The configuration parameters used while publishing + * scheduledEventsAdditionalPublishingTargets. + * + * @param scheduledEventsAdditionalPublishingTargets the scheduledEventsAdditionalPublishingTargets value to set. + * @return the ScheduledEventsPolicy object itself. + */ + public ScheduledEventsPolicy withScheduledEventsAdditionalPublishingTargets( + ScheduledEventsAdditionalPublishingTargets scheduledEventsAdditionalPublishingTargets) { + this.scheduledEventsAdditionalPublishingTargets = scheduledEventsAdditionalPublishingTargets; + return this; + } + + /** + * Get the allInstancesDown property: The configuration parameters used while creating AllInstancesDown scheduled + * event setting creation. + * + * @return the allInstancesDown value. + */ + public AllInstancesDown allInstancesDown() { + return this.allInstancesDown; + } + + /** + * Set the allInstancesDown property: The configuration parameters used while creating AllInstancesDown scheduled + * event setting creation. + * + * @param allInstancesDown the allInstancesDown value to set. + * @return the ScheduledEventsPolicy object itself. + */ + public ScheduledEventsPolicy withAllInstancesDown(AllInstancesDown allInstancesDown) { + this.allInstancesDown = allInstancesDown; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("userInitiatedRedeploy", this.userInitiatedRedeploy); + jsonWriter.writeJsonField("userInitiatedReboot", this.userInitiatedReboot); + jsonWriter.writeJsonField("scheduledEventsAdditionalPublishingTargets", + this.scheduledEventsAdditionalPublishingTargets); + jsonWriter.writeJsonField("allInstancesDown", this.allInstancesDown); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScheduledEventsPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScheduledEventsPolicy if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ScheduledEventsPolicy. + */ + public static ScheduledEventsPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScheduledEventsPolicy deserializedScheduledEventsPolicy = new ScheduledEventsPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userInitiatedRedeploy".equals(fieldName)) { + deserializedScheduledEventsPolicy.userInitiatedRedeploy = UserInitiatedRedeploy.fromJson(reader); + } else if ("userInitiatedReboot".equals(fieldName)) { + deserializedScheduledEventsPolicy.userInitiatedReboot = UserInitiatedReboot.fromJson(reader); + } else if ("scheduledEventsAdditionalPublishingTargets".equals(fieldName)) { + deserializedScheduledEventsPolicy.scheduledEventsAdditionalPublishingTargets + = ScheduledEventsAdditionalPublishingTargets.fromJson(reader); + } else if ("allInstancesDown".equals(fieldName)) { + deserializedScheduledEventsPolicy.allInstancesDown = AllInstancesDown.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedScheduledEventsPolicy; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ScheduledEventsProfile.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ScheduledEventsProfile.java new file mode 100644 index 000000000000..dbb647aed353 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ScheduledEventsProfile.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Profile for the scheduled events. + */ +@Fluent +public final class ScheduledEventsProfile implements JsonSerializable { + /* + * Specifies Terminate Scheduled Event related configurations. + */ + private TerminateNotificationProfile terminateNotificationProfile; + + /* + * Specifies OS Image Scheduled Event related configurations. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("terminateNotificationProfile", this.terminateNotificationProfile); + jsonWriter.writeJsonField("osImageNotificationProfile", this.osImageNotificationProfile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScheduledEventsProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScheduledEventsProfile if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ScheduledEventsProfile. + */ + public static ScheduledEventsProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScheduledEventsProfile deserializedScheduledEventsProfile = new ScheduledEventsProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("terminateNotificationProfile".equals(fieldName)) { + deserializedScheduledEventsProfile.terminateNotificationProfile + = TerminateNotificationProfile.fromJson(reader); + } else if ("osImageNotificationProfile".equals(fieldName)) { + deserializedScheduledEventsProfile.osImageNotificationProfile + = OSImageNotificationProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedScheduledEventsProfile; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SecurityEncryptionTypes.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SecurityEncryptionTypes.java new file mode 100644 index 000000000000..47a6201d7c30 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SecurityEncryptionTypes.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +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, VMGuestStateOnly for encryption of just the VMGuestState blob, and NonPersistedTPM + * for not persisting firmware state in the VMGuestState blob.. **Note:** It can be set for only Confidential VMs. + */ +public final class SecurityEncryptionTypes extends ExpandableStringEnum { + /** + * VMGuestStateOnly encryption. + */ + public static final SecurityEncryptionTypes VMGUEST_STATE_ONLY = fromString("VMGuestStateOnly"); + + /** + * DiskWithVMGuestState encryption. + */ + public static final SecurityEncryptionTypes DISK_WITH_VMGUEST_STATE = fromString("DiskWithVMGuestState"); + + /** + * NonPersistedTPM encryption. + */ + public static final SecurityEncryptionTypes NON_PERSISTED_TPM = fromString("NonPersistedTPM"); + + /** + * 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SecurityProfile.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SecurityProfile.java new file mode 100644 index 000000000000..e7f67b50c4cc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SecurityProfile.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies the Security profile settings for the virtual machine or virtual machine scale set. + */ +@Fluent +public final class SecurityProfile implements JsonSerializable { + /* + * Specifies the security settings like secure boot and vTPM used while creating the virtual machine. Minimum + * compute api-version: 2020-12-01. + */ + 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. + */ + 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. + */ + private SecurityTypes securityType; + + /* + * Specifies the Managed Identity used by ADE to get access token for keyvault operations. + */ + private EncryptionIdentity encryptionIdentity; + + /* + * Specifies ProxyAgent settings while creating the virtual machine. Minimum compute api-version: 2023-09-01. + */ + private ProxyAgentSettings proxyAgentSettings; + + /** + * 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 compute 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 compute 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; + } + + /** + * Get the encryptionIdentity property: Specifies the Managed Identity used by ADE to get access token for keyvault + * operations. + * + * @return the encryptionIdentity value. + */ + public EncryptionIdentity encryptionIdentity() { + return this.encryptionIdentity; + } + + /** + * Set the encryptionIdentity property: Specifies the Managed Identity used by ADE to get access token for keyvault + * operations. + * + * @param encryptionIdentity the encryptionIdentity value to set. + * @return the SecurityProfile object itself. + */ + public SecurityProfile withEncryptionIdentity(EncryptionIdentity encryptionIdentity) { + this.encryptionIdentity = encryptionIdentity; + return this; + } + + /** + * Get the proxyAgentSettings property: Specifies ProxyAgent settings while creating the virtual machine. Minimum + * compute api-version: 2023-09-01. + * + * @return the proxyAgentSettings value. + */ + public ProxyAgentSettings proxyAgentSettings() { + return this.proxyAgentSettings; + } + + /** + * Set the proxyAgentSettings property: Specifies ProxyAgent settings while creating the virtual machine. Minimum + * compute api-version: 2023-09-01. + * + * @param proxyAgentSettings the proxyAgentSettings value to set. + * @return the SecurityProfile object itself. + */ + public SecurityProfile withProxyAgentSettings(ProxyAgentSettings proxyAgentSettings) { + this.proxyAgentSettings = proxyAgentSettings; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("uefiSettings", this.uefiSettings); + jsonWriter.writeBooleanField("encryptionAtHost", this.encryptionAtHost); + jsonWriter.writeStringField("securityType", this.securityType == null ? null : this.securityType.toString()); + jsonWriter.writeJsonField("encryptionIdentity", this.encryptionIdentity); + jsonWriter.writeJsonField("proxyAgentSettings", this.proxyAgentSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityProfile. + */ + public static SecurityProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityProfile deserializedSecurityProfile = new SecurityProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("uefiSettings".equals(fieldName)) { + deserializedSecurityProfile.uefiSettings = UefiSettings.fromJson(reader); + } else if ("encryptionAtHost".equals(fieldName)) { + deserializedSecurityProfile.encryptionAtHost = reader.getNullable(JsonReader::getBoolean); + } else if ("securityType".equals(fieldName)) { + deserializedSecurityProfile.securityType = SecurityTypes.fromString(reader.getString()); + } else if ("encryptionIdentity".equals(fieldName)) { + deserializedSecurityProfile.encryptionIdentity = EncryptionIdentity.fromJson(reader); + } else if ("proxyAgentSettings".equals(fieldName)) { + deserializedSecurityProfile.proxyAgentSettings = ProxyAgentSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityProfile; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SecurityTypes.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SecurityTypes.java new file mode 100644 index 000000000000..7eb5e44ca002 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SecurityTypes.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +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 { + /** + * TrustedLaunch security type. + */ + public static final SecurityTypes TRUSTED_LAUNCH = fromString("TrustedLaunch"); + + /** + * ConfidentialVM security type. + */ + 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SettingNames.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SettingNames.java new file mode 100644 index 000000000000..00098c2625d6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SettingNames.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and + * AutoLogon. + */ +public final class SettingNames extends ExpandableStringEnum { + /** + * AutoLogon mode. + */ + public static final SettingNames AUTO_LOGON = fromString("AutoLogon"); + + /** + * FirstLogonCommands mode. + */ + public static final SettingNames FIRST_LOGON_COMMANDS = fromString("FirstLogonCommands"); + + /** + * Creates a new instance of SettingNames value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SettingNames() { + } + + /** + * Creates or finds a SettingNames from its string representation. + * + * @param name a name to look for. + * @return the corresponding SettingNames. + */ + public static SettingNames fromString(String name) { + return fromString(name, SettingNames.class); + } + + /** + * Gets known SettingNames values. + * + * @return known SettingNames values. + */ + public static Collection values() { + return values(SettingNames.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SshConfiguration.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SshConfiguration.java new file mode 100644 index 000000000000..2f4217297852 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SshConfiguration.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * SSH configuration for Linux based VMs running on Azure. + */ +@Fluent +public final class SshConfiguration implements JsonSerializable { + /* + * The list of SSH public keys used to authenticate with linux based VMs. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("publicKeys", this.publicKeys, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SshConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SshConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SshConfiguration. + */ + public static SshConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SshConfiguration deserializedSshConfiguration = new SshConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publicKeys".equals(fieldName)) { + List publicKeys = reader.readArray(reader1 -> SshPublicKey.fromJson(reader1)); + deserializedSshConfiguration.publicKeys = publicKeys; + } else { + reader.skipChildren(); + } + } + + return deserializedSshConfiguration; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SshPublicKey.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SshPublicKey.java new file mode 100644 index 000000000000..5f5836b90403 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SshPublicKey.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * 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 implements JsonSerializable { + /* + * 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 + */ + 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). + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeStringField("keyData", this.keyData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SshPublicKey from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SshPublicKey if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SshPublicKey. + */ + public static SshPublicKey fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SshPublicKey deserializedSshPublicKey = new SshPublicKey(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("path".equals(fieldName)) { + deserializedSshPublicKey.path = reader.getString(); + } else if ("keyData".equals(fieldName)) { + deserializedSshPublicKey.keyData = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSshPublicKey; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/StorageAccountTypes.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/StorageAccountTypes.java new file mode 100644 index 000000000000..d4ffc4e064ac --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/StorageAccountTypes.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +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 { + /** + * Standard_LRS storage account type. + */ + public static final StorageAccountTypes STANDARD_LRS = fromString("Standard_LRS"); + + /** + * Premium_LRS storage account type. + */ + public static final StorageAccountTypes PREMIUM_LRS = fromString("Premium_LRS"); + + /** + * StandardSSD_LRS storage account type. + */ + public static final StorageAccountTypes STANDARD_SSD_LRS = fromString("StandardSSD_LRS"); + + /** + * UltraSSD_LRS storage account type. + */ + public static final StorageAccountTypes ULTRA_SSD_LRS = fromString("UltraSSD_LRS"); + + /** + * Premium_ZRS storage account type. + */ + public static final StorageAccountTypes PREMIUM_ZRS = fromString("Premium_ZRS"); + + /** + * StandardSSD_ZRS storage account type. + */ + public static final StorageAccountTypes STANDARD_SSD_ZRS = fromString("StandardSSD_ZRS"); + + /** + * PremiumV2_LRS storage account type. + */ + 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/StorageProfile.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/StorageProfile.java new file mode 100644 index 000000000000..3dc5f42fe4e4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/StorageProfile.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Specifies the storage settings for the virtual machine disks. + */ +@Fluent +public final class StorageProfile implements JsonSerializable { + /* + * 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. + */ + 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). + */ + 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). + */ + 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. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("imageReference", this.imageReference); + jsonWriter.writeJsonField("osDisk", this.osDisk); + jsonWriter.writeArrayField("dataDisks", this.dataDisks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("diskControllerType", + this.diskControllerType == null ? null : this.diskControllerType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageProfile. + */ + public static StorageProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageProfile deserializedStorageProfile = new StorageProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("imageReference".equals(fieldName)) { + deserializedStorageProfile.imageReference = ImageReference.fromJson(reader); + } else if ("osDisk".equals(fieldName)) { + deserializedStorageProfile.osDisk = OSDisk.fromJson(reader); + } else if ("dataDisks".equals(fieldName)) { + List dataDisks = reader.readArray(reader1 -> DataDisk.fromJson(reader1)); + deserializedStorageProfile.dataDisks = dataDisks; + } else if ("diskControllerType".equals(fieldName)) { + deserializedStorageProfile.diskControllerType = DiskControllerTypes.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageProfile; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/TerminateNotificationProfile.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/TerminateNotificationProfile.java new file mode 100644 index 000000000000..94af3e48b02c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/TerminateNotificationProfile.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Profile properties for the Terminate Scheduled event. + */ +@Fluent +public final class TerminateNotificationProfile implements JsonSerializable { + /* + * 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) + */ + private String notBeforeTimeout; + + /* + * Specifies whether the Terminate Scheduled event is enabled or disabled. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("notBeforeTimeout", this.notBeforeTimeout); + jsonWriter.writeBooleanField("enable", this.enable); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TerminateNotificationProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TerminateNotificationProfile if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TerminateNotificationProfile. + */ + public static TerminateNotificationProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TerminateNotificationProfile deserializedTerminateNotificationProfile = new TerminateNotificationProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("notBeforeTimeout".equals(fieldName)) { + deserializedTerminateNotificationProfile.notBeforeTimeout = reader.getString(); + } else if ("enable".equals(fieldName)) { + deserializedTerminateNotificationProfile.enable = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedTerminateNotificationProfile; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/UefiSettings.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/UefiSettings.java new file mode 100644 index 000000000000..c145adbff2c7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/UefiSettings.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * 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 implements JsonSerializable { + /* + * Specifies whether secure boot should be enabled on the virtual machine. Minimum compute api-version: 2020-12-01. + */ + private Boolean secureBootEnabled; + + /* + * Specifies whether vTPM should be enabled on the virtual machine. Minimum compute api-version: 2020-12-01. + */ + 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 compute 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 compute 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 compute + * 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 compute + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("secureBootEnabled", this.secureBootEnabled); + jsonWriter.writeBooleanField("vTpmEnabled", this.vTpmEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UefiSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UefiSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UefiSettings. + */ + public static UefiSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UefiSettings deserializedUefiSettings = new UefiSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("secureBootEnabled".equals(fieldName)) { + deserializedUefiSettings.secureBootEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("vTpmEnabled".equals(fieldName)) { + deserializedUefiSettings.vTpmEnabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedUefiSettings; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/UserAssignedIdentity.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..e1b51e53557e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/UserAssignedIdentity.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * User assigned identity properties. + */ +@Immutable +public final class UserAssignedIdentity implements JsonSerializable { + /* + * The principal ID of the assigned identity. + */ + private String principalId; + + /* + * The client ID of the assigned identity. + */ + private String clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/UserInitiatedReboot.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/UserInitiatedReboot.java new file mode 100644 index 000000000000..069f92c691f8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/UserInitiatedReboot.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies Reboot related Scheduled Event related configurations. + */ +@Fluent +public final class UserInitiatedReboot implements JsonSerializable { + /* + * Specifies Reboot Scheduled Event related configurations. + */ + private Boolean userInitiatedRebootAutomaticallyApprove; + + /** + * Creates an instance of UserInitiatedReboot class. + */ + public UserInitiatedReboot() { + } + + /** + * Get the userInitiatedRebootAutomaticallyApprove property: Specifies Reboot Scheduled Event related + * configurations. + * + * @return the userInitiatedRebootAutomaticallyApprove value. + */ + public Boolean userInitiatedRebootAutomaticallyApprove() { + return this.userInitiatedRebootAutomaticallyApprove; + } + + /** + * Set the userInitiatedRebootAutomaticallyApprove property: Specifies Reboot Scheduled Event related + * configurations. + * + * @param userInitiatedRebootAutomaticallyApprove the userInitiatedRebootAutomaticallyApprove value to set. + * @return the UserInitiatedReboot object itself. + */ + public UserInitiatedReboot + withUserInitiatedRebootAutomaticallyApprove(Boolean userInitiatedRebootAutomaticallyApprove) { + this.userInitiatedRebootAutomaticallyApprove = userInitiatedRebootAutomaticallyApprove; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("automaticallyApprove", this.userInitiatedRebootAutomaticallyApprove); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserInitiatedReboot from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserInitiatedReboot if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UserInitiatedReboot. + */ + public static UserInitiatedReboot fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserInitiatedReboot deserializedUserInitiatedReboot = new UserInitiatedReboot(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("automaticallyApprove".equals(fieldName)) { + deserializedUserInitiatedReboot.userInitiatedRebootAutomaticallyApprove + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedUserInitiatedReboot; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/UserInitiatedRedeploy.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/UserInitiatedRedeploy.java new file mode 100644 index 000000000000..cf20b971638e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/UserInitiatedRedeploy.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies Redeploy related Scheduled Event related configurations. + */ +@Fluent +public final class UserInitiatedRedeploy implements JsonSerializable { + /* + * Specifies Redeploy Scheduled Event related configurations. + */ + private Boolean userInitiatedRedeployAutomaticallyApprove; + + /** + * Creates an instance of UserInitiatedRedeploy class. + */ + public UserInitiatedRedeploy() { + } + + /** + * Get the userInitiatedRedeployAutomaticallyApprove property: Specifies Redeploy Scheduled Event related + * configurations. + * + * @return the userInitiatedRedeployAutomaticallyApprove value. + */ + public Boolean userInitiatedRedeployAutomaticallyApprove() { + return this.userInitiatedRedeployAutomaticallyApprove; + } + + /** + * Set the userInitiatedRedeployAutomaticallyApprove property: Specifies Redeploy Scheduled Event related + * configurations. + * + * @param userInitiatedRedeployAutomaticallyApprove the userInitiatedRedeployAutomaticallyApprove value to set. + * @return the UserInitiatedRedeploy object itself. + */ + public UserInitiatedRedeploy + withUserInitiatedRedeployAutomaticallyApprove(Boolean userInitiatedRedeployAutomaticallyApprove) { + this.userInitiatedRedeployAutomaticallyApprove = userInitiatedRedeployAutomaticallyApprove; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("automaticallyApprove", this.userInitiatedRedeployAutomaticallyApprove); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserInitiatedRedeploy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserInitiatedRedeploy if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserInitiatedRedeploy. + */ + public static UserInitiatedRedeploy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserInitiatedRedeploy deserializedUserInitiatedRedeploy = new UserInitiatedRedeploy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("automaticallyApprove".equals(fieldName)) { + deserializedUserInitiatedRedeploy.userInitiatedRedeployAutomaticallyApprove + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedUserInitiatedRedeploy; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMAttributeMinMaxDouble.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMAttributeMinMaxDouble.java new file mode 100644 index 000000000000..8cb63296f74e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMAttributeMinMaxDouble.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * VMAttributes using double values. + */ +@Fluent +public final class VMAttributeMinMaxDouble implements JsonSerializable { + /* + * Minimum value. If not specified, no minimum filter is applied. + */ + private Double min; + + /* + * Maximum value. Must be greater than zero. Double.MaxValue(1.7976931348623157E+308). + */ + private Double max; + + /** + * Creates an instance of VMAttributeMinMaxDouble class. + */ + public VMAttributeMinMaxDouble() { + } + + /** + * Get the min property: Minimum value. If not specified, no minimum filter is applied. + * + * @return the min value. + */ + public Double min() { + return this.min; + } + + /** + * Set the min property: Minimum value. If not specified, no minimum filter is applied. + * + * @param min the min value to set. + * @return the VMAttributeMinMaxDouble object itself. + */ + public VMAttributeMinMaxDouble withMin(Double min) { + this.min = min; + return this; + } + + /** + * Get the max property: Maximum value. Must be greater than zero. Double.MaxValue(1.7976931348623157E+308). + * + * @return the max value. + */ + public Double max() { + return this.max; + } + + /** + * Set the max property: Maximum value. Must be greater than zero. Double.MaxValue(1.7976931348623157E+308). + * + * @param max the max value to set. + * @return the VMAttributeMinMaxDouble object itself. + */ + public VMAttributeMinMaxDouble withMax(Double max) { + this.max = max; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("min", this.min); + jsonWriter.writeNumberField("max", this.max); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VMAttributeMinMaxDouble from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VMAttributeMinMaxDouble if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VMAttributeMinMaxDouble. + */ + public static VMAttributeMinMaxDouble fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VMAttributeMinMaxDouble deserializedVMAttributeMinMaxDouble = new VMAttributeMinMaxDouble(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("min".equals(fieldName)) { + deserializedVMAttributeMinMaxDouble.min = reader.getNullable(JsonReader::getDouble); + } else if ("max".equals(fieldName)) { + deserializedVMAttributeMinMaxDouble.max = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedVMAttributeMinMaxDouble; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMAttributeMinMaxInteger.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMAttributeMinMaxInteger.java new file mode 100644 index 000000000000..1e67c08bb9ed --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMAttributeMinMaxInteger.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * While retrieving VMSizes from CRS, Min = 0 (uint.MinValue) if not specified, Max = 4294967295 (uint.MaxValue) if not + * specified. This allows to filter VMAttributes on all available VMSizes. + */ +@Fluent +public final class VMAttributeMinMaxInteger implements JsonSerializable { + /* + * Min VMSize from CRS, Min = 0 (uint.MinValue) if not specified. + */ + private Integer min; + + /* + * Max VMSize from CRS, Max = 4294967295 (uint.MaxValue) if not specified. + */ + private Integer max; + + /** + * Creates an instance of VMAttributeMinMaxInteger class. + */ + public VMAttributeMinMaxInteger() { + } + + /** + * Get the min property: Min VMSize from CRS, Min = 0 (uint.MinValue) if not specified. + * + * @return the min value. + */ + public Integer min() { + return this.min; + } + + /** + * Set the min property: Min VMSize from CRS, Min = 0 (uint.MinValue) if not specified. + * + * @param min the min value to set. + * @return the VMAttributeMinMaxInteger object itself. + */ + public VMAttributeMinMaxInteger withMin(Integer min) { + this.min = min; + return this; + } + + /** + * Get the max property: Max VMSize from CRS, Max = 4294967295 (uint.MaxValue) if not specified. + * + * @return the max value. + */ + public Integer max() { + return this.max; + } + + /** + * Set the max property: Max VMSize from CRS, Max = 4294967295 (uint.MaxValue) if not specified. + * + * @param max the max value to set. + * @return the VMAttributeMinMaxInteger object itself. + */ + public VMAttributeMinMaxInteger withMax(Integer max) { + this.max = max; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("min", this.min); + jsonWriter.writeNumberField("max", this.max); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VMAttributeMinMaxInteger from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VMAttributeMinMaxInteger if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VMAttributeMinMaxInteger. + */ + public static VMAttributeMinMaxInteger fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VMAttributeMinMaxInteger deserializedVMAttributeMinMaxInteger = new VMAttributeMinMaxInteger(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("min".equals(fieldName)) { + deserializedVMAttributeMinMaxInteger.min = reader.getNullable(JsonReader::getInt); + } else if ("max".equals(fieldName)) { + deserializedVMAttributeMinMaxInteger.max = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedVMAttributeMinMaxInteger; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMAttributeSupport.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMAttributeSupport.java new file mode 100644 index 000000000000..d03b9dcb8be5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMAttributeSupport.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * VMSizes supported by Azure VMs. Included is a union of Excluded and Required. + */ +public final class VMAttributeSupport extends ExpandableStringEnum { + /** + * All VMSizes having the feature support will be excluded. + */ + public static final VMAttributeSupport EXCLUDED = fromString("Excluded"); + + /** + * VMSizes that have the feature support and that do not have the feature support will be used. Included is a union + * of Excluded and Required. + */ + public static final VMAttributeSupport INCLUDED = fromString("Included"); + + /** + * Only the VMSizes having the feature support will be used. + */ + public static final VMAttributeSupport REQUIRED = fromString("Required"); + + /** + * Creates a new instance of VMAttributeSupport value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VMAttributeSupport() { + } + + /** + * Creates or finds a VMAttributeSupport from its string representation. + * + * @param name a name to look for. + * @return the corresponding VMAttributeSupport. + */ + public static VMAttributeSupport fromString(String name) { + return fromString(name, VMAttributeSupport.class); + } + + /** + * Gets known VMAttributeSupport values. + * + * @return known VMAttributeSupport values. + */ + public static Collection values() { + return values(VMAttributeSupport.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMAttributes.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMAttributes.java new file mode 100644 index 000000000000..92644749ef79 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMAttributes.java @@ -0,0 +1,776 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * VMAttributes that will be used to filter VMSizes which will be used to launch instances. + */ +@Fluent +public final class VMAttributes implements JsonSerializable { + /* + * The range of vCpuCount specified from Min to Max. Must be specified if VMAttributes are specified, either Min or + * Max is required if specified. + */ + private VMAttributeMinMaxInteger vCpuCount; + + /* + * The range of memory specified from Min to Max. Must be specified if VMAttributes are specified, either Min or Max + * is required if specified. + */ + private VMAttributeMinMaxDouble memoryInGiB; + + /* + * The VM architecture types specified as a list. Must be specified if VMAttributes are specified. Must be + * compatible with image used. + */ + private List architectureTypes; + + /* + * The range of memory in GiB per vCPU specified from min to max. Optional parameter. Either Min or Max is required + * if specified. + */ + private VMAttributeMinMaxDouble memoryInGiBPerVCpu; + + /* + * Specifies whether the VMSize supporting local storage should be used to launch instances or not. Included - + * Default if not specified as most Azure VMs support local storage. + */ + private VMAttributeSupport localStorageSupport; + + /* + * LocalStorageSupport should be set to "Included" or "Required" to use this VMAttribute. If localStorageSupport is + * "Excluded", this VMAttribute can not be used. + */ + private VMAttributeMinMaxDouble localStorageInGiB; + + /* + * The local storage disk types specified as a list. LocalStorageSupport should be set to "Included" or "Required" + * to use this VMAttribute. If localStorageSupport is "Excluded", this VMAttribute can not be used. + */ + private List localStorageDiskTypes; + + /* + * The range of data disk count specified from Min to Max. Optional parameter. Either Min or Max is required if + * specified. + */ + private VMAttributeMinMaxInteger dataDiskCount; + + /* + * The range of network interface count specified from Min to Max. Optional parameter. Either Min or Max is required + * if specified. + */ + private VMAttributeMinMaxInteger networkInterfaceCount; + + /* + * The range of network bandwidth in Mbps specified from Min to Max. Optional parameter. Either Min or Max is + * required if specified. + */ + private VMAttributeMinMaxDouble networkBandwidthInMbps; + + /* + * Specifies whether the VMSize supporting RDMA (Remote Direct Memory Access) should be used to build launch + * instances or not. + */ + private VMAttributeSupport rdmaSupport; + + /* + * The range of RDMA (Remote Direct Memory Access) network interface count specified from Min to Max. Optional + * parameter. Either Min or Max is required if specified. rdmaSupport should be set to "Included" or "Required" to + * use this VMAttribute. If rdmaSupport is "Excluded", this VMAttribute can not be used. + */ + private VMAttributeMinMaxInteger rdmaNetworkInterfaceCount; + + /* + * Specifies whether the VMSize supporting accelerator should be used to launch instances or not. acceleratorSupport + * should be set to "Included" or "Required" to use this VMAttribute. If acceleratorSupport is "Excluded", this + * VMAttribute can not be used. + */ + private VMAttributeSupport acceleratorSupport; + + /* + * The accelerator manufacturers specified as a list. acceleratorSupport should be set to "Included" or "Required" + * to use this VMAttribute. If acceleratorSupport is "Excluded", this VMAttribute can not be used. + */ + private List acceleratorManufacturers; + + /* + * The accelerator types specified as a list. acceleratorSupport should be set to "Included" or "Required" to use + * this VMAttribute. If acceleratorSupport is "Excluded", this VMAttribute can not be used. + */ + private List acceleratorTypes; + + /* + * The range of accelerator count specified from min to max. Optional parameter. Either Min or Max is required if + * specified. acceleratorSupport should be set to "Included" or "Required" to use this VMAttribute. If + * acceleratorSupport is "Excluded", this VMAttribute can not be used. + */ + private VMAttributeMinMaxInteger acceleratorCount; + + /* + * The VM category specified as a list. Optional parameter. + */ + private List vmCategories; + + /* + * The VM CPU manufacturers specified as a list. Optional parameter. + */ + private List cpuManufacturers; + + /* + * The hyperV generations specified as a list. Optional parameter. + */ + private List hyperVGenerations; + + /* + * Specifies whether the VMSize supporting burstable capability should be used to launch instances or not. + */ + private VMAttributeSupport burstableSupport; + + /* + * Specifies which VMSizes should be allowed while filtering on VMAttributes. Cannot be specified together with + * excludedVMSizes. Maximum of 10 VM sizes allowed. Optional parameter. + */ + private List allowedVMSizes; + + /* + * Specifies which VMSizes should be excluded while filtering on VMAttributes. Cannot be specified together with + * allowedVMSizes. Maximum of 10 VM sizes allowed. Optional parameter. + */ + private List excludedVMSizes; + + /** + * Creates an instance of VMAttributes class. + */ + public VMAttributes() { + } + + /** + * Get the vCpuCount property: The range of vCpuCount specified from Min to Max. Must be specified if VMAttributes + * are specified, either Min or Max is required if specified. + * + * @return the vCpuCount value. + */ + public VMAttributeMinMaxInteger vCpuCount() { + return this.vCpuCount; + } + + /** + * Set the vCpuCount property: The range of vCpuCount specified from Min to Max. Must be specified if VMAttributes + * are specified, either Min or Max is required if specified. + * + * @param vCpuCount the vCpuCount value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withVCpuCount(VMAttributeMinMaxInteger vCpuCount) { + this.vCpuCount = vCpuCount; + return this; + } + + /** + * Get the memoryInGiB property: The range of memory specified from Min to Max. Must be specified if VMAttributes + * are specified, either Min or Max is required if specified. + * + * @return the memoryInGiB value. + */ + public VMAttributeMinMaxDouble memoryInGiB() { + return this.memoryInGiB; + } + + /** + * Set the memoryInGiB property: The range of memory specified from Min to Max. Must be specified if VMAttributes + * are specified, either Min or Max is required if specified. + * + * @param memoryInGiB the memoryInGiB value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withMemoryInGiB(VMAttributeMinMaxDouble memoryInGiB) { + this.memoryInGiB = memoryInGiB; + return this; + } + + /** + * Get the architectureTypes property: The VM architecture types specified as a list. Must be specified if + * VMAttributes are specified. Must be compatible with image used. + * + * @return the architectureTypes value. + */ + public List architectureTypes() { + return this.architectureTypes; + } + + /** + * Set the architectureTypes property: The VM architecture types specified as a list. Must be specified if + * VMAttributes are specified. Must be compatible with image used. + * + * @param architectureTypes the architectureTypes value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withArchitectureTypes(List architectureTypes) { + this.architectureTypes = architectureTypes; + return this; + } + + /** + * Get the memoryInGiBPerVCpu property: The range of memory in GiB per vCPU specified from min to max. Optional + * parameter. Either Min or Max is required if specified. + * + * @return the memoryInGiBPerVCpu value. + */ + public VMAttributeMinMaxDouble memoryInGiBPerVCpu() { + return this.memoryInGiBPerVCpu; + } + + /** + * Set the memoryInGiBPerVCpu property: The range of memory in GiB per vCPU specified from min to max. Optional + * parameter. Either Min or Max is required if specified. + * + * @param memoryInGiBPerVCpu the memoryInGiBPerVCpu value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withMemoryInGiBPerVCpu(VMAttributeMinMaxDouble memoryInGiBPerVCpu) { + this.memoryInGiBPerVCpu = memoryInGiBPerVCpu; + return this; + } + + /** + * Get the localStorageSupport property: Specifies whether the VMSize supporting local storage should be used to + * launch instances or not. Included - Default if not specified as most Azure VMs support local storage. + * + * @return the localStorageSupport value. + */ + public VMAttributeSupport localStorageSupport() { + return this.localStorageSupport; + } + + /** + * Set the localStorageSupport property: Specifies whether the VMSize supporting local storage should be used to + * launch instances or not. Included - Default if not specified as most Azure VMs support local storage. + * + * @param localStorageSupport the localStorageSupport value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withLocalStorageSupport(VMAttributeSupport localStorageSupport) { + this.localStorageSupport = localStorageSupport; + return this; + } + + /** + * Get the localStorageInGiB property: LocalStorageSupport should be set to "Included" or "Required" to use this + * VMAttribute. If localStorageSupport is "Excluded", this VMAttribute can not be used. + * + * @return the localStorageInGiB value. + */ + public VMAttributeMinMaxDouble localStorageInGiB() { + return this.localStorageInGiB; + } + + /** + * Set the localStorageInGiB property: LocalStorageSupport should be set to "Included" or "Required" to use this + * VMAttribute. If localStorageSupport is "Excluded", this VMAttribute can not be used. + * + * @param localStorageInGiB the localStorageInGiB value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withLocalStorageInGiB(VMAttributeMinMaxDouble localStorageInGiB) { + this.localStorageInGiB = localStorageInGiB; + return this; + } + + /** + * Get the localStorageDiskTypes property: The local storage disk types specified as a list. LocalStorageSupport + * should be set to "Included" or "Required" to use this VMAttribute. If localStorageSupport is "Excluded", this + * VMAttribute can not be used. + * + * @return the localStorageDiskTypes value. + */ + public List localStorageDiskTypes() { + return this.localStorageDiskTypes; + } + + /** + * Set the localStorageDiskTypes property: The local storage disk types specified as a list. LocalStorageSupport + * should be set to "Included" or "Required" to use this VMAttribute. If localStorageSupport is "Excluded", this + * VMAttribute can not be used. + * + * @param localStorageDiskTypes the localStorageDiskTypes value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withLocalStorageDiskTypes(List localStorageDiskTypes) { + this.localStorageDiskTypes = localStorageDiskTypes; + return this; + } + + /** + * Get the dataDiskCount property: The range of data disk count specified from Min to Max. Optional parameter. + * Either Min or Max is required if specified. + * + * @return the dataDiskCount value. + */ + public VMAttributeMinMaxInteger dataDiskCount() { + return this.dataDiskCount; + } + + /** + * Set the dataDiskCount property: The range of data disk count specified from Min to Max. Optional parameter. + * Either Min or Max is required if specified. + * + * @param dataDiskCount the dataDiskCount value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withDataDiskCount(VMAttributeMinMaxInteger dataDiskCount) { + this.dataDiskCount = dataDiskCount; + return this; + } + + /** + * Get the networkInterfaceCount property: The range of network interface count specified from Min to Max. Optional + * parameter. Either Min or Max is required if specified. + * + * @return the networkInterfaceCount value. + */ + public VMAttributeMinMaxInteger networkInterfaceCount() { + return this.networkInterfaceCount; + } + + /** + * Set the networkInterfaceCount property: The range of network interface count specified from Min to Max. Optional + * parameter. Either Min or Max is required if specified. + * + * @param networkInterfaceCount the networkInterfaceCount value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withNetworkInterfaceCount(VMAttributeMinMaxInteger networkInterfaceCount) { + this.networkInterfaceCount = networkInterfaceCount; + return this; + } + + /** + * Get the networkBandwidthInMbps property: The range of network bandwidth in Mbps specified from Min to Max. + * Optional parameter. Either Min or Max is required if specified. + * + * @return the networkBandwidthInMbps value. + */ + public VMAttributeMinMaxDouble networkBandwidthInMbps() { + return this.networkBandwidthInMbps; + } + + /** + * Set the networkBandwidthInMbps property: The range of network bandwidth in Mbps specified from Min to Max. + * Optional parameter. Either Min or Max is required if specified. + * + * @param networkBandwidthInMbps the networkBandwidthInMbps value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withNetworkBandwidthInMbps(VMAttributeMinMaxDouble networkBandwidthInMbps) { + this.networkBandwidthInMbps = networkBandwidthInMbps; + return this; + } + + /** + * Get the rdmaSupport property: Specifies whether the VMSize supporting RDMA (Remote Direct Memory Access) should + * be used to build launch instances or not. + * + * @return the rdmaSupport value. + */ + public VMAttributeSupport rdmaSupport() { + return this.rdmaSupport; + } + + /** + * Set the rdmaSupport property: Specifies whether the VMSize supporting RDMA (Remote Direct Memory Access) should + * be used to build launch instances or not. + * + * @param rdmaSupport the rdmaSupport value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withRdmaSupport(VMAttributeSupport rdmaSupport) { + this.rdmaSupport = rdmaSupport; + return this; + } + + /** + * Get the rdmaNetworkInterfaceCount property: The range of RDMA (Remote Direct Memory Access) network interface + * count specified from Min to Max. Optional parameter. Either Min or Max is required if specified. rdmaSupport + * should be set to "Included" or "Required" to use this VMAttribute. If rdmaSupport is "Excluded", this VMAttribute + * can not be used. + * + * @return the rdmaNetworkInterfaceCount value. + */ + public VMAttributeMinMaxInteger rdmaNetworkInterfaceCount() { + return this.rdmaNetworkInterfaceCount; + } + + /** + * Set the rdmaNetworkInterfaceCount property: The range of RDMA (Remote Direct Memory Access) network interface + * count specified from Min to Max. Optional parameter. Either Min or Max is required if specified. rdmaSupport + * should be set to "Included" or "Required" to use this VMAttribute. If rdmaSupport is "Excluded", this VMAttribute + * can not be used. + * + * @param rdmaNetworkInterfaceCount the rdmaNetworkInterfaceCount value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withRdmaNetworkInterfaceCount(VMAttributeMinMaxInteger rdmaNetworkInterfaceCount) { + this.rdmaNetworkInterfaceCount = rdmaNetworkInterfaceCount; + return this; + } + + /** + * Get the acceleratorSupport property: Specifies whether the VMSize supporting accelerator should be used to launch + * instances or not. acceleratorSupport should be set to "Included" or "Required" to use this VMAttribute. If + * acceleratorSupport is "Excluded", this VMAttribute can not be used. + * + * @return the acceleratorSupport value. + */ + public VMAttributeSupport acceleratorSupport() { + return this.acceleratorSupport; + } + + /** + * Set the acceleratorSupport property: Specifies whether the VMSize supporting accelerator should be used to launch + * instances or not. acceleratorSupport should be set to "Included" or "Required" to use this VMAttribute. If + * acceleratorSupport is "Excluded", this VMAttribute can not be used. + * + * @param acceleratorSupport the acceleratorSupport value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withAcceleratorSupport(VMAttributeSupport acceleratorSupport) { + this.acceleratorSupport = acceleratorSupport; + return this; + } + + /** + * Get the acceleratorManufacturers property: The accelerator manufacturers specified as a list. acceleratorSupport + * should be set to "Included" or "Required" to use this VMAttribute. If acceleratorSupport is "Excluded", this + * VMAttribute can not be used. + * + * @return the acceleratorManufacturers value. + */ + public List acceleratorManufacturers() { + return this.acceleratorManufacturers; + } + + /** + * Set the acceleratorManufacturers property: The accelerator manufacturers specified as a list. acceleratorSupport + * should be set to "Included" or "Required" to use this VMAttribute. If acceleratorSupport is "Excluded", this + * VMAttribute can not be used. + * + * @param acceleratorManufacturers the acceleratorManufacturers value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withAcceleratorManufacturers(List acceleratorManufacturers) { + this.acceleratorManufacturers = acceleratorManufacturers; + return this; + } + + /** + * Get the acceleratorTypes property: The accelerator types specified as a list. acceleratorSupport should be set to + * "Included" or "Required" to use this VMAttribute. If acceleratorSupport is "Excluded", this VMAttribute can not + * be used. + * + * @return the acceleratorTypes value. + */ + public List acceleratorTypes() { + return this.acceleratorTypes; + } + + /** + * Set the acceleratorTypes property: The accelerator types specified as a list. acceleratorSupport should be set to + * "Included" or "Required" to use this VMAttribute. If acceleratorSupport is "Excluded", this VMAttribute can not + * be used. + * + * @param acceleratorTypes the acceleratorTypes value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withAcceleratorTypes(List acceleratorTypes) { + this.acceleratorTypes = acceleratorTypes; + return this; + } + + /** + * Get the acceleratorCount property: The range of accelerator count specified from min to max. Optional parameter. + * Either Min or Max is required if specified. acceleratorSupport should be set to "Included" or "Required" to use + * this VMAttribute. If acceleratorSupport is "Excluded", this VMAttribute can not be used. + * + * @return the acceleratorCount value. + */ + public VMAttributeMinMaxInteger acceleratorCount() { + return this.acceleratorCount; + } + + /** + * Set the acceleratorCount property: The range of accelerator count specified from min to max. Optional parameter. + * Either Min or Max is required if specified. acceleratorSupport should be set to "Included" or "Required" to use + * this VMAttribute. If acceleratorSupport is "Excluded", this VMAttribute can not be used. + * + * @param acceleratorCount the acceleratorCount value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withAcceleratorCount(VMAttributeMinMaxInteger acceleratorCount) { + this.acceleratorCount = acceleratorCount; + return this; + } + + /** + * Get the vmCategories property: The VM category specified as a list. Optional parameter. + * + * @return the vmCategories value. + */ + public List vmCategories() { + return this.vmCategories; + } + + /** + * Set the vmCategories property: The VM category specified as a list. Optional parameter. + * + * @param vmCategories the vmCategories value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withVmCategories(List vmCategories) { + this.vmCategories = vmCategories; + return this; + } + + /** + * Get the cpuManufacturers property: The VM CPU manufacturers specified as a list. Optional parameter. + * + * @return the cpuManufacturers value. + */ + public List cpuManufacturers() { + return this.cpuManufacturers; + } + + /** + * Set the cpuManufacturers property: The VM CPU manufacturers specified as a list. Optional parameter. + * + * @param cpuManufacturers the cpuManufacturers value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withCpuManufacturers(List cpuManufacturers) { + this.cpuManufacturers = cpuManufacturers; + return this; + } + + /** + * Get the hyperVGenerations property: The hyperV generations specified as a list. Optional parameter. + * + * @return the hyperVGenerations value. + */ + public List hyperVGenerations() { + return this.hyperVGenerations; + } + + /** + * Set the hyperVGenerations property: The hyperV generations specified as a list. Optional parameter. + * + * @param hyperVGenerations the hyperVGenerations value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withHyperVGenerations(List hyperVGenerations) { + this.hyperVGenerations = hyperVGenerations; + return this; + } + + /** + * Get the burstableSupport property: Specifies whether the VMSize supporting burstable capability should be used to + * launch instances or not. + * + * @return the burstableSupport value. + */ + public VMAttributeSupport burstableSupport() { + return this.burstableSupport; + } + + /** + * Set the burstableSupport property: Specifies whether the VMSize supporting burstable capability should be used to + * launch instances or not. + * + * @param burstableSupport the burstableSupport value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withBurstableSupport(VMAttributeSupport burstableSupport) { + this.burstableSupport = burstableSupport; + return this; + } + + /** + * Get the allowedVMSizes property: Specifies which VMSizes should be allowed while filtering on VMAttributes. + * Cannot be specified together with excludedVMSizes. Maximum of 10 VM sizes allowed. Optional parameter. + * + * @return the allowedVMSizes value. + */ + public List allowedVMSizes() { + return this.allowedVMSizes; + } + + /** + * Set the allowedVMSizes property: Specifies which VMSizes should be allowed while filtering on VMAttributes. + * Cannot be specified together with excludedVMSizes. Maximum of 10 VM sizes allowed. Optional parameter. + * + * @param allowedVMSizes the allowedVMSizes value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withAllowedVMSizes(List allowedVMSizes) { + this.allowedVMSizes = allowedVMSizes; + return this; + } + + /** + * Get the excludedVMSizes property: Specifies which VMSizes should be excluded while filtering on VMAttributes. + * Cannot be specified together with allowedVMSizes. Maximum of 10 VM sizes allowed. Optional parameter. + * + * @return the excludedVMSizes value. + */ + public List excludedVMSizes() { + return this.excludedVMSizes; + } + + /** + * Set the excludedVMSizes property: Specifies which VMSizes should be excluded while filtering on VMAttributes. + * Cannot be specified together with allowedVMSizes. Maximum of 10 VM sizes allowed. Optional parameter. + * + * @param excludedVMSizes the excludedVMSizes value to set. + * @return the VMAttributes object itself. + */ + public VMAttributes withExcludedVMSizes(List excludedVMSizes) { + this.excludedVMSizes = excludedVMSizes; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("vCpuCount", this.vCpuCount); + jsonWriter.writeJsonField("memoryInGiB", this.memoryInGiB); + jsonWriter.writeArrayField("architectureTypes", this.architectureTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeJsonField("memoryInGiBPerVCpu", this.memoryInGiBPerVCpu); + jsonWriter.writeStringField("localStorageSupport", + this.localStorageSupport == null ? null : this.localStorageSupport.toString()); + jsonWriter.writeJsonField("localStorageInGiB", this.localStorageInGiB); + jsonWriter.writeArrayField("localStorageDiskTypes", this.localStorageDiskTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeJsonField("dataDiskCount", this.dataDiskCount); + jsonWriter.writeJsonField("networkInterfaceCount", this.networkInterfaceCount); + jsonWriter.writeJsonField("networkBandwidthInMbps", this.networkBandwidthInMbps); + jsonWriter.writeStringField("rdmaSupport", this.rdmaSupport == null ? null : this.rdmaSupport.toString()); + jsonWriter.writeJsonField("rdmaNetworkInterfaceCount", this.rdmaNetworkInterfaceCount); + jsonWriter.writeStringField("acceleratorSupport", + this.acceleratorSupport == null ? null : this.acceleratorSupport.toString()); + jsonWriter.writeArrayField("acceleratorManufacturers", this.acceleratorManufacturers, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("acceleratorTypes", this.acceleratorTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeJsonField("acceleratorCount", this.acceleratorCount); + jsonWriter.writeArrayField("vmCategories", this.vmCategories, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("cpuManufacturers", this.cpuManufacturers, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("hyperVGenerations", this.hyperVGenerations, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("burstableSupport", + this.burstableSupport == null ? null : this.burstableSupport.toString()); + jsonWriter.writeArrayField("allowedVMSizes", this.allowedVMSizes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("excludedVMSizes", this.excludedVMSizes, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VMAttributes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VMAttributes if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VMAttributes. + */ + public static VMAttributes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VMAttributes deserializedVMAttributes = new VMAttributes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vCpuCount".equals(fieldName)) { + deserializedVMAttributes.vCpuCount = VMAttributeMinMaxInteger.fromJson(reader); + } else if ("memoryInGiB".equals(fieldName)) { + deserializedVMAttributes.memoryInGiB = VMAttributeMinMaxDouble.fromJson(reader); + } else if ("architectureTypes".equals(fieldName)) { + List architectureTypes + = reader.readArray(reader1 -> ArchitectureType.fromString(reader1.getString())); + deserializedVMAttributes.architectureTypes = architectureTypes; + } else if ("memoryInGiBPerVCpu".equals(fieldName)) { + deserializedVMAttributes.memoryInGiBPerVCpu = VMAttributeMinMaxDouble.fromJson(reader); + } else if ("localStorageSupport".equals(fieldName)) { + deserializedVMAttributes.localStorageSupport = VMAttributeSupport.fromString(reader.getString()); + } else if ("localStorageInGiB".equals(fieldName)) { + deserializedVMAttributes.localStorageInGiB = VMAttributeMinMaxDouble.fromJson(reader); + } else if ("localStorageDiskTypes".equals(fieldName)) { + List localStorageDiskTypes + = reader.readArray(reader1 -> LocalStorageDiskType.fromString(reader1.getString())); + deserializedVMAttributes.localStorageDiskTypes = localStorageDiskTypes; + } else if ("dataDiskCount".equals(fieldName)) { + deserializedVMAttributes.dataDiskCount = VMAttributeMinMaxInteger.fromJson(reader); + } else if ("networkInterfaceCount".equals(fieldName)) { + deserializedVMAttributes.networkInterfaceCount = VMAttributeMinMaxInteger.fromJson(reader); + } else if ("networkBandwidthInMbps".equals(fieldName)) { + deserializedVMAttributes.networkBandwidthInMbps = VMAttributeMinMaxDouble.fromJson(reader); + } else if ("rdmaSupport".equals(fieldName)) { + deserializedVMAttributes.rdmaSupport = VMAttributeSupport.fromString(reader.getString()); + } else if ("rdmaNetworkInterfaceCount".equals(fieldName)) { + deserializedVMAttributes.rdmaNetworkInterfaceCount = VMAttributeMinMaxInteger.fromJson(reader); + } else if ("acceleratorSupport".equals(fieldName)) { + deserializedVMAttributes.acceleratorSupport = VMAttributeSupport.fromString(reader.getString()); + } else if ("acceleratorManufacturers".equals(fieldName)) { + List acceleratorManufacturers + = reader.readArray(reader1 -> AcceleratorManufacturer.fromString(reader1.getString())); + deserializedVMAttributes.acceleratorManufacturers = acceleratorManufacturers; + } else if ("acceleratorTypes".equals(fieldName)) { + List acceleratorTypes + = reader.readArray(reader1 -> AcceleratorType.fromString(reader1.getString())); + deserializedVMAttributes.acceleratorTypes = acceleratorTypes; + } else if ("acceleratorCount".equals(fieldName)) { + deserializedVMAttributes.acceleratorCount = VMAttributeMinMaxInteger.fromJson(reader); + } else if ("vmCategories".equals(fieldName)) { + List vmCategories + = reader.readArray(reader1 -> VMCategory.fromString(reader1.getString())); + deserializedVMAttributes.vmCategories = vmCategories; + } else if ("cpuManufacturers".equals(fieldName)) { + List cpuManufacturers + = reader.readArray(reader1 -> CpuManufacturer.fromString(reader1.getString())); + deserializedVMAttributes.cpuManufacturers = cpuManufacturers; + } else if ("hyperVGenerations".equals(fieldName)) { + List hyperVGenerations + = reader.readArray(reader1 -> HyperVGeneration.fromString(reader1.getString())); + deserializedVMAttributes.hyperVGenerations = hyperVGenerations; + } else if ("burstableSupport".equals(fieldName)) { + deserializedVMAttributes.burstableSupport = VMAttributeSupport.fromString(reader.getString()); + } else if ("allowedVMSizes".equals(fieldName)) { + List allowedVMSizes = reader.readArray(reader1 -> reader1.getString()); + deserializedVMAttributes.allowedVMSizes = allowedVMSizes; + } else if ("excludedVMSizes".equals(fieldName)) { + List excludedVMSizes = reader.readArray(reader1 -> reader1.getString()); + deserializedVMAttributes.excludedVMSizes = excludedVMSizes; + } else { + reader.skipChildren(); + } + } + + return deserializedVMAttributes; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMCategory.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMCategory.java new file mode 100644 index 000000000000..cccc470265f7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMCategory.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * VMCategories defined for Azure VMs. + */ +public final class VMCategory extends ExpandableStringEnum { + /** + * General purpose VM sizes provide balanced CPU-to-memory ratio. Ideal for testing and development, small to medium + * databases, and low to medium traffic web servers. + */ + public static final VMCategory GENERAL_PURPOSE = fromString("GeneralPurpose"); + + /** + * Compute optimized VM sizes have a high CPU-to-memory ratio. These sizes are good for medium traffic web servers, + * network appliances, batch processes, and application servers. + */ + public static final VMCategory COMPUTE_OPTIMIZED = fromString("ComputeOptimized"); + + /** + * Memory optimized VM sizes offer a high memory-to-CPU ratio that is great for relational database servers, medium + * to large caches, and in-memory analytics. + */ + public static final VMCategory MEMORY_OPTIMIZED = fromString("MemoryOptimized"); + + /** + * Storage optimized virtual machine (VM) sizes offer high disk throughput and IO, and are ideal for Big Data, SQL, + * NoSQL databases, data warehousing, and large transactional databases. + */ + public static final VMCategory STORAGE_OPTIMIZED = fromString("StorageOptimized"); + + /** + * GPU optimized VM sizes are specialized virtual machines available with single, multiple, or fractional GPUs. + */ + public static final VMCategory GPU_ACCELERATED = fromString("GpuAccelerated"); + + /** + * FPGA optimized VM sizes are specialized virtual machines available with single or multiple FPGA. + */ + public static final VMCategory FPGA_ACCELERATED = fromString("FpgaAccelerated"); + + /** + * Azure High Performance Compute VMs are optimized for various HPC workloads such as CFD, FEA, EDA, rendering, + * molecular dynamics, weather simulation, and financial risk analysis. + */ + public static final VMCategory HIGH_PERFORMANCE_COMPUTE = fromString("HighPerformanceCompute"); + + /** + * Creates a new instance of VMCategory value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VMCategory() { + } + + /** + * Creates or finds a VMCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding VMCategory. + */ + public static VMCategory fromString(String name) { + return fromString(name, VMCategory.class); + } + + /** + * Gets known VMCategory values. + * + * @return known VMCategory values. + */ + public static Collection values() { + return values(VMCategory.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMDiskSecurityProfile.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMDiskSecurityProfile.java new file mode 100644 index 000000000000..98952bcb5686 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMDiskSecurityProfile.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies the security profile settings for the managed disk. **Note:** It can only be set for Confidential VMs. + */ +@Fluent +public final class VMDiskSecurityProfile implements JsonSerializable { + /* + * Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption of the managed + * disk along with VMGuestState blob, VMGuestStateOnly for encryption of just the VMGuestState blob, and + * NonPersistedTPM for not persisting firmware state in the VMGuestState blob.. **Note:** It can be set for only + * Confidential VMs. + */ + 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. + */ + private DiskEncryptionSetParametersContent 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, VMGuestStateOnly for + * encryption of just the VMGuestState blob, and NonPersistedTPM for not persisting firmware state in 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, VMGuestStateOnly for + * encryption of just the VMGuestState blob, and NonPersistedTPM for not persisting firmware state in 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 DiskEncryptionSetParametersContent 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(DiskEncryptionSetParametersContent diskEncryptionSet) { + this.diskEncryptionSet = diskEncryptionSet; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("securityEncryptionType", + this.securityEncryptionType == null ? null : this.securityEncryptionType.toString()); + jsonWriter.writeJsonField("diskEncryptionSet", this.diskEncryptionSet); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VMDiskSecurityProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VMDiskSecurityProfile if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VMDiskSecurityProfile. + */ + public static VMDiskSecurityProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VMDiskSecurityProfile deserializedVMDiskSecurityProfile = new VMDiskSecurityProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("securityEncryptionType".equals(fieldName)) { + deserializedVMDiskSecurityProfile.securityEncryptionType + = SecurityEncryptionTypes.fromString(reader.getString()); + } else if ("diskEncryptionSet".equals(fieldName)) { + deserializedVMDiskSecurityProfile.diskEncryptionSet + = DiskEncryptionSetParametersContent.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVMDiskSecurityProfile; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMGalleryApplication.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMGalleryApplication.java new file mode 100644 index 000000000000..3aebac827876 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMGalleryApplication.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies the required information to reference a compute gallery application version. + */ +@Fluent +public final class VMGalleryApplication implements JsonSerializable { + /* + * Optional, Specifies a passthrough value for more generic context. + */ + private String tags; + + /* + * Optional, Specifies the order in which the packages have to be installed + */ + 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} + */ + private String packageReferenceId; + + /* + * Optional, Specifies the uri to an azure blob that will replace the default configuration for the package if + * provided + */ + private String configurationReference; + + /* + * Optional, If true, any failure for any operation in the VmApplication will fail the deployment + */ + 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 + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("packageReferenceId", this.packageReferenceId); + jsonWriter.writeStringField("tags", this.tags); + jsonWriter.writeNumberField("order", this.order); + jsonWriter.writeStringField("configurationReference", this.configurationReference); + jsonWriter.writeBooleanField("treatFailureAsDeploymentFailure", this.treatFailureAsDeploymentFailure); + jsonWriter.writeBooleanField("enableAutomaticUpgrade", this.enableAutomaticUpgrade); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VMGalleryApplication from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VMGalleryApplication if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VMGalleryApplication. + */ + public static VMGalleryApplication fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VMGalleryApplication deserializedVMGalleryApplication = new VMGalleryApplication(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("packageReferenceId".equals(fieldName)) { + deserializedVMGalleryApplication.packageReferenceId = reader.getString(); + } else if ("tags".equals(fieldName)) { + deserializedVMGalleryApplication.tags = reader.getString(); + } else if ("order".equals(fieldName)) { + deserializedVMGalleryApplication.order = reader.getNullable(JsonReader::getInt); + } else if ("configurationReference".equals(fieldName)) { + deserializedVMGalleryApplication.configurationReference = reader.getString(); + } else if ("treatFailureAsDeploymentFailure".equals(fieldName)) { + deserializedVMGalleryApplication.treatFailureAsDeploymentFailure + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableAutomaticUpgrade".equals(fieldName)) { + deserializedVMGalleryApplication.enableAutomaticUpgrade + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedVMGalleryApplication; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMOperationStatus.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMOperationStatus.java new file mode 100644 index 000000000000..c7b6ff91726c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMOperationStatus.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Virtual Machine operation status values. + */ +public final class VMOperationStatus extends ExpandableStringEnum { + /** + * Indicates that the virtual machine is either in the process of being created or is scheduled to be created. + */ + public static final VMOperationStatus CREATING = fromString("Creating"); + + /** + * Indicates that the cancellation request was successful because the virtual machine had not been created yet. + */ + public static final VMOperationStatus CANCELED = fromString("Canceled"); + + /** + * Indicates that the cancellation request could not be applied because the virtual machine had already been + * created. + */ + public static final VMOperationStatus CANCEL_FAILED_STATUS_UNKNOWN = fromString("CancelFailedStatusUnknown"); + + /** + * Indicates that the virtual machine operation failed. + */ + public static final VMOperationStatus FAILED = fromString("Failed"); + + /** + * Indicates that the virtual machine operation completed successfully. + */ + public static final VMOperationStatus SUCCEEDED = fromString("Succeeded"); + + /** + * Indicates that the virtual machine is being deleted. + */ + public static final VMOperationStatus DELETING = fromString("Deleting"); + + /** + * Indicates that the virtual machine operation is being cancelled. + */ + public static final VMOperationStatus CANCELLING = fromString("Cancelling"); + + /** + * Creates a new instance of VMOperationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VMOperationStatus() { + } + + /** + * Creates or finds a VMOperationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding VMOperationStatus. + */ + public static VMOperationStatus fromString(String name) { + return fromString(name, VMOperationStatus.class); + } + + /** + * Gets known VMOperationStatus values. + * + * @return known VMOperationStatus values. + */ + public static Collection values() { + return values(VMOperationStatus.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VaultCertificate.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VaultCertificate.java new file mode 100644 index 000000000000..4644f4014326 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VaultCertificate.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. + */ +@Fluent +public final class VaultCertificate implements JsonSerializable { + /* + * 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). + */ + 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 .crt for the X509 + * certificate file and .prv for private key. Both of these files are .pem formatted. + */ + 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 + * <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.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 + * <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("certificateUrl", this.certificateUrl); + jsonWriter.writeStringField("certificateStore", this.certificateStore); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultCertificate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultCertificate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VaultCertificate. + */ + public static VaultCertificate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultCertificate deserializedVaultCertificate = new VaultCertificate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("certificateUrl".equals(fieldName)) { + deserializedVaultCertificate.certificateUrl = reader.getString(); + } else if ("certificateStore".equals(fieldName)) { + deserializedVaultCertificate.certificateStore = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVaultCertificate; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VaultSecretGroup.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VaultSecretGroup.java new file mode 100644 index 000000000000..a2ee7fb94cce --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VaultSecretGroup.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes a set of certificates which are all in the same Key Vault. + */ +@Fluent +public final class VaultSecretGroup implements JsonSerializable { + /* + * The relative URL of the Key Vault containing all of the certificates in VaultCertificates. + */ + private SubResource sourceVault; + + /* + * The list of key vault references in SourceVault which contain certificates. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("sourceVault", this.sourceVault); + jsonWriter.writeArrayField("vaultCertificates", this.vaultCertificates, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultSecretGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultSecretGroup if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VaultSecretGroup. + */ + public static VaultSecretGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultSecretGroup deserializedVaultSecretGroup = new VaultSecretGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceVault".equals(fieldName)) { + deserializedVaultSecretGroup.sourceVault = SubResource.fromJson(reader); + } else if ("vaultCertificates".equals(fieldName)) { + List vaultCertificates + = reader.readArray(reader1 -> VaultCertificate.fromJson(reader1)); + deserializedVaultSecretGroup.vaultCertificates = vaultCertificates; + } else { + reader.skipChildren(); + } + } + + return deserializedVaultSecretGroup; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualHardDisk.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualHardDisk.java new file mode 100644 index 000000000000..292c513c2403 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualHardDisk.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the uri of a disk. + */ +@Fluent +public final class VirtualHardDisk implements JsonSerializable { + /* + * Specifies the virtual hard disk's 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("uri", this.uri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualHardDisk from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualHardDisk if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualHardDisk. + */ + public static VirtualHardDisk fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualHardDisk deserializedVirtualHardDisk = new VirtualHardDisk(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("uri".equals(fieldName)) { + deserializedVirtualHardDisk.uri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualHardDisk; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachine.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachine.java new file mode 100644 index 000000000000..1cfc9a0691cd --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachine.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.resourcemanager.compute.bulkactions.fluent.models.VirtualMachineInner; + +/** + * An immutable client-side representation of VirtualMachine. + */ +public interface VirtualMachine { + /** + * Gets the name property: The name of the virtual machine. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: The compute RP resource id of the virtual machine. + * subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName}. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: Type of the virtual machine. + * + * @return the type value. + */ + String type(); + + /** + * Gets the operationStatus property: Represents the operationStatus of the virtual machine in response to the last + * operation performed on it by the LaunchBulkInstancesOperation. + * + * @return the operationStatus value. + */ + VMOperationStatus operationStatus(); + + /** + * Gets the error property: Error information when operationStatus is Failed. + * + * @return the error value. + */ + ApiError error(); + + /** + * Gets the inner com.azure.resourcemanager.compute.bulkactions.fluent.models.VirtualMachineInner object. + * + * @return the inner object. + */ + VirtualMachineInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineBulkOperations.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineBulkOperations.java index a769e64d0904..5822c589341b 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineBulkOperations.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineBulkOperations.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.compute.bulkactions.models; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; @@ -104,6 +105,68 @@ Response bulkStartOperationWithResponse(String r StartResourceOperationResponse bulkStartOperation(String resourceGroupName, String location, ExecuteStartContent requestBody); + /** + * BulkCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as + * Computeschedule receives it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a create request along with {@link Response}. + */ + Response bulkCreateOperationWithResponse(String resourceGroupName, String location, + ExecuteCreateContent requestBody, Context context); + + /** + * BulkCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as + * Computeschedule receives it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a create request. + */ + CreateResourceOperationResponse bulkCreateOperation(String resourceGroupName, String location, + ExecuteCreateContent requestBody); + + /** + * BulkVdiFlexCreate: Bulk create operation for a batch of virtual machines, this operation supports flex properties + * to give options on Sku and zone selection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a create request along with {@link Response}. + */ + Response bulkVdiFlexCreateOperationWithResponse(String resourceGroupName, + String location, ExecuteVdiCreateRequest requestBody, Context context); + + /** + * BulkVdiFlexCreate: Bulk create operation for a batch of virtual machines, this operation supports flex properties + * to give options on Sku and zone selection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a create request. + */ + CreateResourceOperationResponse bulkVdiFlexCreateOperation(String resourceGroupName, String location, + ExecuteVdiCreateRequest requestBody); + /** * BulkDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as * Computeschedule receives it. @@ -192,4 +255,91 @@ Response bulkCancelOperationsWithResponse(String resou */ CancelOperationsResponse bulkCancelOperations(String resourceGroupName, String location, CancelOperationsContent requestBody); + + /** + * BulkReimage: Execute reimage operation for a batch of virtual machines, this operation is triggered as soon as + * Computeschedule receives it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a reimage request along with {@link Response}. + */ + Response bulkReimageOperationWithResponse(String resourceGroupName, + String location, ExecuteReimageRequest requestBody, Context context); + + /** + * BulkReimage: Execute reimage operation for a batch of virtual machines, this operation is triggered as soon as + * Computeschedule receives it. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param requestBody The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from a reimage request. + */ + ReimageResourceOperationResponse bulkReimageOperation(String resourceGroupName, String location, + ExecuteReimageRequest requestBody); + + /** + * BulkListOperationErrors: List bulk operation errors for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 from listing bulk operation errors as paginated response with {@link PagedIterable}. + */ + PagedIterable bulkListOperationErrors(String resourceGroupName, String location); + + /** + * BulkListOperationErrors: List bulk operation errors for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param lookbackInMinutes The number of minutes to look back for errors. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 from listing bulk operation errors as paginated response with {@link PagedIterable}. + */ + PagedIterable bulkListOperationErrors(String resourceGroupName, String location, + Integer lookbackInMinutes, Context context); + + /** + * BulkAcknowledgeOperationErrors: Acknowledge bulk operation errors for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param body The list of operation ids to acknowledge. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 from acknowledging bulk operation errors along with {@link Response}. + */ + Response bulkAcknowledgeOperationErrorsWithResponse( + String resourceGroupName, String location, AcknowledgeBulkOperationErrorsRequest body, Context context); + + /** + * BulkAcknowledgeOperationErrors: Acknowledge bulk operation errors for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The location name. + * @param body The list of operation ids to acknowledge. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 from acknowledging bulk operation errors. + */ + AcknowledgeBulkOperationErrorsResponse bulkAcknowledgeOperationErrors(String resourceGroupName, String location, + AcknowledgeBulkOperationErrorsRequest body); } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineInfo.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineInfo.java new file mode 100644 index 000000000000..c9ca5af276bf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineInfo.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Information about a virtual machine. + */ +@Immutable +public final class VirtualMachineInfo implements JsonSerializable { + /* + * The name of the VM size, eg Standard_D2ads_v5 + */ + private String vmSize; + + /* + * The zone identifier + */ + private String zone; + + /** + * Creates an instance of VirtualMachineInfo class. + */ + private VirtualMachineInfo() { + } + + /** + * Get the vmSize property: The name of the VM size, eg Standard_D2ads_v5. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Get the zone property: The zone identifier. + * + * @return the zone value. + */ + public String zone() { + return this.zone; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vmSize", this.vmSize); + jsonWriter.writeStringField("zone", this.zone); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineInfo. + */ + public static VirtualMachineInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineInfo deserializedVirtualMachineInfo = new VirtualMachineInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmSize".equals(fieldName)) { + deserializedVirtualMachineInfo.vmSize = reader.getString(); + } else if ("zone".equals(fieldName)) { + deserializedVirtualMachineInfo.zone = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineInfo; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineIpTag.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineIpTag.java new file mode 100644 index 000000000000..bfad6411756a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineIpTag.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Contains the IP tag associated with the public IP address. + */ +@Fluent +public final class VirtualMachineIpTag implements JsonSerializable { + /* + * IP tag type. Example: FirstPartyUsage. + */ + private String ipTagType; + + /* + * IP tag associated with the public IP. Example: SQL, Storage etc. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipTagType", this.ipTagType); + jsonWriter.writeStringField("tag", this.tag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineIpTag from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineIpTag if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineIpTag. + */ + public static VirtualMachineIpTag fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineIpTag deserializedVirtualMachineIpTag = new VirtualMachineIpTag(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipTagType".equals(fieldName)) { + deserializedVirtualMachineIpTag.ipTagType = reader.getString(); + } else if ("tag".equals(fieldName)) { + deserializedVirtualMachineIpTag.tag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineIpTag; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceConfiguration.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceConfiguration.java new file mode 100644 index 000000000000..7d7a676efffb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceConfiguration.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Describes a virtual machine network interface configurations. + */ +@Fluent +public final class VirtualMachineNetworkInterfaceConfiguration + implements JsonSerializable { + /* + * The network interface configuration name. + */ + private String name; + + /* + * Describes a virtual machine network profile's IP configuration. + */ + private VirtualMachineNetworkInterfaceConfigurationProperties properties; + + /* + * Resource tags applied to the networkInterface address created by this NetworkInterfaceConfiguration + */ + private Map tags; + + /** + * 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 properties property: Describes a virtual machine network profile's IP configuration. + * + * @return the properties value. + */ + public VirtualMachineNetworkInterfaceConfigurationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Describes a virtual machine network profile's IP configuration. + * + * @param properties the properties value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration + withProperties(VirtualMachineNetworkInterfaceConfigurationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the tags property: Resource tags applied to the networkInterface address created by this + * NetworkInterfaceConfiguration. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags applied to the networkInterface address created by this + * NetworkInterfaceConfiguration. + * + * @param tags the tags value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineNetworkInterfaceConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineNetworkInterfaceConfiguration if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualMachineNetworkInterfaceConfiguration. + */ + public static VirtualMachineNetworkInterfaceConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineNetworkInterfaceConfiguration deserializedVirtualMachineNetworkInterfaceConfiguration + = new VirtualMachineNetworkInterfaceConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVirtualMachineNetworkInterfaceConfiguration.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedVirtualMachineNetworkInterfaceConfiguration.properties + = VirtualMachineNetworkInterfaceConfigurationProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVirtualMachineNetworkInterfaceConfiguration.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineNetworkInterfaceConfiguration; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceConfigurationProperties.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceConfigurationProperties.java new file mode 100644 index 000000000000..63f98c238be7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceConfigurationProperties.java @@ -0,0 +1,429 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes a virtual machine network profile's IP configuration. + */ +@Fluent +public final class VirtualMachineNetworkInterfaceConfigurationProperties + implements JsonSerializable { + /* + * Specifies the primary network interface in case the virtual machine has more than 1 network interface. + */ + private Boolean primary; + + /* + * Specify what happens to the network interface when the VM is deleted + */ + private DeleteOptions deleteOption; + + /* + * Specifies whether the network interface is accelerated networking-enabled. + */ + private Boolean enableAcceleratedNetworking; + + /* + * Specifies whether the network interface is disabled for tcp state tracking. + */ + private Boolean disableTcpStateTracking; + + /* + * Specifies whether the network interface is FPGA networking-enabled. + */ + private Boolean enableFpga; + + /* + * Whether IP forwarding enabled on this NIC. + */ + private Boolean enableIPForwarding; + + /* + * The network security group. + */ + private SubResource networkSecurityGroup; + + /* + * The dns settings to be applied on the network interfaces. + */ + private VirtualMachineNetworkInterfaceDnsSettingsConfiguration dnsSettings; + + /* + * Specifies the IP configurations of the network interface. + */ + private List ipConfigurations; + + /* + * The DSCP configuration for the network interface. + */ + private SubResource dscpConfiguration; + + /* + * Specifies whether the Auxiliary mode is enabled for the Network Interface resource. + */ + private NetworkInterfaceAuxiliaryMode auxiliaryMode; + + /* + * Specifies whether the Auxiliary sku is enabled for the Network Interface resource. + */ + private NetworkInterfaceAuxiliarySku auxiliarySku; + + /** + * 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 DSCP configuration for the network interface. + * + * @return the dscpConfiguration value. + */ + public SubResource dscpConfiguration() { + return this.dscpConfiguration; + } + + /** + * Set the dscpConfiguration property: The DSCP configuration for the network interface. + * + * @param dscpConfiguration the dscpConfiguration value to set. + * @return the VirtualMachineNetworkInterfaceConfigurationProperties object itself. + */ + public VirtualMachineNetworkInterfaceConfigurationProperties withDscpConfiguration(SubResource dscpConfiguration) { + this.dscpConfiguration = dscpConfiguration; + return this; + } + + /** + * Get the auxiliaryMode property: Specifies whether the Auxiliary mode is enabled for the Network Interface + * resource. + * + * @return the auxiliaryMode value. + */ + public NetworkInterfaceAuxiliaryMode auxiliaryMode() { + return this.auxiliaryMode; + } + + /** + * Set the auxiliaryMode property: Specifies whether the Auxiliary mode is enabled for the Network Interface + * resource. + * + * @param auxiliaryMode the auxiliaryMode value to set. + * @return the VirtualMachineNetworkInterfaceConfigurationProperties object itself. + */ + public VirtualMachineNetworkInterfaceConfigurationProperties + withAuxiliaryMode(NetworkInterfaceAuxiliaryMode auxiliaryMode) { + this.auxiliaryMode = auxiliaryMode; + return this; + } + + /** + * Get the auxiliarySku property: Specifies whether the Auxiliary sku is enabled for the Network Interface resource. + * + * @return the auxiliarySku value. + */ + public NetworkInterfaceAuxiliarySku auxiliarySku() { + return this.auxiliarySku; + } + + /** + * Set the auxiliarySku property: Specifies whether the Auxiliary sku is enabled for the Network Interface resource. + * + * @param auxiliarySku the auxiliarySku value to set. + * @return the VirtualMachineNetworkInterfaceConfigurationProperties object itself. + */ + public VirtualMachineNetworkInterfaceConfigurationProperties + withAuxiliarySku(NetworkInterfaceAuxiliarySku auxiliarySku) { + this.auxiliarySku = auxiliarySku; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ipConfigurations", this.ipConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("primary", this.primary); + jsonWriter.writeStringField("deleteOption", this.deleteOption == null ? null : this.deleteOption.toString()); + jsonWriter.writeBooleanField("enableAcceleratedNetworking", this.enableAcceleratedNetworking); + jsonWriter.writeBooleanField("disableTcpStateTracking", this.disableTcpStateTracking); + jsonWriter.writeBooleanField("enableFpga", this.enableFpga); + jsonWriter.writeBooleanField("enableIPForwarding", this.enableIPForwarding); + jsonWriter.writeJsonField("networkSecurityGroup", this.networkSecurityGroup); + jsonWriter.writeJsonField("dnsSettings", this.dnsSettings); + jsonWriter.writeJsonField("dscpConfiguration", this.dscpConfiguration); + jsonWriter.writeStringField("auxiliaryMode", this.auxiliaryMode == null ? null : this.auxiliaryMode.toString()); + jsonWriter.writeStringField("auxiliarySku", this.auxiliarySku == null ? null : this.auxiliarySku.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineNetworkInterfaceConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineNetworkInterfaceConfigurationProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualMachineNetworkInterfaceConfigurationProperties. + */ + public static VirtualMachineNetworkInterfaceConfigurationProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineNetworkInterfaceConfigurationProperties deserializedVirtualMachineNetworkInterfaceConfigurationProperties + = new VirtualMachineNetworkInterfaceConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipConfigurations".equals(fieldName)) { + List ipConfigurations + = reader.readArray(reader1 -> VirtualMachineNetworkInterfaceIPConfiguration.fromJson(reader1)); + deserializedVirtualMachineNetworkInterfaceConfigurationProperties.ipConfigurations + = ipConfigurations; + } else if ("primary".equals(fieldName)) { + deserializedVirtualMachineNetworkInterfaceConfigurationProperties.primary + = reader.getNullable(JsonReader::getBoolean); + } else if ("deleteOption".equals(fieldName)) { + deserializedVirtualMachineNetworkInterfaceConfigurationProperties.deleteOption + = DeleteOptions.fromString(reader.getString()); + } else if ("enableAcceleratedNetworking".equals(fieldName)) { + deserializedVirtualMachineNetworkInterfaceConfigurationProperties.enableAcceleratedNetworking + = reader.getNullable(JsonReader::getBoolean); + } else if ("disableTcpStateTracking".equals(fieldName)) { + deserializedVirtualMachineNetworkInterfaceConfigurationProperties.disableTcpStateTracking + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableFpga".equals(fieldName)) { + deserializedVirtualMachineNetworkInterfaceConfigurationProperties.enableFpga + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableIPForwarding".equals(fieldName)) { + deserializedVirtualMachineNetworkInterfaceConfigurationProperties.enableIPForwarding + = reader.getNullable(JsonReader::getBoolean); + } else if ("networkSecurityGroup".equals(fieldName)) { + deserializedVirtualMachineNetworkInterfaceConfigurationProperties.networkSecurityGroup + = SubResource.fromJson(reader); + } else if ("dnsSettings".equals(fieldName)) { + deserializedVirtualMachineNetworkInterfaceConfigurationProperties.dnsSettings + = VirtualMachineNetworkInterfaceDnsSettingsConfiguration.fromJson(reader); + } else if ("dscpConfiguration".equals(fieldName)) { + deserializedVirtualMachineNetworkInterfaceConfigurationProperties.dscpConfiguration + = SubResource.fromJson(reader); + } else if ("auxiliaryMode".equals(fieldName)) { + deserializedVirtualMachineNetworkInterfaceConfigurationProperties.auxiliaryMode + = NetworkInterfaceAuxiliaryMode.fromString(reader.getString()); + } else if ("auxiliarySku".equals(fieldName)) { + deserializedVirtualMachineNetworkInterfaceConfigurationProperties.auxiliarySku + = NetworkInterfaceAuxiliarySku.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineNetworkInterfaceConfigurationProperties; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceDnsSettingsConfiguration.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceDnsSettingsConfiguration.java new file mode 100644 index 000000000000..0140e6183a90 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceDnsSettingsConfiguration.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes a virtual machines network configuration's DNS settings. + */ +@Fluent +public final class VirtualMachineNetworkInterfaceDnsSettingsConfiguration + implements JsonSerializable { + /* + * List of DNS servers IP addresses + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dnsServers", this.dnsServers, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineNetworkInterfaceDnsSettingsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineNetworkInterfaceDnsSettingsConfiguration if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineNetworkInterfaceDnsSettingsConfiguration. + */ + public static VirtualMachineNetworkInterfaceDnsSettingsConfiguration fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineNetworkInterfaceDnsSettingsConfiguration deserializedVirtualMachineNetworkInterfaceDnsSettingsConfiguration + = new VirtualMachineNetworkInterfaceDnsSettingsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dnsServers".equals(fieldName)) { + List dnsServers = reader.readArray(reader1 -> reader1.getString()); + deserializedVirtualMachineNetworkInterfaceDnsSettingsConfiguration.dnsServers = dnsServers; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineNetworkInterfaceDnsSettingsConfiguration; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceIPConfiguration.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceIPConfiguration.java new file mode 100644 index 000000000000..86c406a3eb26 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceIPConfiguration.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a virtual machine network profile's IP configuration. + */ +@Fluent +public final class VirtualMachineNetworkInterfaceIPConfiguration + implements JsonSerializable { + /* + * The IP configuration name. + */ + private String name; + + /* + * Describes a virtual machine network interface IP configuration properties. + */ + private VirtualMachineNetworkInterfaceIPConfigurationProperties properties; + + /** + * 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 properties property: Describes a virtual machine network interface IP configuration properties. + * + * @return the properties value. + */ + public VirtualMachineNetworkInterfaceIPConfigurationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Describes a virtual machine network interface IP configuration properties. + * + * @param properties the properties value to set. + * @return the VirtualMachineNetworkInterfaceIPConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceIPConfiguration + withProperties(VirtualMachineNetworkInterfaceIPConfigurationProperties properties) { + this.properties = properties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineNetworkInterfaceIPConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineNetworkInterfaceIPConfiguration if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualMachineNetworkInterfaceIPConfiguration. + */ + public static VirtualMachineNetworkInterfaceIPConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineNetworkInterfaceIPConfiguration deserializedVirtualMachineNetworkInterfaceIPConfiguration + = new VirtualMachineNetworkInterfaceIPConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVirtualMachineNetworkInterfaceIPConfiguration.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedVirtualMachineNetworkInterfaceIPConfiguration.properties + = VirtualMachineNetworkInterfaceIPConfigurationProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineNetworkInterfaceIPConfiguration; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceIPConfigurationProperties.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceIPConfigurationProperties.java new file mode 100644 index 000000000000..7580a32d9375 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceIPConfigurationProperties.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes a virtual machine network interface IP configuration properties. + */ +@Fluent +public final class VirtualMachineNetworkInterfaceIPConfigurationProperties + implements JsonSerializable { + /* + * Specifies the identifier of the subnet. + */ + private SubResource subnet; + + /* + * Specifies the primary network interface in case the virtual machine has more than 1 network interface. + */ + private Boolean primary; + + /* + * The 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'. + */ + private IPVersions privateIPAddressVersion; + + /* + * Specifies an array of references to application security group. + */ + 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. + */ + 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]. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("subnet", this.subnet); + jsonWriter.writeBooleanField("primary", this.primary); + jsonWriter.writeJsonField("publicIPAddressConfiguration", this.publicIPAddressConfiguration); + jsonWriter.writeStringField("privateIPAddressVersion", + this.privateIPAddressVersion == null ? null : this.privateIPAddressVersion.toString()); + jsonWriter.writeArrayField("applicationSecurityGroups", this.applicationSecurityGroups, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("applicationGatewayBackendAddressPools", this.applicationGatewayBackendAddressPools, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("loadBalancerBackendAddressPools", this.loadBalancerBackendAddressPools, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineNetworkInterfaceIPConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineNetworkInterfaceIPConfigurationProperties if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineNetworkInterfaceIPConfigurationProperties. + */ + public static VirtualMachineNetworkInterfaceIPConfigurationProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineNetworkInterfaceIPConfigurationProperties deserializedVirtualMachineNetworkInterfaceIPConfigurationProperties + = new VirtualMachineNetworkInterfaceIPConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnet".equals(fieldName)) { + deserializedVirtualMachineNetworkInterfaceIPConfigurationProperties.subnet + = SubResource.fromJson(reader); + } else if ("primary".equals(fieldName)) { + deserializedVirtualMachineNetworkInterfaceIPConfigurationProperties.primary + = reader.getNullable(JsonReader::getBoolean); + } else if ("publicIPAddressConfiguration".equals(fieldName)) { + deserializedVirtualMachineNetworkInterfaceIPConfigurationProperties.publicIPAddressConfiguration + = VirtualMachinePublicIPAddressConfiguration.fromJson(reader); + } else if ("privateIPAddressVersion".equals(fieldName)) { + deserializedVirtualMachineNetworkInterfaceIPConfigurationProperties.privateIPAddressVersion + = IPVersions.fromString(reader.getString()); + } else if ("applicationSecurityGroups".equals(fieldName)) { + List applicationSecurityGroups + = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedVirtualMachineNetworkInterfaceIPConfigurationProperties.applicationSecurityGroups + = applicationSecurityGroups; + } else if ("applicationGatewayBackendAddressPools".equals(fieldName)) { + List applicationGatewayBackendAddressPools + = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedVirtualMachineNetworkInterfaceIPConfigurationProperties.applicationGatewayBackendAddressPools + = applicationGatewayBackendAddressPools; + } else if ("loadBalancerBackendAddressPools".equals(fieldName)) { + List loadBalancerBackendAddressPools + = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedVirtualMachineNetworkInterfaceIPConfigurationProperties.loadBalancerBackendAddressPools + = loadBalancerBackendAddressPools; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineNetworkInterfaceIPConfigurationProperties; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachinePublicIPAddressConfiguration.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachinePublicIPAddressConfiguration.java new file mode 100644 index 000000000000..e833e5788440 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachinePublicIPAddressConfiguration.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Describes a virtual machines IP Configuration's PublicIPAddress configuration. + */ +@Fluent +public final class VirtualMachinePublicIPAddressConfiguration + implements JsonSerializable { + /* + * The publicIP address configuration name. + */ + private String name; + + /* + * Describes a virtual machines IP Configuration's PublicIPAddress configuration + */ + private VirtualMachinePublicIPAddressConfigurationProperties properties; + + /* + * Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. + */ + private PublicIPAddressSku sku; + + /* + * Resource tags applied to the publicIP address created by this PublicIPAddressConfiguration + */ + private Map tags; + + /** + * 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 properties property: Describes a virtual machines IP Configuration's PublicIPAddress configuration. + * + * @return the properties value. + */ + public VirtualMachinePublicIPAddressConfigurationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Describes a virtual machines IP Configuration's PublicIPAddress configuration. + * + * @param properties the properties value to set. + * @return the VirtualMachinePublicIPAddressConfiguration object itself. + */ + public VirtualMachinePublicIPAddressConfiguration + withProperties(VirtualMachinePublicIPAddressConfigurationProperties properties) { + this.properties = properties; + return this; + } + + /** + * 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 tags property: Resource tags applied to the publicIP address created by this + * PublicIPAddressConfiguration. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags applied to the publicIP address created by this + * PublicIPAddressConfiguration. + * + * @param tags the tags value to set. + * @return the VirtualMachinePublicIPAddressConfiguration object itself. + */ + public VirtualMachinePublicIPAddressConfiguration withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachinePublicIPAddressConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachinePublicIPAddressConfiguration if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualMachinePublicIPAddressConfiguration. + */ + public static VirtualMachinePublicIPAddressConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachinePublicIPAddressConfiguration deserializedVirtualMachinePublicIPAddressConfiguration + = new VirtualMachinePublicIPAddressConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVirtualMachinePublicIPAddressConfiguration.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedVirtualMachinePublicIPAddressConfiguration.properties + = VirtualMachinePublicIPAddressConfigurationProperties.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedVirtualMachinePublicIPAddressConfiguration.sku = PublicIPAddressSku.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVirtualMachinePublicIPAddressConfiguration.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachinePublicIPAddressConfiguration; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachinePublicIPAddressConfigurationProperties.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachinePublicIPAddressConfigurationProperties.java new file mode 100644 index 000000000000..3e925dbc7c92 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachinePublicIPAddressConfigurationProperties.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes a virtual machines IP Configuration's PublicIPAddress configuration. + */ +@Fluent +public final class VirtualMachinePublicIPAddressConfigurationProperties + implements JsonSerializable { + /* + * The idle timeout of the public IP address. + */ + private Integer idleTimeoutInMinutes; + + /* + * Specify what happens to the public IP address when the VM is deleted + */ + private DeleteOptions deleteOption; + + /* + * The dns settings to be applied on the publicIP addresses . + */ + private VirtualMachinePublicIPAddressDnsSettingsConfiguration dnsSettings; + + /* + * The list of IP tags associated with the public IP address. + */ + private List ipTags; + + /* + * The PublicIPPrefix from which to allocate publicIP addresses. + */ + 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'. + */ + private IPVersions publicIPAddressVersion; + + /* + * Specify the public IP allocation type + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("idleTimeoutInMinutes", this.idleTimeoutInMinutes); + jsonWriter.writeStringField("deleteOption", this.deleteOption == null ? null : this.deleteOption.toString()); + jsonWriter.writeJsonField("dnsSettings", this.dnsSettings); + jsonWriter.writeArrayField("ipTags", this.ipTags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("publicIPPrefix", this.publicIPPrefix); + jsonWriter.writeStringField("publicIPAddressVersion", + this.publicIPAddressVersion == null ? null : this.publicIPAddressVersion.toString()); + jsonWriter.writeStringField("publicIPAllocationMethod", + this.publicIPAllocationMethod == null ? null : this.publicIPAllocationMethod.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachinePublicIPAddressConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachinePublicIPAddressConfigurationProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachinePublicIPAddressConfigurationProperties. + */ + public static VirtualMachinePublicIPAddressConfigurationProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachinePublicIPAddressConfigurationProperties deserializedVirtualMachinePublicIPAddressConfigurationProperties + = new VirtualMachinePublicIPAddressConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("idleTimeoutInMinutes".equals(fieldName)) { + deserializedVirtualMachinePublicIPAddressConfigurationProperties.idleTimeoutInMinutes + = reader.getNullable(JsonReader::getInt); + } else if ("deleteOption".equals(fieldName)) { + deserializedVirtualMachinePublicIPAddressConfigurationProperties.deleteOption + = DeleteOptions.fromString(reader.getString()); + } else if ("dnsSettings".equals(fieldName)) { + deserializedVirtualMachinePublicIPAddressConfigurationProperties.dnsSettings + = VirtualMachinePublicIPAddressDnsSettingsConfiguration.fromJson(reader); + } else if ("ipTags".equals(fieldName)) { + List ipTags + = reader.readArray(reader1 -> VirtualMachineIpTag.fromJson(reader1)); + deserializedVirtualMachinePublicIPAddressConfigurationProperties.ipTags = ipTags; + } else if ("publicIPPrefix".equals(fieldName)) { + deserializedVirtualMachinePublicIPAddressConfigurationProperties.publicIPPrefix + = SubResource.fromJson(reader); + } else if ("publicIPAddressVersion".equals(fieldName)) { + deserializedVirtualMachinePublicIPAddressConfigurationProperties.publicIPAddressVersion + = IPVersions.fromString(reader.getString()); + } else if ("publicIPAllocationMethod".equals(fieldName)) { + deserializedVirtualMachinePublicIPAddressConfigurationProperties.publicIPAllocationMethod + = PublicIPAllocationMethod.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachinePublicIPAddressConfigurationProperties; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachinePublicIPAddressDnsSettingsConfiguration.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachinePublicIPAddressDnsSettingsConfiguration.java new file mode 100644 index 000000000000..c51709f81a90 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachinePublicIPAddressDnsSettingsConfiguration.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a virtual machines network configuration's DNS settings. + */ +@Fluent +public final class VirtualMachinePublicIPAddressDnsSettingsConfiguration + implements JsonSerializable { + /* + * 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. + */ + private String domainNameLabel; + + /* + * The Domain name label scope of the PublicIPAddress resources that will be created. The generated name label is + * the concatenation of the hashed domain name label with policy according to the domain name label scope and vm + * network profile unique ID. + */ + private DomainNameLabelScopeTypes domainNameLabelScope; + + /** + * 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; + } + + /** + * Get the domainNameLabelScope property: The Domain name label scope of the PublicIPAddress resources that will be + * created. The generated name label is the concatenation of the hashed domain name label with policy according to + * the domain name label scope and vm network profile unique ID. + * + * @return the domainNameLabelScope value. + */ + public DomainNameLabelScopeTypes domainNameLabelScope() { + return this.domainNameLabelScope; + } + + /** + * Set the domainNameLabelScope property: The Domain name label scope of the PublicIPAddress resources that will be + * created. The generated name label is the concatenation of the hashed domain name label with policy according to + * the domain name label scope and vm network profile unique ID. + * + * @param domainNameLabelScope the domainNameLabelScope value to set. + * @return the VirtualMachinePublicIPAddressDnsSettingsConfiguration object itself. + */ + public VirtualMachinePublicIPAddressDnsSettingsConfiguration + withDomainNameLabelScope(DomainNameLabelScopeTypes domainNameLabelScope) { + this.domainNameLabelScope = domainNameLabelScope; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("domainNameLabel", this.domainNameLabel); + jsonWriter.writeStringField("domainNameLabelScope", + this.domainNameLabelScope == null ? null : this.domainNameLabelScope.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachinePublicIPAddressDnsSettingsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachinePublicIPAddressDnsSettingsConfiguration if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualMachinePublicIPAddressDnsSettingsConfiguration. + */ + public static VirtualMachinePublicIPAddressDnsSettingsConfiguration fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachinePublicIPAddressDnsSettingsConfiguration deserializedVirtualMachinePublicIPAddressDnsSettingsConfiguration + = new VirtualMachinePublicIPAddressDnsSettingsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("domainNameLabel".equals(fieldName)) { + deserializedVirtualMachinePublicIPAddressDnsSettingsConfiguration.domainNameLabel + = reader.getString(); + } else if ("domainNameLabelScope".equals(fieldName)) { + deserializedVirtualMachinePublicIPAddressDnsSettingsConfiguration.domainNameLabelScope + = DomainNameLabelScopeTypes.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachinePublicIPAddressDnsSettingsConfiguration; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineReimageParameters.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineReimageParameters.java new file mode 100644 index 000000000000..e2dd2ca1573b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineReimageParameters.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk will always be reimaged. + */ +@Fluent +public final class VirtualMachineReimageParameters implements JsonSerializable { + /* + * 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. + */ + 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. + */ + private String exactVersion; + + /* + * Specifies information required for reimaging the non-ephemeral OS disk. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("tempDisk", this.tempDisk); + jsonWriter.writeStringField("exactVersion", this.exactVersion); + jsonWriter.writeJsonField("osProfile", this.osProfile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineReimageParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineReimageParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineReimageParameters. + */ + public static VirtualMachineReimageParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineReimageParameters deserializedVirtualMachineReimageParameters + = new VirtualMachineReimageParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tempDisk".equals(fieldName)) { + deserializedVirtualMachineReimageParameters.tempDisk = reader.getNullable(JsonReader::getBoolean); + } else if ("exactVersion".equals(fieldName)) { + deserializedVirtualMachineReimageParameters.exactVersion = reader.getString(); + } else if ("osProfile".equals(fieldName)) { + deserializedVirtualMachineReimageParameters.osProfile = OSProfileProvisioningData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineReimageParameters; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VmSizeProfile.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VmSizeProfile.java new file mode 100644 index 000000000000..f962cf8c524f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VmSizeProfile.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A VM size profile with a name and rank for flex VM creation. + */ +@Fluent +public final class VmSizeProfile implements JsonSerializable { + /* + * The name of the VM size, eg Standard_D2ads_v5 + */ + private String name; + + /* + * The rank of this VM size in the priority order + */ + private int rank; + + /** + * Creates an instance of VmSizeProfile class. + */ + public VmSizeProfile() { + } + + /** + * Get the name property: The name of the VM size, eg Standard_D2ads_v5. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the VM size, eg Standard_D2ads_v5. + * + * @param name the name value to set. + * @return the VmSizeProfile object itself. + */ + public VmSizeProfile withName(String name) { + this.name = name; + return this; + } + + /** + * Get the rank property: The rank of this VM size in the priority order. + * + * @return the rank value. + */ + public int rank() { + return this.rank; + } + + /** + * Set the rank property: The rank of this VM size in the priority order. + * + * @param rank the rank value to set. + * @return the VmSizeProfile object itself. + */ + public VmSizeProfile withRank(int rank) { + this.rank = rank; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeIntField("rank", this.rank); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VmSizeProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VmSizeProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VmSizeProfile. + */ + public static VmSizeProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VmSizeProfile deserializedVmSizeProfile = new VmSizeProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVmSizeProfile.name = reader.getString(); + } else if ("rank".equals(fieldName)) { + deserializedVmSizeProfile.rank = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedVmSizeProfile; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VmSizeProperties.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VmSizeProperties.java new file mode 100644 index 000000000000..ce26971df241 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VmSizeProperties.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies VM Size Property settings on the virtual machine. + */ +@Fluent +public final class VmSizeProperties implements JsonSerializable { + /* + * 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). + */ + 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.** + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("vCpusAvailable", this.vCpusAvailable); + jsonWriter.writeNumberField("vCpusPerCore", this.vCpusPerCore); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VmSizeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VmSizeProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VmSizeProperties. + */ + public static VmSizeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VmSizeProperties deserializedVmSizeProperties = new VmSizeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vCpusAvailable".equals(fieldName)) { + deserializedVmSizeProperties.vCpusAvailable = reader.getNullable(JsonReader::getInt); + } else if ("vCpusPerCore".equals(fieldName)) { + deserializedVmSizeProperties.vCpusPerCore = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedVmSizeProperties; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WinRMConfiguration.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WinRMConfiguration.java new file mode 100644 index 000000000000..84e28a84b4b9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WinRMConfiguration.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes Windows Remote Management configuration of the VM. + */ +@Fluent +public final class WinRMConfiguration implements JsonSerializable { + /* + * The list of Windows Remote Management 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("listeners", this.listeners, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WinRMConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WinRMConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the WinRMConfiguration. + */ + public static WinRMConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WinRMConfiguration deserializedWinRMConfiguration = new WinRMConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("listeners".equals(fieldName)) { + List listeners = reader.readArray(reader1 -> WinRMListener.fromJson(reader1)); + deserializedWinRMConfiguration.listeners = listeners; + } else { + reader.skipChildren(); + } + } + + return deserializedWinRMConfiguration; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WinRMListener.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WinRMListener.java new file mode 100644 index 000000000000..70983e6e6985 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WinRMListener.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes Protocol and thumbprint of Windows Remote Management listener. + */ +@Fluent +public final class WinRMListener implements JsonSerializable { + /* + * Specifies the protocol of WinRM listener. Possible values are: **http,** **https.** + */ + 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). + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("certificateUrl", this.certificateUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WinRMListener from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WinRMListener if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the WinRMListener. + */ + public static WinRMListener fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WinRMListener deserializedWinRMListener = new WinRMListener(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protocol".equals(fieldName)) { + deserializedWinRMListener.protocol = ProtocolTypes.fromString(reader.getString()); + } else if ("certificateUrl".equals(fieldName)) { + deserializedWinRMListener.certificateUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWinRMListener; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsConfiguration.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsConfiguration.java new file mode 100644 index 000000000000..9419b8239974 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsConfiguration.java @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Specifies Windows operating system settings on the virtual machine. + */ +@Fluent +public final class WindowsConfiguration implements JsonSerializable { + /* + * 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. + */ + 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. + */ + 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). + */ + 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. + */ + private List additionalUnattendContent; + + /* + * [Preview Feature] Specifies settings related to VM Guest Patching on Windows. + */ + private PatchSettings patchSettings; + + /* + * Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. + */ + private WinRMConfiguration winRM; + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("provisionVMAgent", this.provisionVMAgent); + jsonWriter.writeBooleanField("enableAutomaticUpdates", this.enableAutomaticUpdates); + jsonWriter.writeStringField("timeZone", this.timeZone); + jsonWriter.writeArrayField("additionalUnattendContent", this.additionalUnattendContent, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("patchSettings", this.patchSettings); + jsonWriter.writeJsonField("winRM", this.winRM); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WindowsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WindowsConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the WindowsConfiguration. + */ + public static WindowsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WindowsConfiguration deserializedWindowsConfiguration = new WindowsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisionVMAgent".equals(fieldName)) { + deserializedWindowsConfiguration.provisionVMAgent = reader.getNullable(JsonReader::getBoolean); + } else if ("enableAutomaticUpdates".equals(fieldName)) { + deserializedWindowsConfiguration.enableAutomaticUpdates + = reader.getNullable(JsonReader::getBoolean); + } else if ("timeZone".equals(fieldName)) { + deserializedWindowsConfiguration.timeZone = reader.getString(); + } else if ("additionalUnattendContent".equals(fieldName)) { + List additionalUnattendContent + = reader.readArray(reader1 -> AdditionalUnattendContent.fromJson(reader1)); + deserializedWindowsConfiguration.additionalUnattendContent = additionalUnattendContent; + } else if ("patchSettings".equals(fieldName)) { + deserializedWindowsConfiguration.patchSettings = PatchSettings.fromJson(reader); + } else if ("winRM".equals(fieldName)) { + deserializedWindowsConfiguration.winRM = WinRMConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWindowsConfiguration; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsPatchAssessmentMode.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsPatchAssessmentMode.java new file mode 100644 index 000000000000..88f95a31b9c8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsPatchAssessmentMode.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +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 { + /** + * ImageDefault patch assessment mode. + */ + public static final WindowsPatchAssessmentMode IMAGE_DEFAULT = fromString("ImageDefault"); + + /** + * AutomaticByPlatform patch assessment mode. + */ + 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsVMGuestPatchAutomaticByPlatformRebootSetting.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsVMGuestPatchAutomaticByPlatformRebootSetting.java new file mode 100644 index 000000000000..9b42fa5ac834 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsVMGuestPatchAutomaticByPlatformRebootSetting.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the reboot setting for all AutomaticByPlatform patch installation operations. + */ +public final class WindowsVMGuestPatchAutomaticByPlatformRebootSetting + extends ExpandableStringEnum { + /** + * Reboot setting for Unknown. + */ + public static final WindowsVMGuestPatchAutomaticByPlatformRebootSetting UNKNOWN = fromString("Unknown"); + + /** + * Reboot setting for IfRequired. + */ + public static final WindowsVMGuestPatchAutomaticByPlatformRebootSetting IF_REQUIRED = fromString("IfRequired"); + + /** + * Reboot setting for Never. + */ + public static final WindowsVMGuestPatchAutomaticByPlatformRebootSetting NEVER = fromString("Never"); + + /** + * Reboot setting for Always. + */ + 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java new file mode 100644 index 000000000000..512920cf87fb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies additional settings to be applied when patch mode AutomaticByPlatform is selected in Windows patch + * settings. + */ +@Fluent +public final class WindowsVMGuestPatchAutomaticByPlatformSettings + implements JsonSerializable { + /* + * Specifies the reboot setting for all AutomaticByPlatform patch installation operations. + */ + private WindowsVMGuestPatchAutomaticByPlatformRebootSetting rebootSetting; + + /* + * Enables customer to schedule patching without accidental upgrades + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("rebootSetting", this.rebootSetting == null ? null : this.rebootSetting.toString()); + jsonWriter.writeBooleanField("bypassPlatformSafetyChecksOnUserSchedule", + this.bypassPlatformSafetyChecksOnUserSchedule); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WindowsVMGuestPatchAutomaticByPlatformSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WindowsVMGuestPatchAutomaticByPlatformSettings if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WindowsVMGuestPatchAutomaticByPlatformSettings. + */ + public static WindowsVMGuestPatchAutomaticByPlatformSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WindowsVMGuestPatchAutomaticByPlatformSettings deserializedWindowsVMGuestPatchAutomaticByPlatformSettings + = new WindowsVMGuestPatchAutomaticByPlatformSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rebootSetting".equals(fieldName)) { + deserializedWindowsVMGuestPatchAutomaticByPlatformSettings.rebootSetting + = WindowsVMGuestPatchAutomaticByPlatformRebootSetting.fromString(reader.getString()); + } else if ("bypassPlatformSafetyChecksOnUserSchedule".equals(fieldName)) { + deserializedWindowsVMGuestPatchAutomaticByPlatformSettings.bypassPlatformSafetyChecksOnUserSchedule + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedWindowsVMGuestPatchAutomaticByPlatformSettings; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsVMGuestPatchMode.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsVMGuestPatchMode.java new file mode 100644 index 000000000000..dfb155560e91 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsVMGuestPatchMode.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +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 { + /** + * Manual VM guest patch mode. + */ + public static final WindowsVMGuestPatchMode MANUAL = fromString("Manual"); + + /** + * AutomaticByOS VM guest patch mode. + */ + public static final WindowsVMGuestPatchMode AUTOMATIC_BY_OS = fromString("AutomaticByOS"); + + /** + * AutomaticByPlatform VM guest patch mode. + */ + 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. + */ + 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-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ZoneAllocationPolicy.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ZoneAllocationPolicy.java new file mode 100644 index 000000000000..5189accdd686 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ZoneAllocationPolicy.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The zone allocation policy for distributing VMs across availability zones. + */ +@Fluent +public final class ZoneAllocationPolicy implements JsonSerializable { + /* + * The distribution strategy for zone allocation + */ + private DistributionStrategy distributionStrategy; + + /* + * The zone preferences for allocation priority + */ + private List zonePreferences; + + /** + * Creates an instance of ZoneAllocationPolicy class. + */ + public ZoneAllocationPolicy() { + } + + /** + * Get the distributionStrategy property: The distribution strategy for zone allocation. + * + * @return the distributionStrategy value. + */ + public DistributionStrategy distributionStrategy() { + return this.distributionStrategy; + } + + /** + * Set the distributionStrategy property: The distribution strategy for zone allocation. + * + * @param distributionStrategy the distributionStrategy value to set. + * @return the ZoneAllocationPolicy object itself. + */ + public ZoneAllocationPolicy withDistributionStrategy(DistributionStrategy distributionStrategy) { + this.distributionStrategy = distributionStrategy; + return this; + } + + /** + * Get the zonePreferences property: The zone preferences for allocation priority. + * + * @return the zonePreferences value. + */ + public List zonePreferences() { + return this.zonePreferences; + } + + /** + * Set the zonePreferences property: The zone preferences for allocation priority. + * + * @param zonePreferences the zonePreferences value to set. + * @return the ZoneAllocationPolicy object itself. + */ + public ZoneAllocationPolicy withZonePreferences(List zonePreferences) { + this.zonePreferences = zonePreferences; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("distributionStrategy", + this.distributionStrategy == null ? null : this.distributionStrategy.toString()); + jsonWriter.writeArrayField("zonePreferences", this.zonePreferences, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ZoneAllocationPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ZoneAllocationPolicy if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ZoneAllocationPolicy. + */ + public static ZoneAllocationPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ZoneAllocationPolicy deserializedZoneAllocationPolicy = new ZoneAllocationPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("distributionStrategy".equals(fieldName)) { + deserializedZoneAllocationPolicy.distributionStrategy + = DistributionStrategy.fromString(reader.getString()); + } else if ("zonePreferences".equals(fieldName)) { + List zonePreferences + = reader.readArray(reader1 -> ZonePreference.fromJson(reader1)); + deserializedZoneAllocationPolicy.zonePreferences = zonePreferences; + } else { + reader.skipChildren(); + } + } + + return deserializedZoneAllocationPolicy; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ZonePreference.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ZonePreference.java new file mode 100644 index 000000000000..05eba4024d0d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ZonePreference.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A zone preference with a zone identifier and rank. + */ +@Fluent +public final class ZonePreference implements JsonSerializable { + /* + * The zone identifier + */ + private String zone; + + /* + * The rank of this zone in the priority order + */ + private int rank; + + /** + * Creates an instance of ZonePreference class. + */ + public ZonePreference() { + } + + /** + * Get the zone property: The zone identifier. + * + * @return the zone value. + */ + public String zone() { + return this.zone; + } + + /** + * Set the zone property: The zone identifier. + * + * @param zone the zone value to set. + * @return the ZonePreference object itself. + */ + public ZonePreference withZone(String zone) { + this.zone = zone; + return this; + } + + /** + * Get the rank property: The rank of this zone in the priority order. + * + * @return the rank value. + */ + public int rank() { + return this.rank; + } + + /** + * Set the rank property: The rank of this zone in the priority order. + * + * @param rank the rank value to set. + * @return the ZonePreference object itself. + */ + public ZonePreference withRank(int rank) { + this.rank = rank; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("zone", this.zone); + jsonWriter.writeIntField("rank", this.rank); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ZonePreference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ZonePreference if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ZonePreference. + */ + public static ZonePreference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ZonePreference deserializedZonePreference = new ZonePreference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("zone".equals(fieldName)) { + deserializedZonePreference.zone = reader.getString(); + } else if ("rank".equals(fieldName)) { + deserializedZonePreference.rank = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedZonePreference; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/resources/META-INF/azure-resourcemanager-compute-bulkactions_metadata.json b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/resources/META-INF/azure-resourcemanager-compute-bulkactions_metadata.json index a1415cb055e2..ec08fdc618ed 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/resources/META-INF/azure-resourcemanager-compute-bulkactions_metadata.json +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/resources/META-INF/azure-resourcemanager-compute-bulkactions_metadata.json @@ -1 +1 @@ -{"flavor":"azure","apiVersions":{"Microsoft.Compute":"2026-06-06"},"crossLanguagePackageId":"Microsoft.Compute","crossLanguageVersion":"c177710ab919","crossLanguageDefinitions":{"com.azure.resourcemanager.compute.bulkactions.fluent.ComputeBulkActionsManagementClient":"Microsoft.Compute","com.azure.resourcemanager.compute.bulkactions.fluent.OperationsClient":"Microsoft.Compute.Operations","com.azure.resourcemanager.compute.bulkactions.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient":"Microsoft.Compute.VirtualMachineBulkOperations","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkCancelOperations":"Microsoft.Compute.VirtualMachineBulkOperations.bulkCancel","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkCancelOperationsWithResponse":"Microsoft.Compute.VirtualMachineBulkOperations.bulkCancel","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkDeallocateOperation":"Microsoft.Compute.VirtualMachineBulkOperations.bulkDeallocate","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkDeallocateOperationWithResponse":"Microsoft.Compute.VirtualMachineBulkOperations.bulkDeallocate","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkDeleteOperation":"Microsoft.Compute.VirtualMachineBulkOperations.bulkDelete","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkDeleteOperationWithResponse":"Microsoft.Compute.VirtualMachineBulkOperations.bulkDelete","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkGetOperationsStatus":"Microsoft.Compute.VirtualMachineBulkOperations.bulkGetOperationsStatus","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkGetOperationsStatusWithResponse":"Microsoft.Compute.VirtualMachineBulkOperations.bulkGetOperationsStatus","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkHibernateOperation":"Microsoft.Compute.VirtualMachineBulkOperations.bulkHibernate","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkHibernateOperationWithResponse":"Microsoft.Compute.VirtualMachineBulkOperations.bulkHibernate","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkStartOperation":"Microsoft.Compute.VirtualMachineBulkOperations.bulkStart","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkStartOperationWithResponse":"Microsoft.Compute.VirtualMachineBulkOperations.bulkStart","com.azure.resourcemanager.compute.bulkactions.fluent.models.CancelOperationsResponseInner":"Microsoft.Compute.CancelOperationsResponse","com.azure.resourcemanager.compute.bulkactions.fluent.models.DeallocateResourceOperationResponseInner":"Microsoft.Compute.DeallocateResourceOperationResponse","com.azure.resourcemanager.compute.bulkactions.fluent.models.DeleteResourceOperationResponseInner":"Microsoft.Compute.DeleteResourceOperationResponse","com.azure.resourcemanager.compute.bulkactions.fluent.models.GetOperationStatusResponseInner":"Microsoft.Compute.GetOperationStatusResponse","com.azure.resourcemanager.compute.bulkactions.fluent.models.HibernateResourceOperationResponseInner":"Microsoft.Compute.HibernateResourceOperationResponse","com.azure.resourcemanager.compute.bulkactions.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.compute.bulkactions.fluent.models.StartResourceOperationResponseInner":"Microsoft.Compute.StartResourceOperationResponse","com.azure.resourcemanager.compute.bulkactions.implementation.ComputeBulkActionsManagementClientBuilder":"Microsoft.Compute","com.azure.resourcemanager.compute.bulkactions.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.compute.bulkactions.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.compute.bulkactions.models.CancelOperationsContent":"Microsoft.Compute.CancelOperationsRequest","com.azure.resourcemanager.compute.bulkactions.models.DeadlineType":"Microsoft.Compute.DeadlineType","com.azure.resourcemanager.compute.bulkactions.models.ExecuteDeallocateContent":"Microsoft.Compute.ExecuteDeallocateRequest","com.azure.resourcemanager.compute.bulkactions.models.ExecuteDeleteContent":"Microsoft.Compute.ExecuteDeleteRequest","com.azure.resourcemanager.compute.bulkactions.models.ExecuteHibernateContent":"Microsoft.Compute.ExecuteHibernateRequest","com.azure.resourcemanager.compute.bulkactions.models.ExecuteStartContent":"Microsoft.Compute.ExecuteStartRequest","com.azure.resourcemanager.compute.bulkactions.models.ExecutionParameters":"Microsoft.Compute.ExecutionParameters","com.azure.resourcemanager.compute.bulkactions.models.FallbackOperationInfo":"Microsoft.Compute.FallbackOperationInfo","com.azure.resourcemanager.compute.bulkactions.models.GetOperationStatusContent":"Microsoft.Compute.GetOperationStatusRequest","com.azure.resourcemanager.compute.bulkactions.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.compute.bulkactions.models.OperationState":"Microsoft.Compute.OperationState","com.azure.resourcemanager.compute.bulkactions.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.compute.bulkactions.models.ResourceOperation":"Microsoft.Compute.ResourceOperation","com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationDetails":"Microsoft.Compute.ResourceOperationDetails","com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationError":"Microsoft.Compute.ResourceOperationError","com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType":"Microsoft.Compute.ResourceOperationType","com.azure.resourcemanager.compute.bulkactions.models.Resources":"Microsoft.Compute.Resources","com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy":"Microsoft.Compute.RetryPolicy"},"generatedFiles":["src/main/java/com/azure/resourcemanager/compute/bulkactions/ComputeBulkActionsManager.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/ComputeBulkActionsManagementClient.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/VirtualMachineBulkOperationsClient.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/CancelOperationsResponseInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/DeallocateResourceOperationResponseInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/DeleteResourceOperationResponseInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/GetOperationStatusResponseInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/HibernateResourceOperationResponseInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/StartResourceOperationResponseInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/package-info.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/CancelOperationsResponseImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/ComputeBulkActionsManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/ComputeBulkActionsManagementClientImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/DeallocateResourceOperationResponseImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/DeleteResourceOperationResponseImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/GetOperationStatusResponseImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/HibernateResourceOperationResponseImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/StartResourceOperationResponseImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/VirtualMachineBulkOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/VirtualMachineBulkOperationsImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/package-info.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ActionType.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CancelOperationsContent.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CancelOperationsResponse.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DeadlineType.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DeallocateResourceOperationResponse.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DeleteResourceOperationResponse.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteDeallocateContent.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteDeleteContent.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteHibernateContent.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteStartContent.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecutionParameters.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/FallbackOperationInfo.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/GetOperationStatusContent.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/GetOperationStatusResponse.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/HibernateResourceOperationResponse.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Operation.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OperationState.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Operations.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Origin.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceOperation.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceOperationDetails.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceOperationError.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceOperationType.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Resources.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/RetryPolicy.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/StartResourceOperationResponse.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineBulkOperations.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/package-info.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file +{"flavor":"azure","apiVersions":{"Microsoft.Compute":"2026-07-06-preview"},"crossLanguagePackageId":"Microsoft.Compute","crossLanguageVersion":"792a97e6ab5d","crossLanguageDefinitions":{"com.azure.resourcemanager.compute.bulkactions.fluent.ComputeBulkActionsManagementClient":"Microsoft.Compute","com.azure.resourcemanager.compute.bulkactions.fluent.LaunchBulkInstancesOperationsClient":"Microsoft.Compute.LaunchBulkInstancesOperation","com.azure.resourcemanager.compute.bulkactions.fluent.LaunchBulkInstancesOperationsClient.beginCancel":"Microsoft.Compute.LaunchBulkInstancesOperation.cancel","com.azure.resourcemanager.compute.bulkactions.fluent.LaunchBulkInstancesOperationsClient.beginCreateOrUpdate":"Microsoft.Compute.LaunchBulkInstancesOperation.createOrUpdate","com.azure.resourcemanager.compute.bulkactions.fluent.LaunchBulkInstancesOperationsClient.beginDelete":"Microsoft.Compute.LaunchBulkInstancesOperation.delete","com.azure.resourcemanager.compute.bulkactions.fluent.LaunchBulkInstancesOperationsClient.cancel":"Microsoft.Compute.LaunchBulkInstancesOperation.cancel","com.azure.resourcemanager.compute.bulkactions.fluent.LaunchBulkInstancesOperationsClient.createOrUpdate":"Microsoft.Compute.LaunchBulkInstancesOperation.createOrUpdate","com.azure.resourcemanager.compute.bulkactions.fluent.LaunchBulkInstancesOperationsClient.delete":"Microsoft.Compute.LaunchBulkInstancesOperation.delete","com.azure.resourcemanager.compute.bulkactions.fluent.LaunchBulkInstancesOperationsClient.get":"Microsoft.Compute.LaunchBulkInstancesOperation.get","com.azure.resourcemanager.compute.bulkactions.fluent.LaunchBulkInstancesOperationsClient.getOperationStatus":"Microsoft.Compute.LaunchBulkInstancesOperation.getOperationStatus","com.azure.resourcemanager.compute.bulkactions.fluent.LaunchBulkInstancesOperationsClient.getOperationStatusWithResponse":"Microsoft.Compute.LaunchBulkInstancesOperation.getOperationStatus","com.azure.resourcemanager.compute.bulkactions.fluent.LaunchBulkInstancesOperationsClient.getWithResponse":"Microsoft.Compute.LaunchBulkInstancesOperation.get","com.azure.resourcemanager.compute.bulkactions.fluent.LaunchBulkInstancesOperationsClient.listByResourceGroup":"Microsoft.Compute.LaunchBulkInstancesOperation.listByResourceGroup","com.azure.resourcemanager.compute.bulkactions.fluent.LaunchBulkInstancesOperationsClient.listBySubscription":"Microsoft.Compute.LaunchBulkInstancesOperation.listBySubscription","com.azure.resourcemanager.compute.bulkactions.fluent.LaunchBulkInstancesOperationsClient.listVirtualMachines":"Microsoft.Compute.LaunchBulkInstancesOperation.listVirtualMachines","com.azure.resourcemanager.compute.bulkactions.fluent.OperationsClient":"Microsoft.Compute.Operations","com.azure.resourcemanager.compute.bulkactions.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient":"Microsoft.Compute.VirtualMachineBulkOperations","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkAcknowledgeOperationErrors":"Microsoft.Compute.VirtualMachineBulkOperations.bulkAcknowledgeOperationErrors","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkAcknowledgeOperationErrorsWithResponse":"Microsoft.Compute.VirtualMachineBulkOperations.bulkAcknowledgeOperationErrors","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkCancelOperations":"Microsoft.Compute.VirtualMachineBulkOperations.bulkCancel","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkCancelOperationsWithResponse":"Microsoft.Compute.VirtualMachineBulkOperations.bulkCancel","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkCreateOperation":"Microsoft.Compute.VirtualMachineBulkOperations.bulkCreate","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkCreateOperationWithResponse":"Microsoft.Compute.VirtualMachineBulkOperations.bulkCreate","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkDeallocateOperation":"Microsoft.Compute.VirtualMachineBulkOperations.bulkDeallocate","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkDeallocateOperationWithResponse":"Microsoft.Compute.VirtualMachineBulkOperations.bulkDeallocate","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkDeleteOperation":"Microsoft.Compute.VirtualMachineBulkOperations.bulkDelete","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkDeleteOperationWithResponse":"Microsoft.Compute.VirtualMachineBulkOperations.bulkDelete","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkGetOperationsStatus":"Microsoft.Compute.VirtualMachineBulkOperations.bulkGetOperationsStatus","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkGetOperationsStatusWithResponse":"Microsoft.Compute.VirtualMachineBulkOperations.bulkGetOperationsStatus","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkHibernateOperation":"Microsoft.Compute.VirtualMachineBulkOperations.bulkHibernate","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkHibernateOperationWithResponse":"Microsoft.Compute.VirtualMachineBulkOperations.bulkHibernate","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkListOperationErrors":"Microsoft.Compute.VirtualMachineBulkOperations.bulkListOperationErrors","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkReimageOperation":"Microsoft.Compute.VirtualMachineBulkOperations.bulkReimage","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkReimageOperationWithResponse":"Microsoft.Compute.VirtualMachineBulkOperations.bulkReimage","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkStartOperation":"Microsoft.Compute.VirtualMachineBulkOperations.bulkStart","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkStartOperationWithResponse":"Microsoft.Compute.VirtualMachineBulkOperations.bulkStart","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkVdiFlexCreateOperation":"Microsoft.Compute.VirtualMachineBulkOperations.bulkVdiFlexCreate","com.azure.resourcemanager.compute.bulkactions.fluent.VirtualMachineBulkOperationsClient.bulkVdiFlexCreateOperationWithResponse":"Microsoft.Compute.VirtualMachineBulkOperations.bulkVdiFlexCreate","com.azure.resourcemanager.compute.bulkactions.fluent.models.AcknowledgeBulkOperationErrorsResponseInner":"Microsoft.Compute.AcknowledgeBulkOperationErrorsResponse","com.azure.resourcemanager.compute.bulkactions.fluent.models.CancelOperationsResponseInner":"Microsoft.Compute.CancelOperationsResponse","com.azure.resourcemanager.compute.bulkactions.fluent.models.CreateResourceOperationResponseInner":"Microsoft.Compute.CreateResourceOperationResponse","com.azure.resourcemanager.compute.bulkactions.fluent.models.DeallocateResourceOperationResponseInner":"Microsoft.Compute.DeallocateResourceOperationResponse","com.azure.resourcemanager.compute.bulkactions.fluent.models.DeleteResourceOperationResponseInner":"Microsoft.Compute.DeleteResourceOperationResponse","com.azure.resourcemanager.compute.bulkactions.fluent.models.GetOperationStatusResponseInner":"Microsoft.Compute.GetOperationStatusResponse","com.azure.resourcemanager.compute.bulkactions.fluent.models.HibernateResourceOperationResponseInner":"Microsoft.Compute.HibernateResourceOperationResponse","com.azure.resourcemanager.compute.bulkactions.fluent.models.LocationBasedLaunchBulkInstancesOperationInner":"Microsoft.Compute.LocationBasedLaunchBulkInstancesOperation","com.azure.resourcemanager.compute.bulkactions.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.compute.bulkactions.fluent.models.OperationStatusResultInner":"Azure.ResourceManager.CommonTypes.OperationStatusResult","com.azure.resourcemanager.compute.bulkactions.fluent.models.ReimageResourceOperationResponseInner":"Microsoft.Compute.ReimageResourceOperationResponse","com.azure.resourcemanager.compute.bulkactions.fluent.models.ResourceOperationInner":"Microsoft.Compute.ResourceOperation","com.azure.resourcemanager.compute.bulkactions.fluent.models.StartResourceOperationResponseInner":"Microsoft.Compute.StartResourceOperationResponse","com.azure.resourcemanager.compute.bulkactions.fluent.models.VirtualMachineInner":"Microsoft.Compute.VirtualMachine","com.azure.resourcemanager.compute.bulkactions.implementation.ComputeBulkActionsManagementClientBuilder":"Microsoft.Compute","com.azure.resourcemanager.compute.bulkactions.implementation.models.LaunchBulkInstancesOperationListResult":"Microsoft.Compute.LaunchBulkInstancesOperationListResult","com.azure.resourcemanager.compute.bulkactions.implementation.models.ListBulkOperationErrorsResponse":"Microsoft.Compute.ListBulkOperationErrorsResponse","com.azure.resourcemanager.compute.bulkactions.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.compute.bulkactions.implementation.models.VirtualMachineListResult":"Microsoft.Compute.VirtualMachineListResult","com.azure.resourcemanager.compute.bulkactions.models.AcceleratorManufacturer":"Microsoft.Compute.AcceleratorManufacturer","com.azure.resourcemanager.compute.bulkactions.models.AcceleratorType":"Microsoft.Compute.AcceleratorType","com.azure.resourcemanager.compute.bulkactions.models.AcknowledgeBulkOperationErrorsRequest":"Microsoft.Compute.AcknowledgeBulkOperationErrorsRequest","com.azure.resourcemanager.compute.bulkactions.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.compute.bulkactions.models.AdditionalCapabilities":"Microsoft.Compute.AdditionalCapabilities","com.azure.resourcemanager.compute.bulkactions.models.AdditionalUnattendContent":"Microsoft.Compute.AdditionalUnattendContent","com.azure.resourcemanager.compute.bulkactions.models.AdditionalUnattendContentComponentName":null,"com.azure.resourcemanager.compute.bulkactions.models.AdditionalUnattendContentPassName":null,"com.azure.resourcemanager.compute.bulkactions.models.AllInstancesDown":"Microsoft.Compute.AllInstancesDown","com.azure.resourcemanager.compute.bulkactions.models.AllocationStrategy":"Microsoft.Compute.AllocationStrategy","com.azure.resourcemanager.compute.bulkactions.models.ApiEntityReference":"Microsoft.Compute.ApiEntityReference","com.azure.resourcemanager.compute.bulkactions.models.ApiError":"Microsoft.Compute.ApiError","com.azure.resourcemanager.compute.bulkactions.models.ApiErrorBase":"Microsoft.Compute.ApiErrorBase","com.azure.resourcemanager.compute.bulkactions.models.ApplicationProfile":"Microsoft.Compute.ApplicationProfile","com.azure.resourcemanager.compute.bulkactions.models.ArchitectureType":"Microsoft.Compute.ArchitectureType","com.azure.resourcemanager.compute.bulkactions.models.BootDiagnostics":"Microsoft.Compute.BootDiagnostics","com.azure.resourcemanager.compute.bulkactions.models.BulkActionVmExtensionProperties":"Microsoft.Compute.BulkActionVmExtensionProperties","com.azure.resourcemanager.compute.bulkactions.models.BulkactionVMExtension":"Microsoft.Compute.BulkactionVMExtension","com.azure.resourcemanager.compute.bulkactions.models.BulkactionVMProperties":"Microsoft.Compute.BulkactionVMProperties","com.azure.resourcemanager.compute.bulkactions.models.CachingTypes":"Microsoft.Compute.CachingTypes","com.azure.resourcemanager.compute.bulkactions.models.CancelOperationsContent":"Microsoft.Compute.CancelOperationsRequest","com.azure.resourcemanager.compute.bulkactions.models.CapacityReservationProfile":"Microsoft.Compute.CapacityReservationProfile","com.azure.resourcemanager.compute.bulkactions.models.CapacityType":"Microsoft.Compute.CapacityType","com.azure.resourcemanager.compute.bulkactions.models.ComputeProfile":"Microsoft.Compute.ComputeProfile","com.azure.resourcemanager.compute.bulkactions.models.CpuManufacturer":"Microsoft.Compute.CpuManufacturer","com.azure.resourcemanager.compute.bulkactions.models.DataDisk":"Microsoft.Compute.DataDisk","com.azure.resourcemanager.compute.bulkactions.models.DeadlineType":"Microsoft.Compute.DeadlineType","com.azure.resourcemanager.compute.bulkactions.models.DeleteOptions":"Microsoft.Compute.DeleteOptions","com.azure.resourcemanager.compute.bulkactions.models.DiagnosticsProfile":"Microsoft.Compute.DiagnosticsProfile","com.azure.resourcemanager.compute.bulkactions.models.DiffDiskOptions":"Microsoft.Compute.DiffDiskOptions","com.azure.resourcemanager.compute.bulkactions.models.DiffDiskPlacement":"Microsoft.Compute.DiffDiskPlacement","com.azure.resourcemanager.compute.bulkactions.models.DiffDiskSettings":"Microsoft.Compute.DiffDiskSettings","com.azure.resourcemanager.compute.bulkactions.models.DiskControllerTypes":"Microsoft.Compute.DiskControllerTypes","com.azure.resourcemanager.compute.bulkactions.models.DiskCreateOptionTypes":"Microsoft.Compute.DiskCreateOptionTypes","com.azure.resourcemanager.compute.bulkactions.models.DiskDeleteOptionTypes":"Microsoft.Compute.DiskDeleteOptionTypes","com.azure.resourcemanager.compute.bulkactions.models.DiskDetachOptionTypes":"Microsoft.Compute.DiskDetachOptionTypes","com.azure.resourcemanager.compute.bulkactions.models.DiskEncryptionSetParametersContent":"Microsoft.Compute.DiskEncryptionSetParameters","com.azure.resourcemanager.compute.bulkactions.models.DiskEncryptionSettings":"Microsoft.Compute.DiskEncryptionSettings","com.azure.resourcemanager.compute.bulkactions.models.DistributionStrategy":"Microsoft.Compute.DistributionStrategy","com.azure.resourcemanager.compute.bulkactions.models.DomainNameLabelScopeTypes":"Microsoft.Compute.DomainNameLabelScopeTypes","com.azure.resourcemanager.compute.bulkactions.models.EncryptionIdentity":"Microsoft.Compute.EncryptionIdentity","com.azure.resourcemanager.compute.bulkactions.models.EventGridAndResourceGraph":"Microsoft.Compute.EventGridAndResourceGraph","com.azure.resourcemanager.compute.bulkactions.models.EvictionPolicy":"Microsoft.Compute.EvictionPolicy","com.azure.resourcemanager.compute.bulkactions.models.ExecuteCreateContent":"Microsoft.Compute.ExecuteCreateRequest","com.azure.resourcemanager.compute.bulkactions.models.ExecuteDeallocateContent":"Microsoft.Compute.ExecuteDeallocateRequest","com.azure.resourcemanager.compute.bulkactions.models.ExecuteDeleteContent":"Microsoft.Compute.ExecuteDeleteRequest","com.azure.resourcemanager.compute.bulkactions.models.ExecuteHibernateContent":"Microsoft.Compute.ExecuteHibernateRequest","com.azure.resourcemanager.compute.bulkactions.models.ExecuteReimageRequest":"Microsoft.Compute.ExecuteReimageRequest","com.azure.resourcemanager.compute.bulkactions.models.ExecuteStartContent":"Microsoft.Compute.ExecuteStartRequest","com.azure.resourcemanager.compute.bulkactions.models.ExecuteVdiCreateRequest":"Microsoft.Compute.ExecuteVdiCreateRequest","com.azure.resourcemanager.compute.bulkactions.models.ExecutionParameters":"Microsoft.Compute.ExecutionParameters","com.azure.resourcemanager.compute.bulkactions.models.FallbackOperationInfo":"Microsoft.Compute.FallbackOperationInfo","com.azure.resourcemanager.compute.bulkactions.models.FlexProperties":"Microsoft.Compute.FlexProperties","com.azure.resourcemanager.compute.bulkactions.models.GetOperationStatusContent":"Microsoft.Compute.GetOperationStatusRequest","com.azure.resourcemanager.compute.bulkactions.models.HardwareProfile":"Microsoft.Compute.HardwareProfile","com.azure.resourcemanager.compute.bulkactions.models.HostEndpointSettings":"Microsoft.Compute.HostEndpointSettings","com.azure.resourcemanager.compute.bulkactions.models.HyperVGeneration":"Microsoft.Compute.HyperVGeneration","com.azure.resourcemanager.compute.bulkactions.models.IPVersions":"Microsoft.Compute.IPVersions","com.azure.resourcemanager.compute.bulkactions.models.ImageReference":"Microsoft.Compute.ImageReference","com.azure.resourcemanager.compute.bulkactions.models.InnerError":"Microsoft.Compute.InnerError","com.azure.resourcemanager.compute.bulkactions.models.KeyVaultKeyReference":"Microsoft.Compute.KeyVaultKeyReference","com.azure.resourcemanager.compute.bulkactions.models.KeyVaultSecretReference":"Microsoft.Compute.KeyVaultSecretReference","com.azure.resourcemanager.compute.bulkactions.models.LaunchBulkInstancesOperationProperties":"Microsoft.Compute.LaunchBulkInstancesOperationProperties","com.azure.resourcemanager.compute.bulkactions.models.LinuxConfiguration":"Microsoft.Compute.LinuxConfiguration","com.azure.resourcemanager.compute.bulkactions.models.LinuxPatchAssessmentMode":"Microsoft.Compute.LinuxPatchAssessmentMode","com.azure.resourcemanager.compute.bulkactions.models.LinuxPatchSettings":"Microsoft.Compute.LinuxPatchSettings","com.azure.resourcemanager.compute.bulkactions.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting":"Microsoft.Compute.LinuxVMGuestPatchAutomaticByPlatformRebootSetting","com.azure.resourcemanager.compute.bulkactions.models.LinuxVMGuestPatchAutomaticByPlatformSettings":"Microsoft.Compute.LinuxVMGuestPatchAutomaticByPlatformSettings","com.azure.resourcemanager.compute.bulkactions.models.LinuxVMGuestPatchMode":"Microsoft.Compute.LinuxVMGuestPatchMode","com.azure.resourcemanager.compute.bulkactions.models.LocalStorageDiskType":"Microsoft.Compute.LocalStorageDiskType","com.azure.resourcemanager.compute.bulkactions.models.ManagedDiskParametersContent":"Microsoft.Compute.ManagedDiskParameters","com.azure.resourcemanager.compute.bulkactions.models.ManagedServiceIdentity":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentity","com.azure.resourcemanager.compute.bulkactions.models.ManagedServiceIdentityType":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType","com.azure.resourcemanager.compute.bulkactions.models.Mode":"Microsoft.Compute.Mode","com.azure.resourcemanager.compute.bulkactions.models.Modes":"Microsoft.Compute.Modes","com.azure.resourcemanager.compute.bulkactions.models.NetworkApiVersion":"Microsoft.Compute.NetworkApiVersion","com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceAuxiliaryMode":"Microsoft.Compute.NetworkInterfaceAuxiliaryMode","com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceAuxiliarySku":"Microsoft.Compute.NetworkInterfaceAuxiliarySku","com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceReference":"Microsoft.Compute.NetworkInterfaceReference","com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceReferenceProperties":"Microsoft.Compute.NetworkInterfaceReferenceProperties","com.azure.resourcemanager.compute.bulkactions.models.NetworkProfile":"Microsoft.Compute.NetworkProfile","com.azure.resourcemanager.compute.bulkactions.models.OSDisk":"Microsoft.Compute.OSDisk","com.azure.resourcemanager.compute.bulkactions.models.OSImageNotificationProfile":"Microsoft.Compute.OSImageNotificationProfile","com.azure.resourcemanager.compute.bulkactions.models.OSProfile":"Microsoft.Compute.OSProfile","com.azure.resourcemanager.compute.bulkactions.models.OSProfileProvisioningData":"Microsoft.Compute.OSProfileProvisioningData","com.azure.resourcemanager.compute.bulkactions.models.OperatingSystemTypes":"Microsoft.Compute.OperatingSystemTypes","com.azure.resourcemanager.compute.bulkactions.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.compute.bulkactions.models.OperationState":"Microsoft.Compute.OperationState","com.azure.resourcemanager.compute.bulkactions.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.compute.bulkactions.models.OsType":"Microsoft.Compute.OsType","com.azure.resourcemanager.compute.bulkactions.models.PatchSettings":"Microsoft.Compute.PatchSettings","com.azure.resourcemanager.compute.bulkactions.models.Plan":"Azure.ResourceManager.CommonTypes.Plan","com.azure.resourcemanager.compute.bulkactions.models.PriorityProfile":"Microsoft.Compute.PriorityProfile","com.azure.resourcemanager.compute.bulkactions.models.PriorityType":"Microsoft.Compute.PriorityType","com.azure.resourcemanager.compute.bulkactions.models.ProtocolTypes":"Microsoft.Compute.ProtocolTypes","com.azure.resourcemanager.compute.bulkactions.models.ProvisioningState":"Microsoft.Compute.ProvisioningState","com.azure.resourcemanager.compute.bulkactions.models.ProxyAgentSettings":"Microsoft.Compute.ProxyAgentSettings","com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSku":"Microsoft.Compute.PublicIPAddressSku","com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSkuName":"Microsoft.Compute.PublicIPAddressSkuName","com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSkuTier":"Microsoft.Compute.PublicIPAddressSkuTier","com.azure.resourcemanager.compute.bulkactions.models.PublicIPAllocationMethod":"Microsoft.Compute.PublicIPAllocationMethod","com.azure.resourcemanager.compute.bulkactions.models.ReimagePayload":"Microsoft.Compute.ReimagePayload","com.azure.resourcemanager.compute.bulkactions.models.ReimageResourceOverride":"Microsoft.Compute.ReimageResourceOverride","com.azure.resourcemanager.compute.bulkactions.models.ResourceNotificationDetails":"Microsoft.Compute.ResourceNotificationDetails","com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationDetails":"Microsoft.Compute.ResourceOperationDetails","com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationError":"Microsoft.Compute.ResourceOperationError","com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType":"Microsoft.Compute.ResourceOperationType","com.azure.resourcemanager.compute.bulkactions.models.ResourceProvisionPayload":"Microsoft.Compute.ResourceProvisionPayload","com.azure.resourcemanager.compute.bulkactions.models.ResourceProvisionVdiPayload":"Microsoft.Compute.ResourceProvisionVdiPayload","com.azure.resourcemanager.compute.bulkactions.models.ResourceWithContext":"Microsoft.Compute.ResourceWithContext","com.azure.resourcemanager.compute.bulkactions.models.Resources":"Microsoft.Compute.Resources","com.azure.resourcemanager.compute.bulkactions.models.ResourcesWithContext":"Microsoft.Compute.ResourcesWithContext","com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy":"Microsoft.Compute.RetryPolicy","com.azure.resourcemanager.compute.bulkactions.models.ScheduledEventsAdditionalPublishingTargets":"Microsoft.Compute.ScheduledEventsAdditionalPublishingTargets","com.azure.resourcemanager.compute.bulkactions.models.ScheduledEventsPolicy":"Microsoft.Compute.ScheduledEventsPolicy","com.azure.resourcemanager.compute.bulkactions.models.ScheduledEventsProfile":"Microsoft.Compute.ScheduledEventsProfile","com.azure.resourcemanager.compute.bulkactions.models.SecurityEncryptionTypes":"Microsoft.Compute.SecurityEncryptionTypes","com.azure.resourcemanager.compute.bulkactions.models.SecurityProfile":"Microsoft.Compute.SecurityProfile","com.azure.resourcemanager.compute.bulkactions.models.SecurityTypes":"Microsoft.Compute.SecurityTypes","com.azure.resourcemanager.compute.bulkactions.models.SettingNames":"Microsoft.Compute.SettingNames","com.azure.resourcemanager.compute.bulkactions.models.SshConfiguration":"Microsoft.Compute.SshConfiguration","com.azure.resourcemanager.compute.bulkactions.models.SshPublicKey":"Microsoft.Compute.SshPublicKey","com.azure.resourcemanager.compute.bulkactions.models.StorageAccountTypes":"Microsoft.Compute.StorageAccountTypes","com.azure.resourcemanager.compute.bulkactions.models.StorageProfile":"Microsoft.Compute.StorageProfile","com.azure.resourcemanager.compute.bulkactions.models.TerminateNotificationProfile":"Microsoft.Compute.TerminateNotificationProfile","com.azure.resourcemanager.compute.bulkactions.models.UefiSettings":"Microsoft.Compute.UefiSettings","com.azure.resourcemanager.compute.bulkactions.models.UserAssignedIdentity":"Azure.ResourceManager.CommonTypes.UserAssignedIdentity","com.azure.resourcemanager.compute.bulkactions.models.UserInitiatedReboot":"Microsoft.Compute.UserInitiatedReboot","com.azure.resourcemanager.compute.bulkactions.models.UserInitiatedRedeploy":"Microsoft.Compute.UserInitiatedRedeploy","com.azure.resourcemanager.compute.bulkactions.models.VMAttributeMinMaxDouble":"Microsoft.Compute.VMAttributeMinMaxDouble","com.azure.resourcemanager.compute.bulkactions.models.VMAttributeMinMaxInteger":"Microsoft.Compute.VMAttributeMinMaxInteger","com.azure.resourcemanager.compute.bulkactions.models.VMAttributeSupport":"Microsoft.Compute.VMAttributeSupport","com.azure.resourcemanager.compute.bulkactions.models.VMAttributes":"Microsoft.Compute.VMAttributes","com.azure.resourcemanager.compute.bulkactions.models.VMCategory":"Microsoft.Compute.VMCategory","com.azure.resourcemanager.compute.bulkactions.models.VMDiskSecurityProfile":"Microsoft.Compute.VMDiskSecurityProfile","com.azure.resourcemanager.compute.bulkactions.models.VMGalleryApplication":"Microsoft.Compute.VMGalleryApplication","com.azure.resourcemanager.compute.bulkactions.models.VMOperationStatus":"Microsoft.Compute.VMOperationStatus","com.azure.resourcemanager.compute.bulkactions.models.VaultCertificate":"Microsoft.Compute.VaultCertificate","com.azure.resourcemanager.compute.bulkactions.models.VaultSecretGroup":"Microsoft.Compute.VaultSecretGroup","com.azure.resourcemanager.compute.bulkactions.models.VirtualHardDisk":"Microsoft.Compute.VirtualHardDisk","com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineInfo":"Microsoft.Compute.VirtualMachineInfo","com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineIpTag":"Microsoft.Compute.VirtualMachineIpTag","com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceConfiguration":"Microsoft.Compute.VirtualMachineNetworkInterfaceConfiguration","com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceConfigurationProperties":"Microsoft.Compute.VirtualMachineNetworkInterfaceConfigurationProperties","com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceDnsSettingsConfiguration":"Microsoft.Compute.VirtualMachineNetworkInterfaceDnsSettingsConfiguration","com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceIPConfiguration":"Microsoft.Compute.VirtualMachineNetworkInterfaceIPConfiguration","com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceIPConfigurationProperties":"Microsoft.Compute.VirtualMachineNetworkInterfaceIPConfigurationProperties","com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressConfiguration":"Microsoft.Compute.VirtualMachinePublicIPAddressConfiguration","com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressConfigurationProperties":"Microsoft.Compute.VirtualMachinePublicIPAddressConfigurationProperties","com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressDnsSettingsConfiguration":"Microsoft.Compute.VirtualMachinePublicIPAddressDnsSettingsConfiguration","com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineReimageParameters":"Microsoft.Compute.VirtualMachineReimageParameters","com.azure.resourcemanager.compute.bulkactions.models.VmSizeProfile":"Microsoft.Compute.VmSizeProfile","com.azure.resourcemanager.compute.bulkactions.models.VmSizeProperties":"Microsoft.Compute.VmSizeProperties","com.azure.resourcemanager.compute.bulkactions.models.WinRMConfiguration":"Microsoft.Compute.WinRMConfiguration","com.azure.resourcemanager.compute.bulkactions.models.WinRMListener":"Microsoft.Compute.WinRMListener","com.azure.resourcemanager.compute.bulkactions.models.WindowsConfiguration":"Microsoft.Compute.WindowsConfiguration","com.azure.resourcemanager.compute.bulkactions.models.WindowsPatchAssessmentMode":"Microsoft.Compute.WindowsPatchAssessmentMode","com.azure.resourcemanager.compute.bulkactions.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting":"Microsoft.Compute.WindowsVMGuestPatchAutomaticByPlatformRebootSetting","com.azure.resourcemanager.compute.bulkactions.models.WindowsVMGuestPatchAutomaticByPlatformSettings":"Microsoft.Compute.WindowsVMGuestPatchAutomaticByPlatformSettings","com.azure.resourcemanager.compute.bulkactions.models.WindowsVMGuestPatchMode":"Microsoft.Compute.WindowsVMGuestPatchMode","com.azure.resourcemanager.compute.bulkactions.models.ZoneAllocationPolicy":"Microsoft.Compute.ZoneAllocationPolicy","com.azure.resourcemanager.compute.bulkactions.models.ZonePreference":"Microsoft.Compute.ZonePreference"},"generatedFiles":["src/main/java/com/azure/resourcemanager/compute/bulkactions/ComputeBulkActionsManager.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/ComputeBulkActionsManagementClient.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/LaunchBulkInstancesOperationsClient.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/VirtualMachineBulkOperationsClient.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/AcknowledgeBulkOperationErrorsResponseInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/CancelOperationsResponseInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/CreateResourceOperationResponseInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/DeallocateResourceOperationResponseInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/DeleteResourceOperationResponseInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/GetOperationStatusResponseInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/HibernateResourceOperationResponseInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/LocationBasedLaunchBulkInstancesOperationInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/OperationStatusResultInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/ReimageResourceOperationResponseInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/ResourceOperationInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/StartResourceOperationResponseInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/VirtualMachineInner.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/fluent/package-info.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/AcknowledgeBulkOperationErrorsResponseImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/CancelOperationsResponseImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/ComputeBulkActionsManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/ComputeBulkActionsManagementClientImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/CreateResourceOperationResponseImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/DeallocateResourceOperationResponseImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/DeleteResourceOperationResponseImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/GetOperationStatusResponseImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/HibernateResourceOperationResponseImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/LaunchBulkInstancesOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/LaunchBulkInstancesOperationsImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/LocationBasedLaunchBulkInstancesOperationImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/OperationStatusResultImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/ReimageResourceOperationResponseImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/ResourceOperationImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/StartResourceOperationResponseImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/VirtualMachineBulkOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/VirtualMachineBulkOperationsImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/VirtualMachineImpl.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/models/LaunchBulkInstancesOperationListResult.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/models/ListBulkOperationErrorsResponse.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/models/VirtualMachineListResult.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/implementation/package-info.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AcceleratorManufacturer.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AcceleratorType.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AcknowledgeBulkOperationErrorsRequest.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AcknowledgeBulkOperationErrorsResponse.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ActionType.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AdditionalCapabilities.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AdditionalUnattendContent.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AdditionalUnattendContentComponentName.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AdditionalUnattendContentPassName.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AllInstancesDown.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/AllocationStrategy.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ApiEntityReference.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ApiError.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ApiErrorBase.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ApplicationProfile.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ArchitectureType.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/BootDiagnostics.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/BulkActionVmExtensionProperties.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/BulkactionVMExtension.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/BulkactionVMProperties.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CachingTypes.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CancelOperationsContent.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CancelOperationsResponse.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CapacityReservationProfile.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CapacityType.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ComputeProfile.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CpuManufacturer.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/CreateResourceOperationResponse.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DataDisk.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DeadlineType.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DeallocateResourceOperationResponse.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DeleteOptions.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DeleteResourceOperationResponse.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiagnosticsProfile.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiffDiskOptions.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiffDiskPlacement.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiffDiskSettings.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskControllerTypes.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskCreateOptionTypes.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskDeleteOptionTypes.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskDetachOptionTypes.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskEncryptionSetParametersContent.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DiskEncryptionSettings.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DistributionStrategy.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/DomainNameLabelScopeTypes.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/EncryptionIdentity.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/EventGridAndResourceGraph.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/EvictionPolicy.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteCreateContent.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteDeallocateContent.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteDeleteContent.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteHibernateContent.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteReimageRequest.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteStartContent.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecuteVdiCreateRequest.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ExecutionParameters.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/FallbackOperationInfo.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/FlexProperties.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/GetOperationStatusContent.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/GetOperationStatusResponse.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/HardwareProfile.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/HibernateResourceOperationResponse.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/HostEndpointSettings.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/HyperVGeneration.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/IPVersions.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ImageReference.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/InnerError.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/KeyVaultKeyReference.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/KeyVaultSecretReference.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LaunchBulkInstancesOperationProperties.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LaunchBulkInstancesOperations.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxConfiguration.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxPatchAssessmentMode.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxPatchSettings.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxVMGuestPatchAutomaticByPlatformRebootSetting.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxVMGuestPatchAutomaticByPlatformSettings.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LinuxVMGuestPatchMode.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LocalStorageDiskType.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/LocationBasedLaunchBulkInstancesOperation.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ManagedDiskParametersContent.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ManagedServiceIdentityType.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Mode.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Modes.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkApiVersion.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkInterfaceAuxiliaryMode.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkInterfaceAuxiliarySku.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkInterfaceReference.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkInterfaceReferenceProperties.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/NetworkProfile.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OSDisk.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OSImageNotificationProfile.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OSProfile.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OSProfileProvisioningData.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OperatingSystemTypes.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Operation.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OperationState.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OperationStatusResult.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Operations.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Origin.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/OsType.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PatchSettings.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Plan.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PriorityProfile.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PriorityType.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ProtocolTypes.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ProxyAgentSettings.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PublicIPAddressSku.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PublicIPAddressSkuName.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PublicIPAddressSkuTier.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/PublicIPAllocationMethod.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ReimagePayload.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ReimageResourceOperationResponse.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ReimageResourceOverride.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceNotificationDetails.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceOperation.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceOperationDetails.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceOperationError.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceOperationType.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceProvisionPayload.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceProvisionVdiPayload.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourceWithContext.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/Resources.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ResourcesWithContext.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/RetryPolicy.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ScheduledEventsAdditionalPublishingTargets.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ScheduledEventsPolicy.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ScheduledEventsProfile.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SecurityEncryptionTypes.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SecurityProfile.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SecurityTypes.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SettingNames.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SshConfiguration.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/SshPublicKey.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/StartResourceOperationResponse.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/StorageAccountTypes.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/StorageProfile.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/TerminateNotificationProfile.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/UefiSettings.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/UserInitiatedReboot.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/UserInitiatedRedeploy.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMAttributeMinMaxDouble.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMAttributeMinMaxInteger.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMAttributeSupport.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMAttributes.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMCategory.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMDiskSecurityProfile.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMGalleryApplication.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VMOperationStatus.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VaultCertificate.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VaultSecretGroup.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualHardDisk.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachine.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineBulkOperations.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineInfo.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineIpTag.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceConfiguration.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceConfigurationProperties.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceDnsSettingsConfiguration.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceIPConfiguration.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineNetworkInterfaceIPConfigurationProperties.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachinePublicIPAddressConfiguration.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachinePublicIPAddressConfigurationProperties.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachinePublicIPAddressDnsSettingsConfiguration.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VirtualMachineReimageParameters.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VmSizeProfile.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/VmSizeProperties.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WinRMConfiguration.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WinRMListener.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsConfiguration.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsPatchAssessmentMode.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsVMGuestPatchAutomaticByPlatformRebootSetting.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/WindowsVMGuestPatchMode.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ZoneAllocationPolicy.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/ZonePreference.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/models/package-info.java","src/main/java/com/azure/resourcemanager/compute/bulkactions/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-compute-bulkactions/proxy-config.json b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-compute-bulkactions/proxy-config.json index 8536909ac99c..176cee016589 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-compute-bulkactions/proxy-config.json +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-compute-bulkactions/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.compute.bulkactions.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.compute.bulkactions.implementation.VirtualMachineBulkOperationsClientImpl$VirtualMachineBulkOperationsService"]] \ No newline at end of file +[["com.azure.resourcemanager.compute.bulkactions.implementation.LaunchBulkInstancesOperationsClientImpl$LaunchBulkInstancesOperationsService"],["com.azure.resourcemanager.compute.bulkactions.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.compute.bulkactions.implementation.VirtualMachineBulkOperationsClientImpl$VirtualMachineBulkOperationsService"]] \ No newline at end of file diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationCancelSamples.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationCancelSamples.java new file mode 100644 index 000000000000..04671fcbefd9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationCancelSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +/** + * Samples for LaunchBulkInstancesOperation Cancel. + */ +public final class LaunchBulkInstancesOperationCancelSamples { + /* + * x-ms-original-file: 2026-07-06-preview/LaunchBulkInstancesOperation_Cancel_MaximumSet_Gen.json + */ + /** + * Sample code: LaunchBulkInstancesOperation_Cancel_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void launchBulkInstancesOperationCancelExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.launchBulkInstancesOperations() + .cancel("rgBulkactions", "useast2euap", "434d5a2a-167a-4e26-a89c-fbe622dfd0bc", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationCreateOrUpdateSamples.java new file mode 100644 index 000000000000..c6a2bc57e444 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationCreateOrUpdateSamples.java @@ -0,0 +1,477 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.bulkactions.models.AcceleratorManufacturer; +import com.azure.resourcemanager.compute.bulkactions.models.AcceleratorType; +import com.azure.resourcemanager.compute.bulkactions.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.bulkactions.models.AdditionalUnattendContent; +import com.azure.resourcemanager.compute.bulkactions.models.AdditionalUnattendContentComponentName; +import com.azure.resourcemanager.compute.bulkactions.models.AdditionalUnattendContentPassName; +import com.azure.resourcemanager.compute.bulkactions.models.AllInstancesDown; +import com.azure.resourcemanager.compute.bulkactions.models.AllocationStrategy; +import com.azure.resourcemanager.compute.bulkactions.models.ApiEntityReference; +import com.azure.resourcemanager.compute.bulkactions.models.ApplicationProfile; +import com.azure.resourcemanager.compute.bulkactions.models.ArchitectureType; +import com.azure.resourcemanager.compute.bulkactions.models.BootDiagnostics; +import com.azure.resourcemanager.compute.bulkactions.models.BulkActionVmExtensionProperties; +import com.azure.resourcemanager.compute.bulkactions.models.BulkactionVMExtension; +import com.azure.resourcemanager.compute.bulkactions.models.BulkactionVMProperties; +import com.azure.resourcemanager.compute.bulkactions.models.CachingTypes; +import com.azure.resourcemanager.compute.bulkactions.models.CapacityReservationProfile; +import com.azure.resourcemanager.compute.bulkactions.models.CapacityType; +import com.azure.resourcemanager.compute.bulkactions.models.ComputeProfile; +import com.azure.resourcemanager.compute.bulkactions.models.CpuManufacturer; +import com.azure.resourcemanager.compute.bulkactions.models.DataDisk; +import com.azure.resourcemanager.compute.bulkactions.models.DeleteOptions; +import com.azure.resourcemanager.compute.bulkactions.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.bulkactions.models.DiffDiskOptions; +import com.azure.resourcemanager.compute.bulkactions.models.DiffDiskPlacement; +import com.azure.resourcemanager.compute.bulkactions.models.DiffDiskSettings; +import com.azure.resourcemanager.compute.bulkactions.models.DiskControllerTypes; +import com.azure.resourcemanager.compute.bulkactions.models.DiskCreateOptionTypes; +import com.azure.resourcemanager.compute.bulkactions.models.DiskDeleteOptionTypes; +import com.azure.resourcemanager.compute.bulkactions.models.DiskDetachOptionTypes; +import com.azure.resourcemanager.compute.bulkactions.models.DiskEncryptionSetParametersContent; +import com.azure.resourcemanager.compute.bulkactions.models.DiskEncryptionSettings; +import com.azure.resourcemanager.compute.bulkactions.models.DistributionStrategy; +import com.azure.resourcemanager.compute.bulkactions.models.DomainNameLabelScopeTypes; +import com.azure.resourcemanager.compute.bulkactions.models.EncryptionIdentity; +import com.azure.resourcemanager.compute.bulkactions.models.EventGridAndResourceGraph; +import com.azure.resourcemanager.compute.bulkactions.models.EvictionPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.HardwareProfile; +import com.azure.resourcemanager.compute.bulkactions.models.HostEndpointSettings; +import com.azure.resourcemanager.compute.bulkactions.models.HyperVGeneration; +import com.azure.resourcemanager.compute.bulkactions.models.IPVersions; +import com.azure.resourcemanager.compute.bulkactions.models.ImageReference; +import com.azure.resourcemanager.compute.bulkactions.models.KeyVaultKeyReference; +import com.azure.resourcemanager.compute.bulkactions.models.KeyVaultSecretReference; +import com.azure.resourcemanager.compute.bulkactions.models.LaunchBulkInstancesOperationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.LinuxConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.LinuxPatchAssessmentMode; +import com.azure.resourcemanager.compute.bulkactions.models.LinuxPatchSettings; +import com.azure.resourcemanager.compute.bulkactions.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.compute.bulkactions.models.LinuxVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.compute.bulkactions.models.LinuxVMGuestPatchMode; +import com.azure.resourcemanager.compute.bulkactions.models.LocalStorageDiskType; +import com.azure.resourcemanager.compute.bulkactions.models.ManagedDiskParametersContent; +import com.azure.resourcemanager.compute.bulkactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.compute.bulkactions.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.compute.bulkactions.models.Mode; +import com.azure.resourcemanager.compute.bulkactions.models.Modes; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkApiVersion; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceAuxiliarySku; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceReference; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceReferenceProperties; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkProfile; +import com.azure.resourcemanager.compute.bulkactions.models.OSDisk; +import com.azure.resourcemanager.compute.bulkactions.models.OSImageNotificationProfile; +import com.azure.resourcemanager.compute.bulkactions.models.OSProfile; +import com.azure.resourcemanager.compute.bulkactions.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.bulkactions.models.PatchSettings; +import com.azure.resourcemanager.compute.bulkactions.models.Plan; +import com.azure.resourcemanager.compute.bulkactions.models.PriorityProfile; +import com.azure.resourcemanager.compute.bulkactions.models.PriorityType; +import com.azure.resourcemanager.compute.bulkactions.models.ProtocolTypes; +import com.azure.resourcemanager.compute.bulkactions.models.ProxyAgentSettings; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSku; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSkuName; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSkuTier; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAllocationMethod; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType; +import com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.ScheduledEventsAdditionalPublishingTargets; +import com.azure.resourcemanager.compute.bulkactions.models.ScheduledEventsPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.ScheduledEventsProfile; +import com.azure.resourcemanager.compute.bulkactions.models.SecurityEncryptionTypes; +import com.azure.resourcemanager.compute.bulkactions.models.SecurityProfile; +import com.azure.resourcemanager.compute.bulkactions.models.SecurityTypes; +import com.azure.resourcemanager.compute.bulkactions.models.SettingNames; +import com.azure.resourcemanager.compute.bulkactions.models.SshConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.SshPublicKey; +import com.azure.resourcemanager.compute.bulkactions.models.StorageAccountTypes; +import com.azure.resourcemanager.compute.bulkactions.models.StorageProfile; +import com.azure.resourcemanager.compute.bulkactions.models.TerminateNotificationProfile; +import com.azure.resourcemanager.compute.bulkactions.models.UefiSettings; +import com.azure.resourcemanager.compute.bulkactions.models.UserAssignedIdentity; +import com.azure.resourcemanager.compute.bulkactions.models.UserInitiatedReboot; +import com.azure.resourcemanager.compute.bulkactions.models.UserInitiatedRedeploy; +import com.azure.resourcemanager.compute.bulkactions.models.VMAttributeMinMaxDouble; +import com.azure.resourcemanager.compute.bulkactions.models.VMAttributeMinMaxInteger; +import com.azure.resourcemanager.compute.bulkactions.models.VMAttributeSupport; +import com.azure.resourcemanager.compute.bulkactions.models.VMAttributes; +import com.azure.resourcemanager.compute.bulkactions.models.VMCategory; +import com.azure.resourcemanager.compute.bulkactions.models.VMDiskSecurityProfile; +import com.azure.resourcemanager.compute.bulkactions.models.VMGalleryApplication; +import com.azure.resourcemanager.compute.bulkactions.models.VaultCertificate; +import com.azure.resourcemanager.compute.bulkactions.models.VaultSecretGroup; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualHardDisk; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineIpTag; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceConfigurationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceDnsSettingsConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceIPConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceIPConfigurationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressConfigurationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressDnsSettingsConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VmSizeProfile; +import com.azure.resourcemanager.compute.bulkactions.models.VmSizeProperties; +import com.azure.resourcemanager.compute.bulkactions.models.WinRMConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.WinRMListener; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsPatchAssessmentMode; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsVMGuestPatchMode; +import com.azure.resourcemanager.compute.bulkactions.models.ZoneAllocationPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.ZonePreference; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LaunchBulkInstancesOperation CreateOrUpdate. + */ +public final class LaunchBulkInstancesOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-07-06-preview/LaunchBulkInstancesOperation_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: LaunchBulkInstancesOperation_CreateOrUpdate_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void launchBulkInstancesOperationCreateOrUpdateExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.launchBulkInstancesOperations() + .define("4ad45156-c829-4cd4-aafa-ecabe28aa029") + .withExistingLocation("rgBulkactions", "useast2euap") + .withTags(mapOf("key1909", "fakeTokenPlaceholder")) + .withProperties(new LaunchBulkInstancesOperationProperties().withCapacity(21) + .withCapacityType(CapacityType.VM) + .withPriorityProfile(new PriorityProfile().withType(PriorityType.REGULAR) + .withMaxPricePerVM(23.0D) + .withEvictionPolicy(EvictionPolicy.DELETE) + .withAllocationStrategy(AllocationStrategy.LOWEST_PRICE)) + .withVmSizesProfile(Arrays.asList(new VmSizeProfile().withName("frbnnpdkq").withRank(7))) + .withVmAttributes(new VMAttributes().withVCpuCount(new VMAttributeMinMaxInteger().withMin(0).withMax(0)) + .withMemoryInGiB(new VMAttributeMinMaxDouble().withMin(0.0D).withMax(0.0D)) + .withArchitectureTypes(Arrays.asList(ArchitectureType.ARM64)) + .withMemoryInGiBPerVCpu(new VMAttributeMinMaxDouble().withMin(0.0D).withMax(0.0D)) + .withLocalStorageSupport(VMAttributeSupport.EXCLUDED) + .withLocalStorageInGiB(new VMAttributeMinMaxDouble().withMin(0.0D).withMax(0.0D)) + .withLocalStorageDiskTypes(Arrays.asList(LocalStorageDiskType.HDD)) + .withDataDiskCount(new VMAttributeMinMaxInteger().withMin(0).withMax(0)) + .withNetworkInterfaceCount(new VMAttributeMinMaxInteger().withMin(0).withMax(0)) + .withNetworkBandwidthInMbps(new VMAttributeMinMaxDouble().withMin(0.0D).withMax(0.0D)) + .withRdmaSupport(VMAttributeSupport.EXCLUDED) + .withRdmaNetworkInterfaceCount(new VMAttributeMinMaxInteger().withMin(0).withMax(0)) + .withAcceleratorSupport(VMAttributeSupport.EXCLUDED) + .withAcceleratorManufacturers(Arrays.asList(AcceleratorManufacturer.AMD)) + .withAcceleratorTypes(Arrays.asList(AcceleratorType.GPU)) + .withAcceleratorCount(new VMAttributeMinMaxInteger().withMin(0).withMax(0)) + .withVmCategories(Arrays.asList(VMCategory.GENERAL_PURPOSE)) + .withCpuManufacturers(Arrays.asList(CpuManufacturer.INTEL)) + .withHyperVGenerations(Arrays.asList(HyperVGeneration.GEN1)) + .withBurstableSupport(VMAttributeSupport.EXCLUDED) + .withAllowedVMSizes(Arrays.asList("dwcsrlrzrzzqleqivkzwpczpf", "dwcsrlrzrzzqleqivkzwpczpf", + "dwcsrlrzrzzqleqivkzwpczpf", "dwcsrlrzrzzqleqivkzwpczpf", "dwcsrlrzrzzqleqivkzwpczpf", + "dwcsrlrzrzzqleqivkzwpczpf", "dwcsrlrzrzzqleqivkzwpczpf")) + .withExcludedVMSizes(Arrays.asList("igehpnuaybwy", "igehpnuaybwy", "igehpnuaybwy", "igehpnuaybwy", + "igehpnuaybwy", "igehpnuaybwy", "igehpnuaybwy"))) + .withComputeProfile( + new ComputeProfile() + .withVirtualMachineProfile(new BulkactionVMProperties() + .withScheduledEventsPolicy(new ScheduledEventsPolicy() + .withUserInitiatedRedeploy( + new UserInitiatedRedeploy().withUserInitiatedRedeployAutomaticallyApprove(true)) + .withUserInitiatedReboot( + new UserInitiatedReboot().withUserInitiatedRebootAutomaticallyApprove(true)) + .withScheduledEventsAdditionalPublishingTargets( + new ScheduledEventsAdditionalPublishingTargets() + .withEventGridAndResourceGraph(new EventGridAndResourceGraph().withEnable(true) + .withScheduledEventsApiVersion("lifncbftlkounuyfn"))) + .withAllInstancesDown( + new AllInstancesDown().withAllInstancesDownAutomaticallyApprove(true))) + .withStorageProfile(new StorageProfile() + .withImageReference(new ImageReference() + .withId("cdbrkpdicibtlliq") + .withPublisher("ojlplghybdamadvsrq") + .withOffer("uvnqoxhkxefqwbsvjgbswqy") + .withSku("hajdxhjmlkx") + .withVersion("u") + .withSharedGalleryImageId("fz") + .withCommunityGalleryImageId("tsfpcq")) + .withOsDisk(new OSDisk().withOsType(OperatingSystemTypes.WINDOWS) + .withEncryptionSettings(new DiskEncryptionSettings() + .withDiskEncryptionKey( + new KeyVaultSecretReference().withSecretUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("lvzxxyypkeqlflftmfn"))) + .withKeyEncryptionKey( + new KeyVaultKeyReference().withKeyUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("lvzxxyypkeqlflftmfn"))) + .withEnabled(true)) + .withName("opogpznvctmraoajgizcyrfvpt") + .withVhd(new VirtualHardDisk().withUri("elpzggtxubepzgjqvdbjmbu")) + .withImage(new VirtualHardDisk().withUri("elpzggtxubepzgjqvdbjmbu")) + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withDiffDiskSettings(new DiffDiskSettings().withOption(DiffDiskOptions.LOCAL) + .withPlacement(DiffDiskPlacement.CACHE_DISK)) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiskSizeGB(2) + .withManagedDisk(new ManagedDiskParametersContent().withId("numddbqmkxuu") + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParametersContent().withId("magvkzhdmzhktjlqkkk")) + .withSecurityProfile(new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet(new DiskEncryptionSetParametersContent() + .withId("magvkzhdmzhktjlqkkk")))) + .withDeleteOption(DiskDeleteOptionTypes.DELETE)) + .withDataDisks(Arrays.asList(new DataDisk().withLun(7) + .withName("nbthfzqsxyqvqnbgcljxbwyyoj") + .withVhd(new VirtualHardDisk().withUri("elpzggtxubepzgjqvdbjmbu")) + .withImage(new VirtualHardDisk().withUri("elpzggtxubepzgjqvdbjmbu")) + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiskSizeGB(19) + .withManagedDisk(new ManagedDiskParametersContent().withId("numddbqmkxuu") + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParametersContent().withId("magvkzhdmzhktjlqkkk")) + .withSecurityProfile(new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet(new DiskEncryptionSetParametersContent() + .withId("magvkzhdmzhktjlqkkk")))) + .withSourceResource(new ApiEntityReference().withId("qnukyordmomtjjqabovlsxl")) + .withToBeDetached(true) + .withDetachOption(DiskDetachOptionTypes.FORCE_DETACH) + .withDeleteOption(DiskDeleteOptionTypes.DELETE))) + .withDiskControllerType(DiskControllerTypes.SCSI)) + .withHardwareProfile(new HardwareProfile().withVmSize("szrnjqwbruz") + .withVmSizeProperties( + new VmSizeProperties().withVCpusAvailable(24).withVCpusPerCore(6))) + .withAdditionalCapabilities( + new AdditionalCapabilities().withUltraSSDEnabled(true).withHibernationEnabled(true)) + .withOsProfile( + new OSProfile().withComputerName("bplxnfp") + .withAdminUsername("fxzbi") + .withAdminPassword("fakeTokenPlaceholder") + .withCustomData("hbdlirohsgnbrahscboc") + .withWindowsConfiguration(new WindowsConfiguration().withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withTimeZone("t") + .withAdditionalUnattendContent(Arrays.asList(new AdditionalUnattendContent() + .withPassName(AdditionalUnattendContentPassName.OOBE_SYSTEM) + .withComponentName( + AdditionalUnattendContentComponentName.MICROSOFT_WINDOWS_SHELL_SETUP) + .withSettingName(SettingNames.AUTO_LOGON) + .withContent("rguazthnx"))) + .withPatchSettings( + new PatchSettings().withPatchMode(WindowsVMGuestPatchMode.MANUAL) + .withEnableHotpatching(true) + .withAssessmentMode(WindowsPatchAssessmentMode.IMAGE_DEFAULT) + .withAutomaticByPlatformSettings( + new WindowsVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting( + WindowsVMGuestPatchAutomaticByPlatformRebootSetting.UNKNOWN) + .withBypassPlatformSafetyChecksOnUserSchedule(true))) + .withWinRM(new WinRMConfiguration().withListeners( + Arrays.asList(new WinRMListener().withProtocol(ProtocolTypes.HTTP) + .withCertificateUrl("quhfapfpyeeocwvwtvuggoqqwt"))))) + .withLinuxConfiguration(new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withPath("mrdfxnfjazxog") + .withKeyData("fakeTokenPlaceholder")))) + .withProvisionVMAgent(true) + .withPatchSettings( + new LinuxPatchSettings().withPatchMode(LinuxVMGuestPatchMode.IMAGE_DEFAULT) + .withAssessmentMode(LinuxPatchAssessmentMode.IMAGE_DEFAULT) + .withAutomaticByPlatformSettings( + new LinuxVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting( + LinuxVMGuestPatchAutomaticByPlatformRebootSetting.UNKNOWN) + .withBypassPlatformSafetyChecksOnUserSchedule(true))) + .withEnableVMAgentPlatformUpdates(true)) + .withSecrets(Arrays.asList(new VaultSecretGroup() + .withSourceVault(new SubResource().withId("lvzxxyypkeqlflftmfn")) + .withVaultCertificates(Arrays + .asList(new VaultCertificate().withCertificateUrl("crgbpfdvlohwkupdjp") + .withCertificateStore("hyx"))))) + .withAllowExtensionOperations(true) + .withRequireGuestProvisionSignal(true)) + .withNetworkProfile(new NetworkProfile() + .withNetworkInterfaces(Arrays + .asList(new NetworkInterfaceReference().withId("ymfxctb") + .withProperties(new NetworkInterfaceReferenceProperties() + .withPrimary(true) + .withDeleteOption(DeleteOptions.DELETE)))) + .withNetworkApiVersion(NetworkApiVersion.TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE) + .withNetworkInterfaceConfigurations(Arrays.asList( + new VirtualMachineNetworkInterfaceConfiguration().withName("qrkzoctmzjketostzabnra") + .withProperties(new VirtualMachineNetworkInterfaceConfigurationProperties() + .withPrimary(true) + .withDeleteOption(DeleteOptions.DELETE) + .withEnableAcceleratedNetworking(true) + .withDisableTcpStateTracking(true) + .withEnableFpga(true) + .withEnableIPForwarding(true) + .withNetworkSecurityGroup(new SubResource().withId("lvzxxyypkeqlflftmfn")) + .withDnsSettings( + new VirtualMachineNetworkInterfaceDnsSettingsConfiguration() + .withDnsServers(Arrays.asList("tqcqopnanyyiavfwhqbkarxtrfqbww"))) + .withIpConfigurations( + Arrays.asList(new VirtualMachineNetworkInterfaceIPConfiguration() + .withName("gqymuvgzzfmxqvdadx") + .withProperties( + new VirtualMachineNetworkInterfaceIPConfigurationProperties() + .withSubnet(new SubResource().withId("lvzxxyypkeqlflftmfn")) + .withPrimary(true) + .withPublicIPAddressConfiguration( + new VirtualMachinePublicIPAddressConfiguration() + .withName("cwxsqjijtwbsyqdwht") + .withProperties( + new VirtualMachinePublicIPAddressConfigurationProperties() + .withIdleTimeoutInMinutes(17) + .withDeleteOption(DeleteOptions.DELETE) + .withDnsSettings( + new VirtualMachinePublicIPAddressDnsSettingsConfiguration() + .withDomainNameLabel("fampou") + .withDomainNameLabelScope( + DomainNameLabelScopeTypes.TENANT_REUSE)) + .withIpTags( + Arrays.asList(new VirtualMachineIpTag() + .withIpTagType( + "hkjoxhqadudjartwooezaxl") + .withTag("xywunkjglkmmwfpf"))) + .withPublicIPPrefix(new SubResource() + .withId("lvzxxyypkeqlflftmfn")) + .withPublicIPAddressVersion(IPVersions.IPV4) + .withPublicIPAllocationMethod( + PublicIPAllocationMethod.DYNAMIC)) + .withSku(new PublicIPAddressSku() + .withName(PublicIPAddressSkuName.BASIC) + .withTier(PublicIPAddressSkuTier.REGIONAL)) + .withTags(mapOf("key5442", "fakeTokenPlaceholder"))) + .withPrivateIPAddressVersion(IPVersions.IPV4) + .withApplicationSecurityGroups(Arrays.asList( + new SubResource().withId("lvzxxyypkeqlflftmfn"))) + .withApplicationGatewayBackendAddressPools(Arrays.asList( + new SubResource().withId("lvzxxyypkeqlflftmfn"))) + .withLoadBalancerBackendAddressPools(Arrays.asList( + new SubResource().withId("lvzxxyypkeqlflftmfn")))))) + .withDscpConfiguration(new SubResource().withId("lvzxxyypkeqlflftmfn")) + .withAuxiliaryMode(NetworkInterfaceAuxiliaryMode.NONE) + .withAuxiliarySku(NetworkInterfaceAuxiliarySku.NONE)) + .withTags(mapOf("key9436", "fakeTokenPlaceholder"))))) + .withSecurityProfile(new SecurityProfile() + .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true)) + .withEncryptionAtHost(true) + .withSecurityType(SecurityTypes.TRUSTED_LAUNCH) + .withEncryptionIdentity( + new EncryptionIdentity().withUserAssignedIdentityResourceId("tnajlgbwcepmhytzb")) + .withProxyAgentSettings(new ProxyAgentSettings().withEnabled(true) + .withMode(Mode.AUDIT) + .withKeyIncarnationId(4) + .withWireServer(new HostEndpointSettings().withMode(Modes.AUDIT) + .withInVMAccessControlProfileReferenceId("xvlzroy")) + .withImds(new HostEndpointSettings().withMode(Modes.AUDIT) + .withInVMAccessControlProfileReferenceId("xvlzroy")) + .withAddProxyAgentExtension(true))) + .withDiagnosticsProfile(new DiagnosticsProfile().withBootDiagnostics( + new BootDiagnostics().withEnabled(true).withStorageUri("pxuhtzehlfsqolbdleirgj"))) + .withLicenseType("ymwuemwuntbignqyvzqflvjpcdus") + .withExtensionsTimeBudget("dnyqmcijikzkltjav") + .withScheduledEventsProfile(new ScheduledEventsProfile() + .withTerminateNotificationProfile( + new TerminateNotificationProfile().withNotBeforeTimeout("owbwifqrlsdmm") + .withEnable(true)) + .withOsImageNotificationProfile( + new OSImageNotificationProfile().withNotBeforeTimeout("ataqykjdakdvyyzdspaqnhd") + .withEnable(true))) + .withUserData("nwjvxe") + .withCapacityReservation(new CapacityReservationProfile() + .withCapacityReservationGroup(new SubResource().withId("lvzxxyypkeqlflftmfn"))) + .withApplicationProfile( + new ApplicationProfile() + .withGalleryApplications( + Arrays.asList(new VMGalleryApplication().withTags("cmygipvpkegyclvpznfu") + .withOrder(8) + .withPackageReferenceId("afrfkjdrtzftmwramfyu") + .withConfigurationReference("nmfaspclhidtznslsps") + .withTreatFailureAsDeploymentFailure(true) + .withEnableAutomaticUpgrade(true)))) + .withVmExtensions( + Arrays + .asList( + new BulkactionVMExtension().withName("jkpmcxwuahpzwkvexgzpypk") + .withProperties(new BulkActionVmExtensionProperties() + .withForceUpdateTag("dockqxgatsfzhctxrncuw") + .withPublisher("qesyfldbfoaexyoywhcxafdtdwcg") + .withType("ptlmlzpbpbkfbu") + .withTypeHandlerVersion("crllsludntz") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings(mapOf()) + .withProtectedSettings(mapOf()) + .withSuppressFailures(true) + .withProtectedSettingsFromKeyVault(new KeyVaultSecretReference() + .withSecretUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("lvzxxyypkeqlflftmfn"))) + .withProvisionAfterExtensions(Arrays.asList("onbtyoeifafiktrkmal")))))) + .withExtensions( + Arrays + .asList(new BulkactionVMExtension().withName("jkpmcxwuahpzwkvexgzpypk") + .withProperties(new BulkActionVmExtensionProperties() + .withForceUpdateTag("dockqxgatsfzhctxrncuw") + .withPublisher("qesyfldbfoaexyoywhcxafdtdwcg") + .withType("ptlmlzpbpbkfbu") + .withTypeHandlerVersion("crllsludntz") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings(mapOf()) + .withProtectedSettings(mapOf()) + .withSuppressFailures(true) + .withProtectedSettingsFromKeyVault( + new KeyVaultSecretReference().withSecretUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("lvzxxyypkeqlflftmfn"))) + .withProvisionAfterExtensions(Arrays.asList("onbtyoeifafiktrkmal"))))) + .withComputeApiVersion("qqxldedyfmfmidkvtkixh")) + .withZoneAllocationPolicy( + new ZoneAllocationPolicy().withDistributionStrategy(DistributionStrategy.BEST_EFFORT_SINGLE_ZONE) + .withZonePreferences( + Arrays.asList(new ZonePreference().withZone("ixksjnaxwelhfpsoyjfaezievquqv").withRank(19)))) + .withRetryPolicy(new RetryPolicy().withRetryCount(2) + .withRetryWindowInMinutes(19) + .withOnFailureAction(ResourceOperationType.UNKNOWN))) + .withZones(Arrays.asList("hzqzrbvpgsudtesi")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("key9643", new UserAssignedIdentity()))) + .withPlan(new Plan().withName("iemasqqkbixbewezyrhnpntjd") + .withPublisher("bvggylbvfstnscuupuithafvvgc") + .withProduct("bguuzrknnuohugjhernflurpx") + .withPromotionCode("fakeTokenPlaceholder") + .withVersion("uyxetqmmzvqianqv")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationDeleteSamples.java new file mode 100644 index 000000000000..59e2a3faefb7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +/** + * Samples for LaunchBulkInstancesOperation Delete. + */ +public final class LaunchBulkInstancesOperationDeleteSamples { + /* + * x-ms-original-file: 2026-07-06-preview/LaunchBulkInstancesOperation_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: LaunchBulkInstancesOperation_Delete_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void launchBulkInstancesOperationDeleteExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.launchBulkInstancesOperations() + .delete("rgBulkactions", "useast2euap", "8a71b9df-efee-48a9-a381-4e6d60b4304f", true, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationGetOperationStatusSamples.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationGetOperationStatusSamples.java new file mode 100644 index 000000000000..b8a3055c99b1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationGetOperationStatusSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +/** + * Samples for LaunchBulkInstancesOperation GetOperationStatus. + */ +public final class LaunchBulkInstancesOperationGetOperationStatusSamples { + /* + * x-ms-original-file: 2026-07-06-preview/LaunchBulkInstancesOperation_GetOperationStatus_MaximumSet_Gen.json + */ + /** + * Sample code: LaunchBulkInstancesOperation_GetOperationStatus_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void launchBulkInstancesOperationGetOperationStatusExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.launchBulkInstancesOperations() + .getOperationStatusWithResponse("useast2euap", "8596407e-8834-4a62-8d3c-9231af92d785", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationGetSamples.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationGetSamples.java new file mode 100644 index 000000000000..f670074c858b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +/** + * Samples for LaunchBulkInstancesOperation Get. + */ +public final class LaunchBulkInstancesOperationGetSamples { + /* + * x-ms-original-file: 2026-07-06-preview/LaunchBulkInstancesOperation_Get_MaximumSet_Gen.json + */ + /** + * Sample code: LaunchBulkInstancesOperation_Get_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void launchBulkInstancesOperationGetExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.launchBulkInstancesOperations() + .getWithResponse("rgBulkactions", "useast2euap", "495544ae-8710-4e8b-bca3-49a1dbb1623a", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationListByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationListByResourceGroupSamples.java new file mode 100644 index 000000000000..33ff3f374458 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationListByResourceGroupSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +/** + * Samples for LaunchBulkInstancesOperation ListByResourceGroup. + */ +public final class LaunchBulkInstancesOperationListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-07-06-preview/LaunchBulkInstancesOperation_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: LaunchBulkInstancesOperation_ListByResourceGroup_Example - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void launchBulkInstancesOperationListByResourceGroupExampleGeneratedByMinimumSetRule( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.launchBulkInstancesOperations() + .listByResourceGroup("rgBulkactions", "useast2euap", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-06-preview/LaunchBulkInstancesOperation_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: LaunchBulkInstancesOperation_ListByResourceGroup_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void launchBulkInstancesOperationListByResourceGroupExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.launchBulkInstancesOperations() + .listByResourceGroup("rgBulkactions", "useast2euap", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationListBySubscriptionSamples.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationListBySubscriptionSamples.java new file mode 100644 index 000000000000..17e094d67030 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationListBySubscriptionSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +/** + * Samples for LaunchBulkInstancesOperation ListBySubscription. + */ +public final class LaunchBulkInstancesOperationListBySubscriptionSamples { + /* + * x-ms-original-file: 2026-07-06-preview/LaunchBulkInstancesOperation_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: LaunchBulkInstancesOperation_ListBySubscription_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void launchBulkInstancesOperationListBySubscriptionExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.launchBulkInstancesOperations().listBySubscription("useast2euap", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-06-preview/LaunchBulkInstancesOperation_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: LaunchBulkInstancesOperation_ListBySubscription_Example - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void launchBulkInstancesOperationListBySubscriptionExampleGeneratedByMinimumSetRule( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.launchBulkInstancesOperations().listBySubscription("useast2euap", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationListVirtualMachinesSamples.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationListVirtualMachinesSamples.java new file mode 100644 index 000000000000..7f1268affe9e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/LaunchBulkInstancesOperationListVirtualMachinesSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +/** + * Samples for LaunchBulkInstancesOperation ListVirtualMachines. + */ +public final class LaunchBulkInstancesOperationListVirtualMachinesSamples { + /* + * x-ms-original-file: 2026-07-06-preview/LaunchBulkInstancesOperation_ListVirtualMachines_MaximumSet_Gen.json + */ + /** + * Sample code: LaunchBulkInstancesOperation_ListVirtualMachines_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void launchBulkInstancesOperationListVirtualMachinesExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.launchBulkInstancesOperations() + .listVirtualMachines("rgBulkactions", "useast2euap", "b038ec94-0860-42a5-b149-f1ce5f144e15", + "onywxjwswbhlbkbbusgmkfgabdku", "tcbhwfqtoiwnlbjdbsnukxpgpa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/OperationsListSamples.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/OperationsListSamples.java index 52bb03a27ff3..8a82757b59d7 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/OperationsListSamples.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/OperationsListSamples.java @@ -9,27 +9,27 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: 2026-06-06/Operations_List_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/Operations_List_MinimumSet_Gen.json */ /** - * Sample code: Operations_List - generated by [MaximumSet] rule. + * Sample code: Operations_List_Minimum_Gen_Example. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void operationsListGeneratedByMaximumSetRule( + public static void operationsListMinimumGenExample( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.operations().list(com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: 2026-06-06/Operations_List_MinimumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/Operations_List_MaximumSet_Gen.json */ /** - * Sample code: Operations_List - generated by [MinimumSet] rule. + * Sample code: Operations_List_MaximumSet_Gen_Example. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void operationsListGeneratedByMinimumSetRule( + public static void operationsListMaximumSetGenExample( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.operations().list(com.azure.core.util.Context.NONE); } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkAcknowledgeOperationErrorsSamples.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkAcknowledgeOperationErrorsSamples.java new file mode 100644 index 000000000000..624edbce609b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkAcknowledgeOperationErrorsSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.resourcemanager.compute.bulkactions.models.AcknowledgeBulkOperationErrorsRequest; +import java.util.Arrays; + +/** + * Samples for VirtualMachineBulkOperations BulkAcknowledgeOperationErrors. + */ +public final class VirtualMachineBulkOperationsBulkAcknowledgeOperationErrorsSamples { + /* + * x-ms-original-file: + * 2026-07-06-preview/VirtualMachineBulkOperations_BulkAcknowledgeOperationErrors_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineBulkOperations_BulkAcknowledgeOperationErrors_MinimumSet_Gen. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void virtualMachineBulkOperationsBulkAcknowledgeOperationErrorsMinimumSetGen( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.virtualMachineBulkOperations() + .bulkAcknowledgeOperationErrorsWithResponse("rgBulkactions", "useast2euap", + new AcknowledgeBulkOperationErrorsRequest().withOperationIds( + Arrays.asList("af449548-8e1a-4079-874e-2caa4ff783cc")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-07-06-preview/VirtualMachineBulkOperations_BulkAcknowledgeOperationErrors_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineBulkOperations_BulkAcknowledgeOperationErrors_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void virtualMachineBulkOperationsBulkAcknowledgeOperationErrorsExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.virtualMachineBulkOperations() + .bulkAcknowledgeOperationErrorsWithResponse("rgBulkactions", "useast2euap", + new AcknowledgeBulkOperationErrorsRequest().withOperationIds( + Arrays.asList("af449548-8e1a-4079-874e-2caa4ff783cc")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkCancelOperationsSamples.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkCancelOperationsSamples.java index e012ca7ed31e..5e863bdf639b 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkCancelOperationsSamples.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkCancelOperationsSamples.java @@ -12,34 +12,34 @@ */ public final class VirtualMachineBulkOperationsBulkCancelOperationsSamples { /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkCancel_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkCancel_MaximumSet_Gen.json */ /** - * Sample code: VirtualMachineBulkOperations_BulkCancel - generated by [MaximumSet] rule. + * Sample code: VirtualMachineBulkOperations_BulkCancel_Example. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void virtualMachineBulkOperationsBulkCancelGeneratedByMaximumSetRule( + public static void virtualMachineBulkOperationsBulkCancelExample( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.virtualMachineBulkOperations() - .bulkCancelOperationsWithResponse("myResourceGroup", "eastus2euap", - new CancelOperationsContent().withOperationIds(Arrays.asList("a1b2c3d4-e5f6-7890-abcd-ef0123456789")), + .bulkCancelOperationsWithResponse("rgBulkactions", "useast2euap", + new CancelOperationsContent().withOperationIds(Arrays.asList("af449548-8e1a-4079-874e-2caa4ff783cc")), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkCancel_MinimumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkCancel_MinimumSet_Gen.json */ /** - * Sample code: VirtualMachineBulkOperations_BulkCancel - generated by [MinimumSet] rule. + * Sample code: VirtualMachineBulkOperations_BulkCancel_Example - generated by [MinimumSet] rule. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void virtualMachineBulkOperationsBulkCancelGeneratedByMinimumSetRule( + public static void virtualMachineBulkOperationsBulkCancelExampleGeneratedByMinimumSetRule( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.virtualMachineBulkOperations() - .bulkCancelOperationsWithResponse("myResourceGroup", "eastus2euap", - new CancelOperationsContent().withOperationIds(Arrays.asList("a1b2c3d4-e5f6-7890-abcd-ef0123456789")), + .bulkCancelOperationsWithResponse("rgBulkactions", "useast2euap", + new CancelOperationsContent().withOperationIds(Arrays.asList("af449548-8e1a-4079-874e-2caa4ff783cc")), com.azure.core.util.Context.NONE); } } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkCreateOperationSamples.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkCreateOperationSamples.java new file mode 100644 index 000000000000..2325f59073fe --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkCreateOperationSamples.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.ExecuteCreateContent; +import com.azure.resourcemanager.compute.bulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceProvisionPayload; +import com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualMachineBulkOperations BulkCreateOperation. + */ +public final class VirtualMachineBulkOperationsBulkCreateOperationSamples { + /* + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkCreate_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineBulkOperations_BulkCreate_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void virtualMachineBulkOperationsBulkCreateExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.virtualMachineBulkOperations() + .bulkCreateOperationWithResponse("rgBulkactions", "useast2euap", new ExecuteCreateContent() + .withResourceConfigParameters(new ResourceProvisionPayload().withBaseProfile(mapOf("plan", + BinaryData.fromBytes( + "{name=iemasqqkbixbewezyrhnpntjd, publisher=bvggylbvfstnscuupuithafvvgc, product=bguuzrknnuohugjhernflurpx, promotionCode=bxgonranwqoryfkhkfaumdgz, version=uyxetqmmzvqianqv}" + .getBytes(StandardCharsets.UTF_8)), + "zones", BinaryData.fromBytes("[wczj]".getBytes(StandardCharsets.UTF_8)), "identity", + BinaryData.fromBytes( + "{type=SystemAssigned, userAssignedIdentities={key7={}}}".getBytes(StandardCharsets.UTF_8)), + "extendedLocation", + BinaryData.fromBytes("{name=gbnxzymbdkxhwjpqkur, type=EdgeZone}".getBytes(StandardCharsets.UTF_8)), + "placement", + BinaryData.fromBytes( + "{zonePlacementPolicy=Any, includeZones=[inagtbtedobdea], excludeZones=[pvvwrhuhdpvbacwmesblpgwzk]}" + .getBytes(StandardCharsets.UTF_8)), + "tags", BinaryData.fromBytes("{key6824=cefndldgkx}".getBytes(StandardCharsets.UTF_8)), "properties", + BinaryData.fromBytes( + "{scheduledEventsPolicy={userInitiatedRedeploy={automaticallyApprove=true}, userInitiatedReboot={automaticallyApprove=true}, scheduledEventsAdditionalPublishingTargets={eventGridAndResourceGraph={enable=true, scheduledEventsApiVersion=lifncbftlkounuyfn}}, allInstancesDown={automaticallyApprove=true}}, storageProfile={imageReference={publisher=ojlplghybdamadvsrq, offer=uvnqoxhkxefqwbsvjgbswqy, sku=hajdxhjmlkx, version=u, sharedGalleryImageId=fz, communityGalleryImageId=tsfpcq, id=cdbrkpdicibtlliq}, osDisk={osType=Windows, encryptionSettings={diskEncryptionKey={secretUrl=vzkogocyw, sourceVault={id=lvzxxyypkeqlflftmfn}}, keyEncryptionKey={keyUrl=mjjkvgpoohatw, sourceVault={id=lvzxxyypkeqlflftmfn}}, enabled=true}, name=opogpznvctmraoajgizcyrfvpt, vhd={uri=elpzggtxubepzgjqvdbjmbu}, image={uri=elpzggtxubepzgjqvdbjmbu}, caching=None, writeAcceleratorEnabled=true, diffDiskSettings={option=Local, placement=CacheDisk}, createOption=FromImage, diskSizeGB=2, managedDisk={storageAccountType=Standard_LRS, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}, securityProfile={securityEncryptionType=VMGuestStateOnly, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}}, id=numddbqmkxuu}, deleteOption=Delete}, dataDisks=[{lun=7, name=nbthfzqsxyqvqnbgcljxbwyyoj, vhd={uri=elpzggtxubepzgjqvdbjmbu}, image={uri=elpzggtxubepzgjqvdbjmbu}, caching=None, writeAcceleratorEnabled=true, createOption=FromImage, diskSizeGB=19, managedDisk={storageAccountType=Standard_LRS, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}, securityProfile={securityEncryptionType=VMGuestStateOnly, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}}, id=numddbqmkxuu}, sourceResource={id=qnukyordmomtjjqabovlsxl}, toBeDetached=true, detachOption=ForceDetach, deleteOption=Delete}], diskControllerType=SCSI}, hardwareProfile={vmSize=szrnjqwbruz, vmSizeProperties={vCpusAvailable=24, vCpusPerCore=6}}, additionalCapabilities={ultraSSDEnabled=true, hibernationEnabled=true}, osProfile={computerName=bplxnfp, adminUsername=fxzbi, adminPassword=, customData=hbdlirohsgnbrahscboc, windowsConfiguration={provisionVMAgent=true, enableAutomaticUpdates=true, timeZone=t, additionalUnattendContent=[{passName=OobeSystem, componentName=Microsoft-Windows-Shell-Setup, settingName=AutoLogon, content=rguazthnx}], patchSettings={patchMode=Manual, enableHotpatching=true, assessmentMode=ImageDefault, automaticByPlatformSettings={rebootSetting=Unknown, bypassPlatformSafetyChecksOnUserSchedule=true}}, winRM={listeners=[{protocol=Http, certificateUrl=quhfapfpyeeocwvwtvuggoqqwt}]}}, linuxConfiguration={disablePasswordAuthentication=true, ssh={publicKeys=[{path=mrdfxnfjazxog, keyData=wfhrknkehgesontscqyrewfmhgwt}]}, provisionVMAgent=true, patchSettings={patchMode=ImageDefault, assessmentMode=ImageDefault, automaticByPlatformSettings={rebootSetting=Unknown, bypassPlatformSafetyChecksOnUserSchedule=true}}, enableVMAgentPlatformUpdates=true}, secrets=[{sourceVault={id=lvzxxyypkeqlflftmfn}, vaultCertificates=[{certificateUrl=crgbpfdvlohwkupdjp, certificateStore=hyx}]}], allowExtensionOperations=true, requireGuestProvisionSignal=true}, networkProfile={networkInterfaces=[{properties={primary=true, deleteOption=Delete}, id=ymfxctb}], networkApiVersion=2020-11-01, networkInterfaceConfigurations=[{name=qrkzoctmzjketostzabnra, properties={primary=true, deleteOption=Delete, enableAcceleratedNetworking=true, disableTcpStateTracking=true, enableFpga=true, enableIPForwarding=true, networkSecurityGroup={id=lvzxxyypkeqlflftmfn}, dnsSettings={dnsServers=[tqcqopnanyyiavfwhqbkarxtrfqbww]}, ipConfigurations=[{name=gqymuvgzzfmxqvdadx, properties={subnet={id=lvzxxyypkeqlflftmfn}, primary=true, publicIPAddressConfiguration={name=cwxsqjijtwbsyqdwht, properties={idleTimeoutInMinutes=17, deleteOption=Delete, dnsSettings={domainNameLabel=fampou, domainNameLabelScope=TenantReuse}, ipTags=[{ipTagType=hkjoxhqadudjartwooezaxl, tag=xywunkjglkmmwfpf}], publicIPPrefix={id=lvzxxyypkeqlflftmfn}, publicIPAddressVersion=IPv4, publicIPAllocationMethod=Dynamic}, sku={name=Basic, tier=Regional}, tags={key5442=qhpwpnylvmdthxazhxamnbhdfpf}}, privateIPAddressVersion=IPv4, applicationSecurityGroups=[{id=lvzxxyypkeqlflftmfn}], applicationGatewayBackendAddressPools=[{id=lvzxxyypkeqlflftmfn}], loadBalancerBackendAddressPools=[{id=lvzxxyypkeqlflftmfn}]}}], dscpConfiguration={id=lvzxxyypkeqlflftmfn}, auxiliaryMode=None, auxiliarySku=None}, tags={key9436=bjbadzbfvpszbsickv}}]}, securityProfile={uefiSettings={secureBootEnabled=true, vTpmEnabled=true}, encryptionAtHost=true, securityType=TrustedLaunch, encryptionIdentity={userAssignedIdentityResourceId=tnajlgbwcepmhytzb}, proxyAgentSettings={enabled=true, mode=Audit, keyIncarnationId=4, wireServer={mode=Audit, inVMAccessControlProfileReferenceId=xvlzroy}, imds={mode=Audit, inVMAccessControlProfileReferenceId=xvlzroy}, addProxyAgentExtension=true}}, diagnosticsProfile={bootDiagnostics={enabled=true, storageUri=pxuhtzehlfsqolbdleirgj}}, licenseType=ymwuemwuntbignqyvzqflvjpcdus, extensionsTimeBudget=dnyqmcijikzkltjav, scheduledEventsProfile={terminateNotificationProfile={notBeforeTimeout=owbwifqrlsdmm, enable=true}, osImageNotificationProfile={notBeforeTimeout=ataqykjdakdvyyzdspaqnhd, enable=true}}, userData=nwjvxe, capacityReservation={capacityReservationGroup={id=lvzxxyypkeqlflftmfn}}, applicationProfile={galleryApplications=[{tags=cmygipvpkegyclvpznfu, order=8, packageReferenceId=afrfkjdrtzftmwramfyu, configurationReference=nmfaspclhidtznslsps, treatFailureAsDeploymentFailure=true, enableAutomaticUpgrade=true}]}, vmExtensions=[{name=jkpmcxwuahpzwkvexgzpypk, properties={forceUpdateTag=dockqxgatsfzhctxrncuw, publisher=qesyfldbfoaexyoywhcxafdtdwcg, type=ptlmlzpbpbkfbu, typeHandlerVersion=crllsludntz, autoUpgradeMinorVersion=true, enableAutomaticUpgrade=true, settings={}, protectedSettings={}, suppressFailures=true, protectedSettingsFromKeyVault={secretUrl=vzkogocyw, sourceVault={id=lvzxxyypkeqlflftmfn}}, provisionAfterExtensions=[onbtyoeifafiktrkmal]}}]}" + .getBytes(StandardCharsets.UTF_8)), + "computeApiVersion", + BinaryData.fromBytes("axcvphjtsdjzcwqczcglmq".getBytes(StandardCharsets.UTF_8)), "name", + BinaryData.fromBytes("dbozdvegpdvqxltqipvmqsfgunpe".getBytes(StandardCharsets.UTF_8)))) + .withResourceOverrides(Arrays.asList(mapOf("plan", BinaryData.fromBytes( + "{name=iemasqqkbixbewezyrhnpntjd, publisher=bvggylbvfstnscuupuithafvvgc, product=bguuzrknnuohugjhernflurpx, promotionCode=bxgonranwqoryfkhkfaumdgz, version=uyxetqmmzvqianqv}" + .getBytes(StandardCharsets.UTF_8)), + "zones", BinaryData.fromBytes("[wczj]".getBytes(StandardCharsets.UTF_8)), "identity", + BinaryData.fromBytes( + "{type=SystemAssigned, userAssignedIdentities={key7={}}}".getBytes(StandardCharsets.UTF_8)), + "extendedLocation", + BinaryData + .fromBytes("{name=gbnxzymbdkxhwjpqkur, type=EdgeZone}".getBytes(StandardCharsets.UTF_8)), + "placement", + BinaryData.fromBytes( + "{zonePlacementPolicy=Any, includeZones=[inagtbtedobdea], excludeZones=[pvvwrhuhdpvbacwmesblpgwzk]}" + .getBytes(StandardCharsets.UTF_8)), + "tags", BinaryData.fromBytes("{key6824=cefndldgkx}".getBytes(StandardCharsets.UTF_8)), + "properties", + BinaryData.fromBytes( + "{scheduledEventsPolicy={userInitiatedRedeploy={automaticallyApprove=true}, userInitiatedReboot={automaticallyApprove=true}, scheduledEventsAdditionalPublishingTargets={eventGridAndResourceGraph={enable=true, scheduledEventsApiVersion=lifncbftlkounuyfn}}, allInstancesDown={automaticallyApprove=true}}, storageProfile={imageReference={publisher=ojlplghybdamadvsrq, offer=uvnqoxhkxefqwbsvjgbswqy, sku=hajdxhjmlkx, version=u, sharedGalleryImageId=fz, communityGalleryImageId=tsfpcq, id=cdbrkpdicibtlliq}, osDisk={osType=Windows, encryptionSettings={diskEncryptionKey={secretUrl=vzkogocyw, sourceVault={id=lvzxxyypkeqlflftmfn}}, keyEncryptionKey={keyUrl=mjjkvgpoohatw, sourceVault={id=lvzxxyypkeqlflftmfn}}, enabled=true}, name=opogpznvctmraoajgizcyrfvpt, vhd={uri=elpzggtxubepzgjqvdbjmbu}, image={uri=elpzggtxubepzgjqvdbjmbu}, caching=None, writeAcceleratorEnabled=true, diffDiskSettings={option=Local, placement=CacheDisk}, createOption=FromImage, diskSizeGB=2, managedDisk={storageAccountType=Standard_LRS, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}, securityProfile={securityEncryptionType=VMGuestStateOnly, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}}, id=numddbqmkxuu}, deleteOption=Delete}, dataDisks=[{lun=7, name=nbthfzqsxyqvqnbgcljxbwyyoj, vhd={uri=elpzggtxubepzgjqvdbjmbu}, image={uri=elpzggtxubepzgjqvdbjmbu}, caching=None, writeAcceleratorEnabled=true, createOption=FromImage, diskSizeGB=19, managedDisk={storageAccountType=Standard_LRS, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}, securityProfile={securityEncryptionType=VMGuestStateOnly, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}}, id=numddbqmkxuu}, sourceResource={id=qnukyordmomtjjqabovlsxl}, toBeDetached=true, detachOption=ForceDetach, deleteOption=Delete}], diskControllerType=SCSI}, hardwareProfile={vmSize=szrnjqwbruz, vmSizeProperties={vCpusAvailable=24, vCpusPerCore=6}}, additionalCapabilities={ultraSSDEnabled=true, hibernationEnabled=true}, osProfile={computerName=bplxnfp, adminUsername=fxzbi, adminPassword=, customData=hbdlirohsgnbrahscboc, windowsConfiguration={provisionVMAgent=true, enableAutomaticUpdates=true, timeZone=t, additionalUnattendContent=[{passName=OobeSystem, componentName=Microsoft-Windows-Shell-Setup, settingName=AutoLogon, content=rguazthnx}], patchSettings={patchMode=Manual, enableHotpatching=true, assessmentMode=ImageDefault, automaticByPlatformSettings={rebootSetting=Unknown, bypassPlatformSafetyChecksOnUserSchedule=true}}, winRM={listeners=[{protocol=Http, certificateUrl=quhfapfpyeeocwvwtvuggoqqwt}]}}, linuxConfiguration={disablePasswordAuthentication=true, ssh={publicKeys=[{path=mrdfxnfjazxog, keyData=wfhrknkehgesontscqyrewfmhgwt}]}, provisionVMAgent=true, patchSettings={patchMode=ImageDefault, assessmentMode=ImageDefault, automaticByPlatformSettings={rebootSetting=Unknown, bypassPlatformSafetyChecksOnUserSchedule=true}}, enableVMAgentPlatformUpdates=true}, secrets=[{sourceVault={id=lvzxxyypkeqlflftmfn}, vaultCertificates=[{certificateUrl=crgbpfdvlohwkupdjp, certificateStore=hyx}]}], allowExtensionOperations=true, requireGuestProvisionSignal=true}, networkProfile={networkInterfaces=[{properties={primary=true, deleteOption=Delete}, id=ymfxctb}], networkApiVersion=2020-11-01, networkInterfaceConfigurations=[{name=qrkzoctmzjketostzabnra, properties={primary=true, deleteOption=Delete, enableAcceleratedNetworking=true, disableTcpStateTracking=true, enableFpga=true, enableIPForwarding=true, networkSecurityGroup={id=lvzxxyypkeqlflftmfn}, dnsSettings={dnsServers=[tqcqopnanyyiavfwhqbkarxtrfqbww]}, ipConfigurations=[{name=gqymuvgzzfmxqvdadx, properties={subnet={id=lvzxxyypkeqlflftmfn}, primary=true, publicIPAddressConfiguration={name=cwxsqjijtwbsyqdwht, properties={idleTimeoutInMinutes=17, deleteOption=Delete, dnsSettings={domainNameLabel=fampou, domainNameLabelScope=TenantReuse}, ipTags=[{ipTagType=hkjoxhqadudjartwooezaxl, tag=xywunkjglkmmwfpf}], publicIPPrefix={id=lvzxxyypkeqlflftmfn}, publicIPAddressVersion=IPv4, publicIPAllocationMethod=Dynamic}, sku={name=Basic, tier=Regional}, tags={key5442=qhpwpnylvmdthxazhxamnbhdfpf}}, privateIPAddressVersion=IPv4, applicationSecurityGroups=[{id=lvzxxyypkeqlflftmfn}], applicationGatewayBackendAddressPools=[{id=lvzxxyypkeqlflftmfn}], loadBalancerBackendAddressPools=[{id=lvzxxyypkeqlflftmfn}]}}], dscpConfiguration={id=lvzxxyypkeqlflftmfn}, auxiliaryMode=None, auxiliarySku=None}, tags={key9436=bjbadzbfvpszbsickv}}]}, securityProfile={uefiSettings={secureBootEnabled=true, vTpmEnabled=true}, encryptionAtHost=true, securityType=TrustedLaunch, encryptionIdentity={userAssignedIdentityResourceId=tnajlgbwcepmhytzb}, proxyAgentSettings={enabled=true, mode=Audit, keyIncarnationId=4, wireServer={mode=Audit, inVMAccessControlProfileReferenceId=xvlzroy}, imds={mode=Audit, inVMAccessControlProfileReferenceId=xvlzroy}, addProxyAgentExtension=true}}, diagnosticsProfile={bootDiagnostics={enabled=true, storageUri=pxuhtzehlfsqolbdleirgj}}, licenseType=ymwuemwuntbignqyvzqflvjpcdus, extensionsTimeBudget=dnyqmcijikzkltjav, scheduledEventsProfile={terminateNotificationProfile={notBeforeTimeout=owbwifqrlsdmm, enable=true}, osImageNotificationProfile={notBeforeTimeout=ataqykjdakdvyyzdspaqnhd, enable=true}}, userData=nwjvxe, capacityReservation={capacityReservationGroup={id=lvzxxyypkeqlflftmfn}}, applicationProfile={galleryApplications=[{tags=cmygipvpkegyclvpznfu, order=8, packageReferenceId=afrfkjdrtzftmwramfyu, configurationReference=nmfaspclhidtznslsps, treatFailureAsDeploymentFailure=true, enableAutomaticUpgrade=true}]}, vmExtensions=[{name=jkpmcxwuahpzwkvexgzpypk, properties={forceUpdateTag=dockqxgatsfzhctxrncuw, publisher=qesyfldbfoaexyoywhcxafdtdwcg, type=ptlmlzpbpbkfbu, typeHandlerVersion=crllsludntz, autoUpgradeMinorVersion=true, enableAutomaticUpgrade=true, settings={}, protectedSettings={}, suppressFailures=true, protectedSettingsFromKeyVault={secretUrl=vzkogocyw, sourceVault={id=lvzxxyypkeqlflftmfn}}, provisionAfterExtensions=[onbtyoeifafiktrkmal]}}]}" + .getBytes(StandardCharsets.UTF_8)), + "computeApiVersion", + BinaryData.fromBytes("axcvphjtsdjzcwqczcglmq".getBytes(StandardCharsets.UTF_8)), "name", + BinaryData.fromBytes("dbozdvegpdvqxltqipvmqsfgunpe".getBytes(StandardCharsets.UTF_8))))) + .withResourceCount(23) + .withResourcePrefix("flivkboavfhjuiucwdjof")) + .withExecutionParameters(new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(2) + .withRetryWindowInMinutes(19) + .withOnFailureAction(ResourceOperationType.UNKNOWN))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkCreate_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineBulkOperations_BulkCreate_Example - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void virtualMachineBulkOperationsBulkCreateExampleGeneratedByMinimumSetRule( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.virtualMachineBulkOperations() + .bulkCreateOperationWithResponse("rgBulkactions", "useast2euap", + new ExecuteCreateContent() + .withResourceConfigParameters(new ResourceProvisionPayload().withResourceCount(23)) + .withExecutionParameters(new ExecutionParameters()), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkDeallocateOperationSamples.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkDeallocateOperationSamples.java index 1d5e1f2c8cdd..0551b9361340 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkDeallocateOperationSamples.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkDeallocateOperationSamples.java @@ -16,40 +16,22 @@ */ public final class VirtualMachineBulkOperationsBulkDeallocateOperationSamples { /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkDeallocate_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkDeallocate_MaximumSet_Gen.json */ /** - * Sample code: VirtualMachineBulkOperations_BulkDeallocate - generated by [MaximumSet] rule. + * Sample code: VirtualMachineBulkOperations_BulkDeallocate_Example. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void virtualMachineBulkOperationsBulkDeallocateGeneratedByMaximumSetRule( + public static void virtualMachineBulkOperationsBulkDeallocateExample( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.virtualMachineBulkOperations() - .bulkDeallocateOperationWithResponse("myResourceGroup", "eastus2euap", new ExecuteDeallocateContent() + .bulkDeallocateOperationWithResponse("rgBulkactions", "useast2euap", new ExecuteDeallocateContent() .withExecutionParameters(new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(2) - .withRetryWindowInMinutes(20) + .withRetryWindowInMinutes(19) .withOnFailureAction(ResourceOperationType.UNKNOWN))) .withResources(new Resources().withIds(Arrays.asList( "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))), com.azure.core.util.Context.NONE); } - - /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkDeallocate_MinimumSet_Gen.json - */ - /** - * Sample code: VirtualMachineBulkOperations_BulkDeallocate - generated by [MinimumSet] rule. - * - * @param manager Entry point to ComputeBulkActionsManager. - */ - public static void virtualMachineBulkOperationsBulkDeallocateGeneratedByMinimumSetRule( - com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { - manager.virtualMachineBulkOperations() - .bulkDeallocateOperationWithResponse("myResourceGroup", "eastus2euap", new ExecuteDeallocateContent() - .withExecutionParameters(new ExecutionParameters()) - .withResources(new Resources().withIds(Arrays.asList( - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))), - com.azure.core.util.Context.NONE); - } } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkDeleteOperationSamples.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkDeleteOperationSamples.java index acc011738d57..0f7adf8f91fe 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkDeleteOperationSamples.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkDeleteOperationSamples.java @@ -16,40 +16,22 @@ */ public final class VirtualMachineBulkOperationsBulkDeleteOperationSamples { /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkDelete_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkDelete_MaximumSet_Gen.json */ /** - * Sample code: VirtualMachineBulkOperations_BulkDelete - generated by [MaximumSet] rule. + * Sample code: VirtualMachineBulkOperations_BulkDelete_Example. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void virtualMachineBulkOperationsBulkDeleteGeneratedByMaximumSetRule( + public static void virtualMachineBulkOperationsBulkDeleteExample( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.virtualMachineBulkOperations() - .bulkDeleteOperationWithResponse("myResourceGroup", "eastus2euap", new ExecuteDeleteContent() + .bulkDeleteOperationWithResponse("rgBulkactions", "useast2euap", new ExecuteDeleteContent() .withExecutionParameters(new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(2) - .withRetryWindowInMinutes(20) + .withRetryWindowInMinutes(19) .withOnFailureAction(ResourceOperationType.UNKNOWN))) .withResources(new Resources().withIds(Arrays.asList( "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))) .withForceDeletion(true), com.azure.core.util.Context.NONE); } - - /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkDelete_MinimumSet_Gen.json - */ - /** - * Sample code: VirtualMachineBulkOperations_BulkDelete - generated by [MinimumSet] rule. - * - * @param manager Entry point to ComputeBulkActionsManager. - */ - public static void virtualMachineBulkOperationsBulkDeleteGeneratedByMinimumSetRule( - com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { - manager.virtualMachineBulkOperations() - .bulkDeleteOperationWithResponse("myResourceGroup", "eastus2euap", new ExecuteDeleteContent() - .withExecutionParameters(new ExecutionParameters()) - .withResources(new Resources().withIds(Arrays.asList( - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))), - com.azure.core.util.Context.NONE); - } } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkGetOperationsStatusSamples.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkGetOperationsStatusSamples.java index fa51b941948f..43ffef20b5f6 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkGetOperationsStatusSamples.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkGetOperationsStatusSamples.java @@ -12,34 +12,34 @@ */ public final class VirtualMachineBulkOperationsBulkGetOperationsStatusSamples { /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkGetOperationsStatus_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkGetOperationsStatus_MinimumSet_Gen.json */ /** - * Sample code: VirtualMachineBulkOperations_BulkGetOperationsStatus - generated by [MaximumSet] rule. + * Sample code: VirtualMachineBulkOperations_BulkGetOperationsStatus_Example - generated by [MinimumSet] rule. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void virtualMachineBulkOperationsBulkGetOperationsStatusGeneratedByMaximumSetRule( + public static void virtualMachineBulkOperationsBulkGetOperationsStatusExampleGeneratedByMinimumSetRule( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.virtualMachineBulkOperations() - .bulkGetOperationsStatusWithResponse("myResourceGroup", "eastus2euap", - new GetOperationStatusContent().withOperationIds(Arrays.asList("a1b2c3d4-e5f6-7890-abcd-ef0123456789")), + .bulkGetOperationsStatusWithResponse("rgBulkactions", "useast2euap", + new GetOperationStatusContent().withOperationIds(Arrays.asList("406e7856-f94b-48ae-93ee-b062afee54e5")), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkGetOperationsStatus_MinimumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkGetOperationsStatus_MaximumSet_Gen.json */ /** - * Sample code: VirtualMachineBulkOperations_BulkGetOperationsStatus - generated by [MinimumSet] rule. + * Sample code: VirtualMachineBulkOperations_BulkGetOperationsStatus_Example. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void virtualMachineBulkOperationsBulkGetOperationsStatusGeneratedByMinimumSetRule( + public static void virtualMachineBulkOperationsBulkGetOperationsStatusExample( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.virtualMachineBulkOperations() - .bulkGetOperationsStatusWithResponse("myResourceGroup", "eastus2euap", - new GetOperationStatusContent().withOperationIds(Arrays.asList("a1b2c3d4-e5f6-7890-abcd-ef0123456789")), + .bulkGetOperationsStatusWithResponse("rgBulkactions", "useast2euap", + new GetOperationStatusContent().withOperationIds(Arrays.asList("406e7856-f94b-48ae-93ee-b062afee54e5")), com.azure.core.util.Context.NONE); } } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkHibernateOperationSamples.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkHibernateOperationSamples.java index 65153a491358..a7822f4966f6 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkHibernateOperationSamples.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkHibernateOperationSamples.java @@ -7,7 +7,8 @@ import com.azure.resourcemanager.compute.bulkactions.models.ExecuteHibernateContent; import com.azure.resourcemanager.compute.bulkactions.models.ExecutionParameters; import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType; -import com.azure.resourcemanager.compute.bulkactions.models.Resources; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceWithContext; +import com.azure.resourcemanager.compute.bulkactions.models.ResourcesWithContext; import com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy; import java.util.Arrays; @@ -16,40 +17,24 @@ */ public final class VirtualMachineBulkOperationsBulkHibernateOperationSamples { /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkHibernate_MinimumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkHibernate_MaximumSet_Gen.json */ /** - * Sample code: VirtualMachineBulkOperations_BulkHibernate - generated by [MinimumSet] rule. + * Sample code: VirtualMachineBulkOperations_BulkHibernate_Example. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void virtualMachineBulkOperationsBulkHibernateGeneratedByMinimumSetRule( + public static void virtualMachineBulkOperationsBulkHibernateExample( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.virtualMachineBulkOperations() - .bulkHibernateOperationWithResponse("myResourceGroup", "eastus2euap", new ExecuteHibernateContent() - .withExecutionParameters(new ExecutionParameters()) - .withResources(new Resources().withIds(Arrays.asList( - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkHibernate_MaximumSet_Gen.json - */ - /** - * Sample code: VirtualMachineBulkOperations_BulkHibernate - generated by [MaximumSet] rule. - * - * @param manager Entry point to ComputeBulkActionsManager. - */ - public static void virtualMachineBulkOperationsBulkHibernateGeneratedByMaximumSetRule( - com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { - manager.virtualMachineBulkOperations() - .bulkHibernateOperationWithResponse("myResourceGroup", "eastus2euap", new ExecuteHibernateContent() + .bulkHibernateOperationWithResponse("rgBulkactions", "useast2euap", new ExecuteHibernateContent() .withExecutionParameters(new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(2) - .withRetryWindowInMinutes(20) + .withRetryWindowInMinutes(19) .withOnFailureAction(ResourceOperationType.UNKNOWN))) - .withResources(new Resources().withIds(Arrays.asList( - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))), + .withResourcesWithContext( + new ResourcesWithContext().withResources(Arrays.asList(new ResourceWithContext().withResourceId( + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM") + .withResourceContext("hibernateContext")))), com.azure.core.util.Context.NONE); } } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkListOperationErrorsSamples.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkListOperationErrorsSamples.java new file mode 100644 index 000000000000..48c02faad181 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkListOperationErrorsSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +/** + * Samples for VirtualMachineBulkOperations BulkListOperationErrors. + */ +public final class VirtualMachineBulkOperationsBulkListOperationErrorsSamples { + /* + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkListOperationErrors_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineBulkOperations_BulkListOperationErrors_MinimumSet_Gen. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void virtualMachineBulkOperationsBulkListOperationErrorsMinimumSetGen( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.virtualMachineBulkOperations() + .bulkListOperationErrors("rgBulkactions", "useast2euap", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkListOperationErrors_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineBulkOperations_BulkListOperationErrors_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void virtualMachineBulkOperationsBulkListOperationErrorsExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.virtualMachineBulkOperations() + .bulkListOperationErrors("rgBulkactions", "useast2euap", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkReimageOperationSamples.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkReimageOperationSamples.java new file mode 100644 index 000000000000..f2720991648d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkReimageOperationSamples.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.resourcemanager.compute.bulkactions.models.ExecuteReimageRequest; +import com.azure.resourcemanager.compute.bulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.compute.bulkactions.models.OSProfileProvisioningData; +import com.azure.resourcemanager.compute.bulkactions.models.ReimagePayload; +import com.azure.resourcemanager.compute.bulkactions.models.ReimageResourceOverride; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType; +import com.azure.resourcemanager.compute.bulkactions.models.Resources; +import com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineReimageParameters; +import java.util.Arrays; + +/** + * Samples for VirtualMachineBulkOperations BulkReimageOperation. + */ +public final class VirtualMachineBulkOperationsBulkReimageOperationSamples { + /* + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkReimage_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineBulkOperations_BulkReimage_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void virtualMachineBulkOperationsBulkReimageExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.virtualMachineBulkOperations() + .bulkReimageOperationWithResponse("rgBulkactions", "useast2euap", new ExecuteReimageRequest() + .withExecutionParameters(new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(2) + .withRetryWindowInMinutes(19) + .withOnFailureAction(ResourceOperationType.UNKNOWN))) + .withResources(new Resources().withIds(Arrays.asList( + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))) + .withReimageParameters(new ReimagePayload() + .withBaseProfile(new VirtualMachineReimageParameters().withTempDisk(true) + .withExactVersion("zjmkrnqjmzs") + .withOsProfile(new OSProfileProvisioningData().withAdminPassword("fakeTokenPlaceholder") + .withCustomData("teyngslcznlxihiitqbul"))) + .withResourceOverrides(Arrays.asList(new ReimageResourceOverride().withResourceId( + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM") + .withProfile(new VirtualMachineReimageParameters().withTempDisk(true) + .withExactVersion("zjmkrnqjmzs") + .withOsProfile(new OSProfileProvisioningData().withAdminPassword("fakeTokenPlaceholder") + .withCustomData("teyngslcznlxihiitqbul")))))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkStartOperationSamples.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkStartOperationSamples.java index 3dfa4e48a4ec..8ef5153844f2 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkStartOperationSamples.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkStartOperationSamples.java @@ -7,7 +7,8 @@ import com.azure.resourcemanager.compute.bulkactions.models.ExecuteStartContent; import com.azure.resourcemanager.compute.bulkactions.models.ExecutionParameters; import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType; -import com.azure.resourcemanager.compute.bulkactions.models.Resources; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceWithContext; +import com.azure.resourcemanager.compute.bulkactions.models.ResourcesWithContext; import com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy; import java.util.Arrays; @@ -16,40 +17,24 @@ */ public final class VirtualMachineBulkOperationsBulkStartOperationSamples { /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkStart_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkStart_MaximumSet_Gen.json */ /** - * Sample code: VirtualMachineBulkOperations_BulkStart - generated by [MaximumSet] rule. + * Sample code: VirtualMachineBulkOperations_BulkStart_Example. * * @param manager Entry point to ComputeBulkActionsManager. */ - public static void virtualMachineBulkOperationsBulkStartGeneratedByMaximumSetRule( + public static void virtualMachineBulkOperationsBulkStartExample( com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { manager.virtualMachineBulkOperations() - .bulkStartOperationWithResponse("myResourceGroup", "eastus2euap", new ExecuteStartContent() + .bulkStartOperationWithResponse("rgBulkactions", "useast2euap", new ExecuteStartContent() .withExecutionParameters(new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(2) - .withRetryWindowInMinutes(20) + .withRetryWindowInMinutes(19) .withOnFailureAction(ResourceOperationType.UNKNOWN))) - .withResources(new Resources().withIds(Arrays.asList( - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: 2026-06-06/VirtualMachineBulkOperations_BulkStart_MinimumSet_Gen.json - */ - /** - * Sample code: VirtualMachineBulkOperations_BulkStart - generated by [MinimumSet] rule. - * - * @param manager Entry point to ComputeBulkActionsManager. - */ - public static void virtualMachineBulkOperationsBulkStartGeneratedByMinimumSetRule( - com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { - manager.virtualMachineBulkOperations() - .bulkStartOperationWithResponse("myResourceGroup", "eastus2euap", new ExecuteStartContent() - .withExecutionParameters(new ExecutionParameters()) - .withResources(new Resources().withIds(Arrays.asList( - "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))), + .withResourcesWithContext( + new ResourcesWithContext().withResources(Arrays.asList(new ResourceWithContext().withResourceId( + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM") + .withResourceContext("startContext")))), com.azure.core.util.Context.NONE); } } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkVdiFlexCreateOperationSamples.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkVdiFlexCreateOperationSamples.java new file mode 100644 index 000000000000..e8454d60c3f1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/samples/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkVdiFlexCreateOperationSamples.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.AllocationStrategy; +import com.azure.resourcemanager.compute.bulkactions.models.DistributionStrategy; +import com.azure.resourcemanager.compute.bulkactions.models.EvictionPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.ExecuteVdiCreateRequest; +import com.azure.resourcemanager.compute.bulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.compute.bulkactions.models.FlexProperties; +import com.azure.resourcemanager.compute.bulkactions.models.OsType; +import com.azure.resourcemanager.compute.bulkactions.models.PriorityProfile; +import com.azure.resourcemanager.compute.bulkactions.models.PriorityType; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceProvisionVdiPayload; +import com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.VmSizeProfile; +import com.azure.resourcemanager.compute.bulkactions.models.ZoneAllocationPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.ZonePreference; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualMachineBulkOperations BulkVdiFlexCreateOperation. + */ +public final class VirtualMachineBulkOperationsBulkVdiFlexCreateOperationSamples { + /* + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkVdiFlexCreate_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineBulkOperations_BulkVdiFlexCreate_Example. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void virtualMachineBulkOperationsBulkVdiFlexCreateExample( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.virtualMachineBulkOperations() + .bulkVdiFlexCreateOperationWithResponse("rgBulkactions", "useast2euap", new ExecuteVdiCreateRequest() + .withResourceConfigParameters(new ResourceProvisionVdiPayload().withBaseProfile(mapOf("plan", + BinaryData.fromBytes( + "{name=iemasqqkbixbewezyrhnpntjd, publisher=bvggylbvfstnscuupuithafvvgc, product=bguuzrknnuohugjhernflurpx, promotionCode=bxgonranwqoryfkhkfaumdgz, version=uyxetqmmzvqianqv}" + .getBytes(StandardCharsets.UTF_8)), + "zones", BinaryData.fromBytes("[wczj]".getBytes(StandardCharsets.UTF_8)), "identity", + BinaryData.fromBytes( + "{type=SystemAssigned, userAssignedIdentities={key7={}}}".getBytes(StandardCharsets.UTF_8)), + "extendedLocation", + BinaryData.fromBytes("{name=gbnxzymbdkxhwjpqkur, type=EdgeZone}".getBytes(StandardCharsets.UTF_8)), + "placement", + BinaryData.fromBytes( + "{zonePlacementPolicy=Any, includeZones=[inagtbtedobdea], excludeZones=[pvvwrhuhdpvbacwmesblpgwzk]}" + .getBytes(StandardCharsets.UTF_8)), + "tags", BinaryData.fromBytes("{key6824=cefndldgkx}".getBytes(StandardCharsets.UTF_8)), "properties", + BinaryData.fromBytes( + "{scheduledEventsPolicy={userInitiatedRedeploy={automaticallyApprove=true}, userInitiatedReboot={automaticallyApprove=true}, scheduledEventsAdditionalPublishingTargets={eventGridAndResourceGraph={enable=true, scheduledEventsApiVersion=lifncbftlkounuyfn}}, allInstancesDown={automaticallyApprove=true}}, storageProfile={imageReference={publisher=ojlplghybdamadvsrq, offer=uvnqoxhkxefqwbsvjgbswqy, sku=hajdxhjmlkx, version=u, sharedGalleryImageId=fz, communityGalleryImageId=tsfpcq, id=cdbrkpdicibtlliq}, osDisk={osType=Windows, encryptionSettings={diskEncryptionKey={secretUrl=vzkogocyw, sourceVault={id=lvzxxyypkeqlflftmfn}}, keyEncryptionKey={keyUrl=mjjkvgpoohatw, sourceVault={id=lvzxxyypkeqlflftmfn}}, enabled=true}, name=opogpznvctmraoajgizcyrfvpt, vhd={uri=elpzggtxubepzgjqvdbjmbu}, image={uri=elpzggtxubepzgjqvdbjmbu}, caching=None, writeAcceleratorEnabled=true, diffDiskSettings={option=Local, placement=CacheDisk}, createOption=FromImage, diskSizeGB=2, managedDisk={storageAccountType=Standard_LRS, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}, securityProfile={securityEncryptionType=VMGuestStateOnly, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}}, id=numddbqmkxuu}, deleteOption=Delete}, dataDisks=[{lun=7, name=nbthfzqsxyqvqnbgcljxbwyyoj, vhd={uri=elpzggtxubepzgjqvdbjmbu}, image={uri=elpzggtxubepzgjqvdbjmbu}, caching=None, writeAcceleratorEnabled=true, createOption=FromImage, diskSizeGB=19, managedDisk={storageAccountType=Standard_LRS, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}, securityProfile={securityEncryptionType=VMGuestStateOnly, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}}, id=numddbqmkxuu}, sourceResource={id=qnukyordmomtjjqabovlsxl}, toBeDetached=true, detachOption=ForceDetach, deleteOption=Delete}], diskControllerType=SCSI}, hardwareProfile={vmSize=szrnjqwbruz, vmSizeProperties={vCpusAvailable=24, vCpusPerCore=6}}, additionalCapabilities={ultraSSDEnabled=true, hibernationEnabled=true}, osProfile={computerName=bplxnfp, adminUsername=fxzbi, adminPassword=, customData=hbdlirohsgnbrahscboc, windowsConfiguration={provisionVMAgent=true, enableAutomaticUpdates=true, timeZone=t, additionalUnattendContent=[{passName=OobeSystem, componentName=Microsoft-Windows-Shell-Setup, settingName=AutoLogon, content=rguazthnx}], patchSettings={patchMode=Manual, enableHotpatching=true, assessmentMode=ImageDefault, automaticByPlatformSettings={rebootSetting=Unknown, bypassPlatformSafetyChecksOnUserSchedule=true}}, winRM={listeners=[{protocol=Http, certificateUrl=quhfapfpyeeocwvwtvuggoqqwt}]}}, linuxConfiguration={disablePasswordAuthentication=true, ssh={publicKeys=[{path=mrdfxnfjazxog, keyData=wfhrknkehgesontscqyrewfmhgwt}]}, provisionVMAgent=true, patchSettings={patchMode=ImageDefault, assessmentMode=ImageDefault, automaticByPlatformSettings={rebootSetting=Unknown, bypassPlatformSafetyChecksOnUserSchedule=true}}, enableVMAgentPlatformUpdates=true}, secrets=[{sourceVault={id=lvzxxyypkeqlflftmfn}, vaultCertificates=[{certificateUrl=crgbpfdvlohwkupdjp, certificateStore=hyx}]}], allowExtensionOperations=true, requireGuestProvisionSignal=true}, networkProfile={networkInterfaces=[{properties={primary=true, deleteOption=Delete}, id=ymfxctb}], networkApiVersion=2020-11-01, networkInterfaceConfigurations=[{name=qrkzoctmzjketostzabnra, properties={primary=true, deleteOption=Delete, enableAcceleratedNetworking=true, disableTcpStateTracking=true, enableFpga=true, enableIPForwarding=true, networkSecurityGroup={id=lvzxxyypkeqlflftmfn}, dnsSettings={dnsServers=[tqcqopnanyyiavfwhqbkarxtrfqbww]}, ipConfigurations=[{name=gqymuvgzzfmxqvdadx, properties={subnet={id=lvzxxyypkeqlflftmfn}, primary=true, publicIPAddressConfiguration={name=cwxsqjijtwbsyqdwht, properties={idleTimeoutInMinutes=17, deleteOption=Delete, dnsSettings={domainNameLabel=fampou, domainNameLabelScope=TenantReuse}, ipTags=[{ipTagType=hkjoxhqadudjartwooezaxl, tag=xywunkjglkmmwfpf}], publicIPPrefix={id=lvzxxyypkeqlflftmfn}, publicIPAddressVersion=IPv4, publicIPAllocationMethod=Dynamic}, sku={name=Basic, tier=Regional}, tags={key5442=qhpwpnylvmdthxazhxamnbhdfpf}}, privateIPAddressVersion=IPv4, applicationSecurityGroups=[{id=lvzxxyypkeqlflftmfn}], applicationGatewayBackendAddressPools=[{id=lvzxxyypkeqlflftmfn}], loadBalancerBackendAddressPools=[{id=lvzxxyypkeqlflftmfn}]}}], dscpConfiguration={id=lvzxxyypkeqlflftmfn}, auxiliaryMode=None, auxiliarySku=None}, tags={key9436=bjbadzbfvpszbsickv}}]}, securityProfile={uefiSettings={secureBootEnabled=true, vTpmEnabled=true}, encryptionAtHost=true, securityType=TrustedLaunch, encryptionIdentity={userAssignedIdentityResourceId=tnajlgbwcepmhytzb}, proxyAgentSettings={enabled=true, mode=Audit, keyIncarnationId=4, wireServer={mode=Audit, inVMAccessControlProfileReferenceId=xvlzroy}, imds={mode=Audit, inVMAccessControlProfileReferenceId=xvlzroy}, addProxyAgentExtension=true}}, diagnosticsProfile={bootDiagnostics={enabled=true, storageUri=pxuhtzehlfsqolbdleirgj}}, licenseType=ymwuemwuntbignqyvzqflvjpcdus, extensionsTimeBudget=dnyqmcijikzkltjav, scheduledEventsProfile={terminateNotificationProfile={notBeforeTimeout=owbwifqrlsdmm, enable=true}, osImageNotificationProfile={notBeforeTimeout=ataqykjdakdvyyzdspaqnhd, enable=true}}, userData=nwjvxe, capacityReservation={capacityReservationGroup={id=lvzxxyypkeqlflftmfn}}, applicationProfile={galleryApplications=[{tags=cmygipvpkegyclvpznfu, order=8, packageReferenceId=afrfkjdrtzftmwramfyu, configurationReference=nmfaspclhidtznslsps, treatFailureAsDeploymentFailure=true, enableAutomaticUpgrade=true}]}, vmExtensions=[{name=jkpmcxwuahpzwkvexgzpypk, properties={forceUpdateTag=dockqxgatsfzhctxrncuw, publisher=qesyfldbfoaexyoywhcxafdtdwcg, type=ptlmlzpbpbkfbu, typeHandlerVersion=crllsludntz, autoUpgradeMinorVersion=true, enableAutomaticUpgrade=true, settings={}, protectedSettings={}, suppressFailures=true, protectedSettingsFromKeyVault={secretUrl=vzkogocyw, sourceVault={id=lvzxxyypkeqlflftmfn}}, provisionAfterExtensions=[onbtyoeifafiktrkmal]}}]}" + .getBytes(StandardCharsets.UTF_8)), + "computeApiVersion", + BinaryData.fromBytes("axcvphjtsdjzcwqczcglmq".getBytes(StandardCharsets.UTF_8)), "name", + BinaryData.fromBytes("dbozdvegpdvqxltqipvmqsfgunpe".getBytes(StandardCharsets.UTF_8)))) + .withResourceOverrides(Arrays.asList(mapOf("plan", BinaryData.fromBytes( + "{name=iemasqqkbixbewezyrhnpntjd, publisher=bvggylbvfstnscuupuithafvvgc, product=bguuzrknnuohugjhernflurpx, promotionCode=bxgonranwqoryfkhkfaumdgz, version=uyxetqmmzvqianqv}" + .getBytes(StandardCharsets.UTF_8)), + "zones", BinaryData.fromBytes("[wczj]".getBytes(StandardCharsets.UTF_8)), "identity", + BinaryData.fromBytes( + "{type=SystemAssigned, userAssignedIdentities={key7={}}}".getBytes(StandardCharsets.UTF_8)), + "extendedLocation", + BinaryData + .fromBytes("{name=gbnxzymbdkxhwjpqkur, type=EdgeZone}".getBytes(StandardCharsets.UTF_8)), + "placement", + BinaryData.fromBytes( + "{zonePlacementPolicy=Any, includeZones=[inagtbtedobdea], excludeZones=[pvvwrhuhdpvbacwmesblpgwzk]}" + .getBytes(StandardCharsets.UTF_8)), + "tags", BinaryData.fromBytes("{key6824=cefndldgkx}".getBytes(StandardCharsets.UTF_8)), + "properties", + BinaryData.fromBytes( + "{scheduledEventsPolicy={userInitiatedRedeploy={automaticallyApprove=true}, userInitiatedReboot={automaticallyApprove=true}, scheduledEventsAdditionalPublishingTargets={eventGridAndResourceGraph={enable=true, scheduledEventsApiVersion=lifncbftlkounuyfn}}, allInstancesDown={automaticallyApprove=true}}, storageProfile={imageReference={publisher=ojlplghybdamadvsrq, offer=uvnqoxhkxefqwbsvjgbswqy, sku=hajdxhjmlkx, version=u, sharedGalleryImageId=fz, communityGalleryImageId=tsfpcq, id=cdbrkpdicibtlliq}, osDisk={osType=Windows, encryptionSettings={diskEncryptionKey={secretUrl=vzkogocyw, sourceVault={id=lvzxxyypkeqlflftmfn}}, keyEncryptionKey={keyUrl=mjjkvgpoohatw, sourceVault={id=lvzxxyypkeqlflftmfn}}, enabled=true}, name=opogpznvctmraoajgizcyrfvpt, vhd={uri=elpzggtxubepzgjqvdbjmbu}, image={uri=elpzggtxubepzgjqvdbjmbu}, caching=None, writeAcceleratorEnabled=true, diffDiskSettings={option=Local, placement=CacheDisk}, createOption=FromImage, diskSizeGB=2, managedDisk={storageAccountType=Standard_LRS, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}, securityProfile={securityEncryptionType=VMGuestStateOnly, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}}, id=numddbqmkxuu}, deleteOption=Delete}, dataDisks=[{lun=7, name=nbthfzqsxyqvqnbgcljxbwyyoj, vhd={uri=elpzggtxubepzgjqvdbjmbu}, image={uri=elpzggtxubepzgjqvdbjmbu}, caching=None, writeAcceleratorEnabled=true, createOption=FromImage, diskSizeGB=19, managedDisk={storageAccountType=Standard_LRS, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}, securityProfile={securityEncryptionType=VMGuestStateOnly, diskEncryptionSet={id=magvkzhdmzhktjlqkkk}}, id=numddbqmkxuu}, sourceResource={id=qnukyordmomtjjqabovlsxl}, toBeDetached=true, detachOption=ForceDetach, deleteOption=Delete}], diskControllerType=SCSI}, hardwareProfile={vmSize=szrnjqwbruz, vmSizeProperties={vCpusAvailable=24, vCpusPerCore=6}}, additionalCapabilities={ultraSSDEnabled=true, hibernationEnabled=true}, osProfile={computerName=bplxnfp, adminUsername=fxzbi, adminPassword=, customData=hbdlirohsgnbrahscboc, windowsConfiguration={provisionVMAgent=true, enableAutomaticUpdates=true, timeZone=t, additionalUnattendContent=[{passName=OobeSystem, componentName=Microsoft-Windows-Shell-Setup, settingName=AutoLogon, content=rguazthnx}], patchSettings={patchMode=Manual, enableHotpatching=true, assessmentMode=ImageDefault, automaticByPlatformSettings={rebootSetting=Unknown, bypassPlatformSafetyChecksOnUserSchedule=true}}, winRM={listeners=[{protocol=Http, certificateUrl=quhfapfpyeeocwvwtvuggoqqwt}]}}, linuxConfiguration={disablePasswordAuthentication=true, ssh={publicKeys=[{path=mrdfxnfjazxog, keyData=wfhrknkehgesontscqyrewfmhgwt}]}, provisionVMAgent=true, patchSettings={patchMode=ImageDefault, assessmentMode=ImageDefault, automaticByPlatformSettings={rebootSetting=Unknown, bypassPlatformSafetyChecksOnUserSchedule=true}}, enableVMAgentPlatformUpdates=true}, secrets=[{sourceVault={id=lvzxxyypkeqlflftmfn}, vaultCertificates=[{certificateUrl=crgbpfdvlohwkupdjp, certificateStore=hyx}]}], allowExtensionOperations=true, requireGuestProvisionSignal=true}, networkProfile={networkInterfaces=[{properties={primary=true, deleteOption=Delete}, id=ymfxctb}], networkApiVersion=2020-11-01, networkInterfaceConfigurations=[{name=qrkzoctmzjketostzabnra, properties={primary=true, deleteOption=Delete, enableAcceleratedNetworking=true, disableTcpStateTracking=true, enableFpga=true, enableIPForwarding=true, networkSecurityGroup={id=lvzxxyypkeqlflftmfn}, dnsSettings={dnsServers=[tqcqopnanyyiavfwhqbkarxtrfqbww]}, ipConfigurations=[{name=gqymuvgzzfmxqvdadx, properties={subnet={id=lvzxxyypkeqlflftmfn}, primary=true, publicIPAddressConfiguration={name=cwxsqjijtwbsyqdwht, properties={idleTimeoutInMinutes=17, deleteOption=Delete, dnsSettings={domainNameLabel=fampou, domainNameLabelScope=TenantReuse}, ipTags=[{ipTagType=hkjoxhqadudjartwooezaxl, tag=xywunkjglkmmwfpf}], publicIPPrefix={id=lvzxxyypkeqlflftmfn}, publicIPAddressVersion=IPv4, publicIPAllocationMethod=Dynamic}, sku={name=Basic, tier=Regional}, tags={key5442=qhpwpnylvmdthxazhxamnbhdfpf}}, privateIPAddressVersion=IPv4, applicationSecurityGroups=[{id=lvzxxyypkeqlflftmfn}], applicationGatewayBackendAddressPools=[{id=lvzxxyypkeqlflftmfn}], loadBalancerBackendAddressPools=[{id=lvzxxyypkeqlflftmfn}]}}], dscpConfiguration={id=lvzxxyypkeqlflftmfn}, auxiliaryMode=None, auxiliarySku=None}, tags={key9436=bjbadzbfvpszbsickv}}]}, securityProfile={uefiSettings={secureBootEnabled=true, vTpmEnabled=true}, encryptionAtHost=true, securityType=TrustedLaunch, encryptionIdentity={userAssignedIdentityResourceId=tnajlgbwcepmhytzb}, proxyAgentSettings={enabled=true, mode=Audit, keyIncarnationId=4, wireServer={mode=Audit, inVMAccessControlProfileReferenceId=xvlzroy}, imds={mode=Audit, inVMAccessControlProfileReferenceId=xvlzroy}, addProxyAgentExtension=true}}, diagnosticsProfile={bootDiagnostics={enabled=true, storageUri=pxuhtzehlfsqolbdleirgj}}, licenseType=ymwuemwuntbignqyvzqflvjpcdus, extensionsTimeBudget=dnyqmcijikzkltjav, scheduledEventsProfile={terminateNotificationProfile={notBeforeTimeout=owbwifqrlsdmm, enable=true}, osImageNotificationProfile={notBeforeTimeout=ataqykjdakdvyyzdspaqnhd, enable=true}}, userData=nwjvxe, capacityReservation={capacityReservationGroup={id=lvzxxyypkeqlflftmfn}}, applicationProfile={galleryApplications=[{tags=cmygipvpkegyclvpznfu, order=8, packageReferenceId=afrfkjdrtzftmwramfyu, configurationReference=nmfaspclhidtznslsps, treatFailureAsDeploymentFailure=true, enableAutomaticUpgrade=true}]}, vmExtensions=[{name=jkpmcxwuahpzwkvexgzpypk, properties={forceUpdateTag=dockqxgatsfzhctxrncuw, publisher=qesyfldbfoaexyoywhcxafdtdwcg, type=ptlmlzpbpbkfbu, typeHandlerVersion=crllsludntz, autoUpgradeMinorVersion=true, enableAutomaticUpgrade=true, settings={}, protectedSettings={}, suppressFailures=true, protectedSettingsFromKeyVault={secretUrl=vzkogocyw, sourceVault={id=lvzxxyypkeqlflftmfn}}, provisionAfterExtensions=[onbtyoeifafiktrkmal]}}]}" + .getBytes(StandardCharsets.UTF_8)), + "computeApiVersion", + BinaryData.fromBytes("axcvphjtsdjzcwqczcglmq".getBytes(StandardCharsets.UTF_8)), "name", + BinaryData.fromBytes("dbozdvegpdvqxltqipvmqsfgunpe".getBytes(StandardCharsets.UTF_8))))) + .withResourceCount(10) + .withResourcePrefix("mwbopevxbjcunljvruov") + .withFlexProperties(new FlexProperties() + .withVmSizeProfiles(Arrays.asList(new VmSizeProfile().withName("frbnnpdkq").withRank(7))) + .withOsType(OsType.WINDOWS) + .withPriorityProfile(new PriorityProfile().withType(PriorityType.REGULAR) + .withMaxPricePerVM(23.0D) + .withEvictionPolicy(EvictionPolicy.DELETE) + .withAllocationStrategy(AllocationStrategy.LOWEST_PRICE)) + .withZoneAllocationPolicy(new ZoneAllocationPolicy() + .withDistributionStrategy(DistributionStrategy.BEST_EFFORT_SINGLE_ZONE) + .withZonePreferences(Arrays + .asList(new ZonePreference().withZone("ixksjnaxwelhfpsoyjfaezievquqv").withRank(19)))) + .withMinCapacity(5))) + .withExecutionParameters(new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(2) + .withRetryWindowInMinutes(19) + .withOnFailureAction(ResourceOperationType.UNKNOWN))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-06-preview/VirtualMachineBulkOperations_BulkVdiFlexCreate_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineBulkOperations_BulkVdiFlexCreate_Example - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void virtualMachineBulkOperationsBulkVdiFlexCreateExampleGeneratedByMinimumSetRule( + com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager manager) { + manager.virtualMachineBulkOperations() + .bulkVdiFlexCreateOperationWithResponse("rgBulkactions", "useast2euap", + new ExecuteVdiCreateRequest() + .withResourceConfigParameters(new ResourceProvisionVdiPayload().withResourceCount(10) + .withFlexProperties(new FlexProperties() + .withVmSizeProfiles( + Arrays.asList(new VmSizeProfile().withName("Standard_D2ads_v5").withRank(7))) + .withOsType(OsType.WINDOWS) + .withPriorityProfile(new PriorityProfile()))) + .withExecutionParameters(new ExecutionParameters()), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/AcknowledgeBulkOperationErrorsRequestTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/AcknowledgeBulkOperationErrorsRequestTests.java new file mode 100644 index 000000000000..64e68dc203f9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/AcknowledgeBulkOperationErrorsRequestTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.AcknowledgeBulkOperationErrorsRequest; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class AcknowledgeBulkOperationErrorsRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AcknowledgeBulkOperationErrorsRequest model + = BinaryData.fromString("{\"operationIds\":[\"f\"]}").toObject(AcknowledgeBulkOperationErrorsRequest.class); + Assertions.assertEquals("f", model.operationIds().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AcknowledgeBulkOperationErrorsRequest model + = new AcknowledgeBulkOperationErrorsRequest().withOperationIds(Arrays.asList("f")); + model = BinaryData.fromObject(model).toObject(AcknowledgeBulkOperationErrorsRequest.class); + Assertions.assertEquals("f", model.operationIds().get(0)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/AcknowledgeBulkOperationErrorsResponseInnerTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/AcknowledgeBulkOperationErrorsResponseInnerTests.java new file mode 100644 index 000000000000..ceb09d41fdb0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/AcknowledgeBulkOperationErrorsResponseInnerTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.fluent.models.AcknowledgeBulkOperationErrorsResponseInner; +import org.junit.jupiter.api.Assertions; + +public final class AcknowledgeBulkOperationErrorsResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AcknowledgeBulkOperationErrorsResponseInner model = BinaryData.fromString( + "{\"acknowledged\":[\"t\",\"pnpulexxbczwtru\"],\"notFound\":[\"qzbqjvsov\",\"yokacspkw\"],\"skipped\":[\"zdobpxjmflbvvnch\",\"kcciwwzjuqkhr\",\"ajiwkuo\",\"oskg\"]}") + .toObject(AcknowledgeBulkOperationErrorsResponseInner.class); + Assertions.assertEquals("t", model.acknowledged().get(0)); + Assertions.assertEquals("qzbqjvsov", model.notFound().get(0)); + Assertions.assertEquals("zdobpxjmflbvvnch", model.skipped().get(0)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/AdditionalCapabilitiesTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/AdditionalCapabilitiesTests.java new file mode 100644 index 000000000000..9459b3b22d73 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/AdditionalCapabilitiesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.AdditionalCapabilities; +import org.junit.jupiter.api.Assertions; + +public final class AdditionalCapabilitiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AdditionalCapabilities model = BinaryData.fromString("{\"ultraSSDEnabled\":false,\"hibernationEnabled\":true}") + .toObject(AdditionalCapabilities.class); + Assertions.assertFalse(model.ultraSSDEnabled()); + Assertions.assertTrue(model.hibernationEnabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AdditionalCapabilities model + = new AdditionalCapabilities().withUltraSSDEnabled(false).withHibernationEnabled(true); + model = BinaryData.fromObject(model).toObject(AdditionalCapabilities.class); + Assertions.assertFalse(model.ultraSSDEnabled()); + Assertions.assertTrue(model.hibernationEnabled()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/AdditionalUnattendContentTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/AdditionalUnattendContentTests.java new file mode 100644 index 000000000000..62efbc2d6239 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/AdditionalUnattendContentTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.AdditionalUnattendContent; +import com.azure.resourcemanager.compute.bulkactions.models.AdditionalUnattendContentComponentName; +import com.azure.resourcemanager.compute.bulkactions.models.AdditionalUnattendContentPassName; +import com.azure.resourcemanager.compute.bulkactions.models.SettingNames; +import org.junit.jupiter.api.Assertions; + +public final class AdditionalUnattendContentTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AdditionalUnattendContent model = BinaryData.fromString( + "{\"passName\":\"OobeSystem\",\"componentName\":\"Microsoft-Windows-Shell-Setup\",\"settingName\":\"FirstLogonCommands\",\"content\":\"tdzumveekgpw\"}") + .toObject(AdditionalUnattendContent.class); + Assertions.assertEquals(AdditionalUnattendContentPassName.OOBE_SYSTEM, model.passName()); + Assertions.assertEquals(AdditionalUnattendContentComponentName.MICROSOFT_WINDOWS_SHELL_SETUP, + model.componentName()); + Assertions.assertEquals(SettingNames.FIRST_LOGON_COMMANDS, model.settingName()); + Assertions.assertEquals("tdzumveekgpw", model.content()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AdditionalUnattendContent model + = new AdditionalUnattendContent().withPassName(AdditionalUnattendContentPassName.OOBE_SYSTEM) + .withComponentName(AdditionalUnattendContentComponentName.MICROSOFT_WINDOWS_SHELL_SETUP) + .withSettingName(SettingNames.FIRST_LOGON_COMMANDS) + .withContent("tdzumveekgpw"); + model = BinaryData.fromObject(model).toObject(AdditionalUnattendContent.class); + Assertions.assertEquals(AdditionalUnattendContentPassName.OOBE_SYSTEM, model.passName()); + Assertions.assertEquals(AdditionalUnattendContentComponentName.MICROSOFT_WINDOWS_SHELL_SETUP, + model.componentName()); + Assertions.assertEquals(SettingNames.FIRST_LOGON_COMMANDS, model.settingName()); + Assertions.assertEquals("tdzumveekgpw", model.content()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/AllInstancesDownTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/AllInstancesDownTests.java new file mode 100644 index 000000000000..bda65271c69f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/AllInstancesDownTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.AllInstancesDown; +import org.junit.jupiter.api.Assertions; + +public final class AllInstancesDownTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AllInstancesDown model + = BinaryData.fromString("{\"automaticallyApprove\":false}").toObject(AllInstancesDown.class); + Assertions.assertFalse(model.allInstancesDownAutomaticallyApprove()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AllInstancesDown model = new AllInstancesDown().withAllInstancesDownAutomaticallyApprove(false); + model = BinaryData.fromObject(model).toObject(AllInstancesDown.class); + Assertions.assertFalse(model.allInstancesDownAutomaticallyApprove()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ApiEntityReferenceTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ApiEntityReferenceTests.java new file mode 100644 index 000000000000..f658ecdaa7bb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ApiEntityReferenceTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.ApiEntityReference; +import org.junit.jupiter.api.Assertions; + +public final class ApiEntityReferenceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ApiEntityReference model + = BinaryData.fromString("{\"id\":\"iebwwaloayqcgwrt\"}").toObject(ApiEntityReference.class); + Assertions.assertEquals("iebwwaloayqcgwrt", model.id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ApiEntityReference model = new ApiEntityReference().withId("iebwwaloayqcgwrt"); + model = BinaryData.fromObject(model).toObject(ApiEntityReference.class); + Assertions.assertEquals("iebwwaloayqcgwrt", model.id()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ApplicationProfileTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ApplicationProfileTests.java new file mode 100644 index 000000000000..45d8c0e688bf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ApplicationProfileTests.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.ApplicationProfile; +import com.azure.resourcemanager.compute.bulkactions.models.VMGalleryApplication; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ApplicationProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ApplicationProfile model = BinaryData.fromString( + "{\"galleryApplications\":[{\"tags\":\"nqvsaznqnto\",\"order\":577659304,\"packageReferenceId\":\"sgsahmkycgr\",\"configurationReference\":\"wjue\",\"treatFailureAsDeploymentFailure\":false,\"enableAutomaticUpgrade\":false},{\"tags\":\"u\",\"order\":1850094254,\"packageReferenceId\":\"ovsm\",\"configurationReference\":\"xwabmqoe\",\"treatFailureAsDeploymentFailure\":false,\"enableAutomaticUpgrade\":false},{\"tags\":\"tpuqujmq\",\"order\":1609409452,\"packageReferenceId\":\"fbtndoaong\",\"configurationReference\":\"cn\",\"treatFailureAsDeploymentFailure\":true,\"enableAutomaticUpgrade\":false}]}") + .toObject(ApplicationProfile.class); + Assertions.assertEquals("nqvsaznqnto", model.galleryApplications().get(0).tags()); + Assertions.assertEquals(577659304, model.galleryApplications().get(0).order()); + Assertions.assertEquals("sgsahmkycgr", model.galleryApplications().get(0).packageReferenceId()); + Assertions.assertEquals("wjue", model.galleryApplications().get(0).configurationReference()); + Assertions.assertFalse(model.galleryApplications().get(0).treatFailureAsDeploymentFailure()); + Assertions.assertFalse(model.galleryApplications().get(0).enableAutomaticUpgrade()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ApplicationProfile model = new ApplicationProfile().withGalleryApplications(Arrays.asList( + new VMGalleryApplication().withTags("nqvsaznqnto") + .withOrder(577659304) + .withPackageReferenceId("sgsahmkycgr") + .withConfigurationReference("wjue") + .withTreatFailureAsDeploymentFailure(false) + .withEnableAutomaticUpgrade(false), + new VMGalleryApplication().withTags("u") + .withOrder(1850094254) + .withPackageReferenceId("ovsm") + .withConfigurationReference("xwabmqoe") + .withTreatFailureAsDeploymentFailure(false) + .withEnableAutomaticUpgrade(false), + new VMGalleryApplication().withTags("tpuqujmq") + .withOrder(1609409452) + .withPackageReferenceId("fbtndoaong") + .withConfigurationReference("cn") + .withTreatFailureAsDeploymentFailure(true) + .withEnableAutomaticUpgrade(false))); + model = BinaryData.fromObject(model).toObject(ApplicationProfile.class); + Assertions.assertEquals("nqvsaznqnto", model.galleryApplications().get(0).tags()); + Assertions.assertEquals(577659304, model.galleryApplications().get(0).order()); + Assertions.assertEquals("sgsahmkycgr", model.galleryApplications().get(0).packageReferenceId()); + Assertions.assertEquals("wjue", model.galleryApplications().get(0).configurationReference()); + Assertions.assertFalse(model.galleryApplications().get(0).treatFailureAsDeploymentFailure()); + Assertions.assertFalse(model.galleryApplications().get(0).enableAutomaticUpgrade()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/BootDiagnosticsTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/BootDiagnosticsTests.java new file mode 100644 index 000000000000..aa6021b7182c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/BootDiagnosticsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.BootDiagnostics; +import org.junit.jupiter.api.Assertions; + +public final class BootDiagnosticsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BootDiagnostics model + = BinaryData.fromString("{\"enabled\":false,\"storageUri\":\"priolx\"}").toObject(BootDiagnostics.class); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("priolx", model.storageUri()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BootDiagnostics model = new BootDiagnostics().withEnabled(false).withStorageUri("priolx"); + model = BinaryData.fromObject(model).toObject(BootDiagnostics.class); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("priolx", model.storageUri()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/CancelOperationsContentTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/CancelOperationsContentTests.java index 3a37da3ab080..c58adec630ed 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/CancelOperationsContentTests.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/CancelOperationsContentTests.java @@ -13,16 +13,16 @@ public final class CancelOperationsContentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CancelOperationsContent model - = BinaryData.fromString("{\"operationIds\":[\"qvkoc\",\"cjdkwtnhxbnjbi\",\"sqrglssainq\",\"jwnzlljfmp\"]}") + = BinaryData.fromString("{\"operationIds\":[\"nltyfsoppusuesnz\",\"dejbavo\",\"xzdmohctb\"]}") .toObject(CancelOperationsContent.class); - Assertions.assertEquals("qvkoc", model.operationIds().get(0)); + Assertions.assertEquals("nltyfsoppusuesnz", model.operationIds().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CancelOperationsContent model = new CancelOperationsContent() - .withOperationIds(Arrays.asList("qvkoc", "cjdkwtnhxbnjbi", "sqrglssainq", "jwnzlljfmp")); + CancelOperationsContent model + = new CancelOperationsContent().withOperationIds(Arrays.asList("nltyfsoppusuesnz", "dejbavo", "xzdmohctb")); model = BinaryData.fromObject(model).toObject(CancelOperationsContent.class); - Assertions.assertEquals("qvkoc", model.operationIds().get(0)); + Assertions.assertEquals("nltyfsoppusuesnz", model.operationIds().get(0)); } } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/CapacityReservationProfileTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/CapacityReservationProfileTests.java new file mode 100644 index 000000000000..d61895ff6bc8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/CapacityReservationProfileTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.CapacityReservationProfile; +import org.junit.jupiter.api.Assertions; + +public final class CapacityReservationProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CapacityReservationProfile model + = BinaryData.fromString("{\"capacityReservationGroup\":{\"id\":\"cofudflvkgjub\"}}") + .toObject(CapacityReservationProfile.class); + Assertions.assertEquals("cofudflvkgjub", model.capacityReservationGroup().id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CapacityReservationProfile model + = new CapacityReservationProfile().withCapacityReservationGroup(new SubResource().withId("cofudflvkgjub")); + model = BinaryData.fromObject(model).toObject(CapacityReservationProfile.class); + Assertions.assertEquals("cofudflvkgjub", model.capacityReservationGroup().id()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/DataDiskTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/DataDiskTests.java new file mode 100644 index 000000000000..a303c4b903cb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/DataDiskTests.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.ApiEntityReference; +import com.azure.resourcemanager.compute.bulkactions.models.CachingTypes; +import com.azure.resourcemanager.compute.bulkactions.models.DataDisk; +import com.azure.resourcemanager.compute.bulkactions.models.DiskCreateOptionTypes; +import com.azure.resourcemanager.compute.bulkactions.models.DiskDeleteOptionTypes; +import com.azure.resourcemanager.compute.bulkactions.models.DiskDetachOptionTypes; +import com.azure.resourcemanager.compute.bulkactions.models.DiskEncryptionSetParametersContent; +import com.azure.resourcemanager.compute.bulkactions.models.ManagedDiskParametersContent; +import com.azure.resourcemanager.compute.bulkactions.models.SecurityEncryptionTypes; +import com.azure.resourcemanager.compute.bulkactions.models.StorageAccountTypes; +import com.azure.resourcemanager.compute.bulkactions.models.VMDiskSecurityProfile; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualHardDisk; +import org.junit.jupiter.api.Assertions; + +public final class DataDiskTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DataDisk model = BinaryData.fromString( + "{\"lun\":1553337592,\"name\":\"wndnhj\",\"vhd\":{\"uri\":\"whvylw\"},\"image\":{\"uri\":\"dhxujznbmpo\"},\"caching\":\"None\",\"writeAcceleratorEnabled\":false,\"createOption\":\"FromImage\",\"diskSizeGB\":741975656,\"managedDisk\":{\"storageAccountType\":\"Standard_LRS\",\"diskEncryptionSet\":{\"id\":\"upjm\"},\"securityProfile\":{\"securityEncryptionType\":\"VMGuestStateOnly\",\"diskEncryptionSet\":{\"id\":\"bcswsrt\"}},\"id\":\"iplrbpbewtghfgb\"},\"sourceResource\":{\"id\":\"wxzvlvqhjkb\"},\"toBeDetached\":true,\"detachOption\":\"ForceDetach\",\"deleteOption\":\"Delete\"}") + .toObject(DataDisk.class); + Assertions.assertEquals(1553337592, model.lun()); + Assertions.assertEquals("wndnhj", model.name()); + Assertions.assertEquals("whvylw", model.vhd().uri()); + Assertions.assertEquals("dhxujznbmpo", model.image().uri()); + Assertions.assertEquals(CachingTypes.NONE, model.caching()); + Assertions.assertFalse(model.writeAcceleratorEnabled()); + Assertions.assertEquals(DiskCreateOptionTypes.FROM_IMAGE, model.createOption()); + Assertions.assertEquals(741975656, model.diskSizeGB()); + Assertions.assertEquals("iplrbpbewtghfgb", model.managedDisk().id()); + Assertions.assertEquals(StorageAccountTypes.STANDARD_LRS, model.managedDisk().storageAccountType()); + Assertions.assertEquals("upjm", model.managedDisk().diskEncryptionSet().id()); + Assertions.assertEquals(SecurityEncryptionTypes.VMGUEST_STATE_ONLY, + model.managedDisk().securityProfile().securityEncryptionType()); + Assertions.assertEquals("bcswsrt", model.managedDisk().securityProfile().diskEncryptionSet().id()); + Assertions.assertEquals("wxzvlvqhjkb", model.sourceResource().id()); + Assertions.assertTrue(model.toBeDetached()); + Assertions.assertEquals(DiskDetachOptionTypes.FORCE_DETACH, model.detachOption()); + Assertions.assertEquals(DiskDeleteOptionTypes.DELETE, model.deleteOption()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DataDisk model + = new DataDisk().withLun(1553337592) + .withName("wndnhj") + .withVhd(new VirtualHardDisk().withUri("whvylw")) + .withImage(new VirtualHardDisk().withUri("dhxujznbmpo")) + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(false) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiskSizeGB(741975656) + .withManagedDisk(new ManagedDiskParametersContent().withId("iplrbpbewtghfgb") + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet(new DiskEncryptionSetParametersContent().withId("upjm")) + .withSecurityProfile(new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet(new DiskEncryptionSetParametersContent().withId("bcswsrt")))) + .withSourceResource(new ApiEntityReference().withId("wxzvlvqhjkb")) + .withToBeDetached(true) + .withDetachOption(DiskDetachOptionTypes.FORCE_DETACH) + .withDeleteOption(DiskDeleteOptionTypes.DELETE); + model = BinaryData.fromObject(model).toObject(DataDisk.class); + Assertions.assertEquals(1553337592, model.lun()); + Assertions.assertEquals("wndnhj", model.name()); + Assertions.assertEquals("whvylw", model.vhd().uri()); + Assertions.assertEquals("dhxujznbmpo", model.image().uri()); + Assertions.assertEquals(CachingTypes.NONE, model.caching()); + Assertions.assertFalse(model.writeAcceleratorEnabled()); + Assertions.assertEquals(DiskCreateOptionTypes.FROM_IMAGE, model.createOption()); + Assertions.assertEquals(741975656, model.diskSizeGB()); + Assertions.assertEquals("iplrbpbewtghfgb", model.managedDisk().id()); + Assertions.assertEquals(StorageAccountTypes.STANDARD_LRS, model.managedDisk().storageAccountType()); + Assertions.assertEquals("upjm", model.managedDisk().diskEncryptionSet().id()); + Assertions.assertEquals(SecurityEncryptionTypes.VMGUEST_STATE_ONLY, + model.managedDisk().securityProfile().securityEncryptionType()); + Assertions.assertEquals("bcswsrt", model.managedDisk().securityProfile().diskEncryptionSet().id()); + Assertions.assertEquals("wxzvlvqhjkb", model.sourceResource().id()); + Assertions.assertTrue(model.toBeDetached()); + Assertions.assertEquals(DiskDetachOptionTypes.FORCE_DETACH, model.detachOption()); + Assertions.assertEquals(DiskDeleteOptionTypes.DELETE, model.deleteOption()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/DiagnosticsProfileTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/DiagnosticsProfileTests.java new file mode 100644 index 000000000000..633ee201f2d8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/DiagnosticsProfileTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.BootDiagnostics; +import com.azure.resourcemanager.compute.bulkactions.models.DiagnosticsProfile; +import org.junit.jupiter.api.Assertions; + +public final class DiagnosticsProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DiagnosticsProfile model + = BinaryData.fromString("{\"bootDiagnostics\":{\"enabled\":false,\"storageUri\":\"xzfe\"}}") + .toObject(DiagnosticsProfile.class); + Assertions.assertFalse(model.bootDiagnostics().enabled()); + Assertions.assertEquals("xzfe", model.bootDiagnostics().storageUri()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DiagnosticsProfile model = new DiagnosticsProfile() + .withBootDiagnostics(new BootDiagnostics().withEnabled(false).withStorageUri("xzfe")); + model = BinaryData.fromObject(model).toObject(DiagnosticsProfile.class); + Assertions.assertFalse(model.bootDiagnostics().enabled()); + Assertions.assertEquals("xzfe", model.bootDiagnostics().storageUri()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/DiffDiskSettingsTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/DiffDiskSettingsTests.java new file mode 100644 index 000000000000..803e4c98c7bb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/DiffDiskSettingsTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.DiffDiskOptions; +import com.azure.resourcemanager.compute.bulkactions.models.DiffDiskPlacement; +import com.azure.resourcemanager.compute.bulkactions.models.DiffDiskSettings; +import org.junit.jupiter.api.Assertions; + +public final class DiffDiskSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DiffDiskSettings model = BinaryData.fromString("{\"option\":\"Local\",\"placement\":\"ResourceDisk\"}") + .toObject(DiffDiskSettings.class); + Assertions.assertEquals(DiffDiskOptions.LOCAL, model.option()); + Assertions.assertEquals(DiffDiskPlacement.RESOURCE_DISK, model.placement()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DiffDiskSettings model + = new DiffDiskSettings().withOption(DiffDiskOptions.LOCAL).withPlacement(DiffDiskPlacement.RESOURCE_DISK); + model = BinaryData.fromObject(model).toObject(DiffDiskSettings.class); + Assertions.assertEquals(DiffDiskOptions.LOCAL, model.option()); + Assertions.assertEquals(DiffDiskPlacement.RESOURCE_DISK, model.placement()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/DiskEncryptionSetParametersContentTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/DiskEncryptionSetParametersContentTests.java new file mode 100644 index 000000000000..2349b4ecf36d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/DiskEncryptionSetParametersContentTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.DiskEncryptionSetParametersContent; +import org.junit.jupiter.api.Assertions; + +public final class DiskEncryptionSetParametersContentTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DiskEncryptionSetParametersContent model + = BinaryData.fromString("{\"id\":\"wgxhn\"}").toObject(DiskEncryptionSetParametersContent.class); + Assertions.assertEquals("wgxhn", model.id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DiskEncryptionSetParametersContent model = new DiskEncryptionSetParametersContent().withId("wgxhn"); + model = BinaryData.fromObject(model).toObject(DiskEncryptionSetParametersContent.class); + Assertions.assertEquals("wgxhn", model.id()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/EncryptionIdentityTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/EncryptionIdentityTests.java new file mode 100644 index 000000000000..302bd18d0219 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/EncryptionIdentityTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.EncryptionIdentity; +import org.junit.jupiter.api.Assertions; + +public final class EncryptionIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EncryptionIdentity model + = BinaryData.fromString("{\"userAssignedIdentityResourceId\":\"zpof\"}").toObject(EncryptionIdentity.class); + Assertions.assertEquals("zpof", model.userAssignedIdentityResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EncryptionIdentity model = new EncryptionIdentity().withUserAssignedIdentityResourceId("zpof"); + model = BinaryData.fromObject(model).toObject(EncryptionIdentity.class); + Assertions.assertEquals("zpof", model.userAssignedIdentityResourceId()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/EventGridAndResourceGraphTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/EventGridAndResourceGraphTests.java new file mode 100644 index 000000000000..72454b54ad70 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/EventGridAndResourceGraphTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.EventGridAndResourceGraph; +import org.junit.jupiter.api.Assertions; + +public final class EventGridAndResourceGraphTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EventGridAndResourceGraph model + = BinaryData.fromString("{\"enable\":false,\"scheduledEventsApiVersion\":\"cmgyud\"}") + .toObject(EventGridAndResourceGraph.class); + Assertions.assertFalse(model.enable()); + Assertions.assertEquals("cmgyud", model.scheduledEventsApiVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EventGridAndResourceGraph model + = new EventGridAndResourceGraph().withEnable(false).withScheduledEventsApiVersion("cmgyud"); + model = BinaryData.fromObject(model).toObject(EventGridAndResourceGraph.class); + Assertions.assertFalse(model.enable()); + Assertions.assertEquals("cmgyud", model.scheduledEventsApiVersion()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteCreateContentTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteCreateContentTests.java new file mode 100644 index 000000000000..4ff22eb53e81 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteCreateContentTests.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.ExecuteCreateContent; +import com.azure.resourcemanager.compute.bulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceProvisionPayload; +import com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ExecuteCreateContentTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ExecuteCreateContent model = BinaryData.fromString( + "{\"resourceConfigParameters\":{\"baseProfile\":{\"snhu\":\"\\\"datadkvwrwjfe\\\"\",\"tmrldhugjzzdatq\":\"\\\"dataje\\\"\",\"gphuticndvka\":\"\\\"datahocdgeab\\\"\"},\"resourceOverrides\":[{\"tyhxhurokft\":\"\\\"datai\\\"\",\"iawxklry\":\"\\\"dataxolniwpwcukjfk\\\"\",\"cbacphejkotynqg\":\"\\\"datalwckbasyypnddhs\\\"\"},{\"ndlik\":\"\\\"datal\\\"\",\"bmadgak\":\"\\\"datayqkgfg\\\"\",\"ytb\":\"\\\"dataqsrxybzqqed\\\"\"},{\"lmmnkzsmodmglo\":\"\\\"dataqfou\\\"\",\"uqktap\":\"\\\"datagpbkwtmut\\\"\",\"kdosvqw\":\"\\\"datapwgcuertu\\\"\"}],\"resourceCount\":958772842,\"resourcePrefix\":\"dgbb\"},\"executionParameters\":{\"retryPolicy\":{\"retryCount\":914724830,\"retryWindowInMinutes\":298107669,\"onFailureAction\":\"GetInstanceView\"},\"verifyVmAgentHealth\":false}}") + .toObject(ExecuteCreateContent.class); + Assertions.assertEquals(958772842, model.resourceConfigParameters().resourceCount()); + Assertions.assertEquals("dgbb", model.resourceConfigParameters().resourcePrefix()); + Assertions.assertEquals(914724830, model.executionParameters().retryPolicy().retryCount()); + Assertions.assertEquals(298107669, model.executionParameters().retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals(ResourceOperationType.GET_INSTANCE_VIEW, + model.executionParameters().retryPolicy().onFailureAction()); + Assertions.assertFalse(model.executionParameters().verifyVmAgentHealth()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ExecuteCreateContent model = new ExecuteCreateContent() + .withResourceConfigParameters(new ResourceProvisionPayload() + .withBaseProfile( + mapOf("snhu", BinaryData.fromBytes("\"datadkvwrwjfe\"".getBytes(StandardCharsets.UTF_8)), + "tmrldhugjzzdatq", BinaryData.fromBytes("\"dataje\"".getBytes(StandardCharsets.UTF_8)), + "gphuticndvka", BinaryData.fromBytes("\"datahocdgeab\"".getBytes(StandardCharsets.UTF_8)))) + .withResourceOverrides(Arrays.asList( + mapOf("tyhxhurokft", BinaryData.fromBytes("\"datai\"".getBytes(StandardCharsets.UTF_8)), "iawxklry", + BinaryData.fromBytes("\"dataxolniwpwcukjfk\"".getBytes(StandardCharsets.UTF_8)), + "cbacphejkotynqg", + BinaryData.fromBytes("\"datalwckbasyypnddhs\"".getBytes(StandardCharsets.UTF_8))), + mapOf("ndlik", BinaryData.fromBytes("\"datal\"".getBytes(StandardCharsets.UTF_8)), "bmadgak", + BinaryData.fromBytes("\"datayqkgfg\"".getBytes(StandardCharsets.UTF_8)), "ytb", + BinaryData.fromBytes("\"dataqsrxybzqqed\"".getBytes(StandardCharsets.UTF_8))), + mapOf("lmmnkzsmodmglo", BinaryData.fromBytes("\"dataqfou\"".getBytes(StandardCharsets.UTF_8)), + "uqktap", BinaryData.fromBytes("\"datagpbkwtmut\"".getBytes(StandardCharsets.UTF_8)), "kdosvqw", + BinaryData.fromBytes("\"datapwgcuertu\"".getBytes(StandardCharsets.UTF_8))))) + .withResourceCount(958772842) + .withResourcePrefix("dgbb")) + .withExecutionParameters( + new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(914724830) + .withRetryWindowInMinutes(298107669) + .withOnFailureAction(ResourceOperationType.GET_INSTANCE_VIEW)).withVerifyVmAgentHealth(false)); + model = BinaryData.fromObject(model).toObject(ExecuteCreateContent.class); + Assertions.assertEquals(958772842, model.resourceConfigParameters().resourceCount()); + Assertions.assertEquals("dgbb", model.resourceConfigParameters().resourcePrefix()); + Assertions.assertEquals(914724830, model.executionParameters().retryPolicy().retryCount()); + Assertions.assertEquals(298107669, model.executionParameters().retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals(ResourceOperationType.GET_INSTANCE_VIEW, + model.executionParameters().retryPolicy().onFailureAction()); + Assertions.assertFalse(model.executionParameters().verifyVmAgentHealth()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteDeallocateContentTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteDeallocateContentTests.java index 7eb81ae7ee73..eb9e555c3450 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteDeallocateContentTests.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteDeallocateContentTests.java @@ -8,7 +8,9 @@ import com.azure.resourcemanager.compute.bulkactions.models.ExecuteDeallocateContent; import com.azure.resourcemanager.compute.bulkactions.models.ExecutionParameters; import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceWithContext; import com.azure.resourcemanager.compute.bulkactions.models.Resources; +import com.azure.resourcemanager.compute.bulkactions.models.ResourcesWithContext; import com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy; import java.util.Arrays; import org.junit.jupiter.api.Assertions; @@ -17,13 +19,16 @@ public final class ExecuteDeallocateContentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ExecuteDeallocateContent model = BinaryData.fromString( - "{\"executionParameters\":{\"retryPolicy\":{\"retryCount\":1273684509,\"retryWindowInMinutes\":2000849582,\"onFailureAction\":\"Delete\"}},\"resources\":{\"ids\":[\"nwzsymg\",\"zufcyzkohdbi\",\"anufhfcbjysag\",\"th\"]}}") + "{\"executionParameters\":{\"retryPolicy\":{\"retryCount\":1273684509,\"retryWindowInMinutes\":2000849582,\"onFailureAction\":\"Create\"},\"verifyVmAgentHealth\":false},\"resources\":{\"ids\":[\"symglzufcyz\",\"ohdbihanufh\",\"cbjy\",\"a\"]},\"resourcesWithContext\":{\"resources\":[{\"resourceId\":\"hxqh\",\"resourceContext\":\"bifpikxwczb\"}]}}") .toObject(ExecuteDeallocateContent.class); Assertions.assertEquals(1273684509, model.executionParameters().retryPolicy().retryCount()); Assertions.assertEquals(2000849582, model.executionParameters().retryPolicy().retryWindowInMinutes()); - Assertions.assertEquals(ResourceOperationType.DELETE, + Assertions.assertEquals(ResourceOperationType.CREATE, model.executionParameters().retryPolicy().onFailureAction()); - Assertions.assertEquals("nwzsymg", model.resources().ids().get(0)); + Assertions.assertFalse(model.executionParameters().verifyVmAgentHealth()); + Assertions.assertEquals("symglzufcyz", model.resources().ids().get(0)); + Assertions.assertEquals("hxqh", model.resourcesWithContext().resources().get(0).resourceId()); + Assertions.assertEquals("bifpikxwczb", model.resourcesWithContext().resources().get(0).resourceContext()); } @org.junit.jupiter.api.Test @@ -32,13 +37,18 @@ public void testSerialize() throws Exception { .withExecutionParameters( new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(1273684509) .withRetryWindowInMinutes(2000849582) - .withOnFailureAction(ResourceOperationType.DELETE))) - .withResources(new Resources().withIds(Arrays.asList("nwzsymg", "zufcyzkohdbi", "anufhfcbjysag", "th"))); + .withOnFailureAction(ResourceOperationType.CREATE)).withVerifyVmAgentHealth(false)) + .withResources(new Resources().withIds(Arrays.asList("symglzufcyz", "ohdbihanufh", "cbjy", "a"))) + .withResourcesWithContext(new ResourcesWithContext().withResources( + Arrays.asList(new ResourceWithContext().withResourceId("hxqh").withResourceContext("bifpikxwczb")))); model = BinaryData.fromObject(model).toObject(ExecuteDeallocateContent.class); Assertions.assertEquals(1273684509, model.executionParameters().retryPolicy().retryCount()); Assertions.assertEquals(2000849582, model.executionParameters().retryPolicy().retryWindowInMinutes()); - Assertions.assertEquals(ResourceOperationType.DELETE, + Assertions.assertEquals(ResourceOperationType.CREATE, model.executionParameters().retryPolicy().onFailureAction()); - Assertions.assertEquals("nwzsymg", model.resources().ids().get(0)); + Assertions.assertFalse(model.executionParameters().verifyVmAgentHealth()); + Assertions.assertEquals("symglzufcyz", model.resources().ids().get(0)); + Assertions.assertEquals("hxqh", model.resourcesWithContext().resources().get(0).resourceId()); + Assertions.assertEquals("bifpikxwczb", model.resourcesWithContext().resources().get(0).resourceContext()); } } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteDeleteContentTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteDeleteContentTests.java index 0ba65965418b..da8daaf0ff00 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteDeleteContentTests.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteDeleteContentTests.java @@ -8,7 +8,9 @@ import com.azure.resourcemanager.compute.bulkactions.models.ExecuteDeleteContent; import com.azure.resourcemanager.compute.bulkactions.models.ExecutionParameters; import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceWithContext; import com.azure.resourcemanager.compute.bulkactions.models.Resources; +import com.azure.resourcemanager.compute.bulkactions.models.ResourcesWithContext; import com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy; import java.util.Arrays; import org.junit.jupiter.api.Assertions; @@ -17,13 +19,16 @@ public final class ExecuteDeleteContentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ExecuteDeleteContent model = BinaryData.fromString( - "{\"executionParameters\":{\"retryPolicy\":{\"retryCount\":419560742,\"retryWindowInMinutes\":2045160621,\"onFailureAction\":\"Start\"}},\"resources\":{\"ids\":[\"odepoogin\",\"vamih\"]},\"forceDeletion\":true}") + "{\"executionParameters\":{\"retryPolicy\":{\"retryCount\":1744996179,\"retryWindowInMinutes\":299078768,\"onFailureAction\":\"Start\"},\"verifyVmAgentHealth\":true},\"resources\":{\"ids\":[\"nc\",\"cpecfvmmcoofs\",\"lzevgbmqjqab\",\"y\"]},\"resourcesWithContext\":{\"resources\":[{\"resourceId\":\"vkwlzuvccfwnf\",\"resourceContext\":\"bacfionlebxetq\"},{\"resourceId\":\"tzxdpnqbqqwx\",\"resourceContext\":\"jfeallnwsub\"},{\"resourceId\":\"snjampmng\",\"resourceContext\":\"zscxaqwo\"},{\"resourceId\":\"chcbonqvpkvlrxnj\",\"resourceContext\":\"ase\"}]},\"forceDeletion\":true}") .toObject(ExecuteDeleteContent.class); - Assertions.assertEquals(419560742, model.executionParameters().retryPolicy().retryCount()); - Assertions.assertEquals(2045160621, model.executionParameters().retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals(1744996179, model.executionParameters().retryPolicy().retryCount()); + Assertions.assertEquals(299078768, model.executionParameters().retryPolicy().retryWindowInMinutes()); Assertions.assertEquals(ResourceOperationType.START, model.executionParameters().retryPolicy().onFailureAction()); - Assertions.assertEquals("odepoogin", model.resources().ids().get(0)); + Assertions.assertTrue(model.executionParameters().verifyVmAgentHealth()); + Assertions.assertEquals("nc", model.resources().ids().get(0)); + Assertions.assertEquals("vkwlzuvccfwnf", model.resourcesWithContext().resources().get(0).resourceId()); + Assertions.assertEquals("bacfionlebxetq", model.resourcesWithContext().resources().get(0).resourceContext()); Assertions.assertTrue(model.forceDeletion()); } @@ -31,17 +36,25 @@ public void testDeserialize() throws Exception { public void testSerialize() throws Exception { ExecuteDeleteContent model = new ExecuteDeleteContent() .withExecutionParameters( - new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(419560742) - .withRetryWindowInMinutes(2045160621) - .withOnFailureAction(ResourceOperationType.START))) - .withResources(new Resources().withIds(Arrays.asList("odepoogin", "vamih"))) + new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(1744996179) + .withRetryWindowInMinutes(299078768) + .withOnFailureAction(ResourceOperationType.START)).withVerifyVmAgentHealth(true)) + .withResources(new Resources().withIds(Arrays.asList("nc", "cpecfvmmcoofs", "lzevgbmqjqab", "y"))) + .withResourcesWithContext(new ResourcesWithContext().withResources(Arrays.asList( + new ResourceWithContext().withResourceId("vkwlzuvccfwnf").withResourceContext("bacfionlebxetq"), + new ResourceWithContext().withResourceId("tzxdpnqbqqwx").withResourceContext("jfeallnwsub"), + new ResourceWithContext().withResourceId("snjampmng").withResourceContext("zscxaqwo"), + new ResourceWithContext().withResourceId("chcbonqvpkvlrxnj").withResourceContext("ase")))) .withForceDeletion(true); model = BinaryData.fromObject(model).toObject(ExecuteDeleteContent.class); - Assertions.assertEquals(419560742, model.executionParameters().retryPolicy().retryCount()); - Assertions.assertEquals(2045160621, model.executionParameters().retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals(1744996179, model.executionParameters().retryPolicy().retryCount()); + Assertions.assertEquals(299078768, model.executionParameters().retryPolicy().retryWindowInMinutes()); Assertions.assertEquals(ResourceOperationType.START, model.executionParameters().retryPolicy().onFailureAction()); - Assertions.assertEquals("odepoogin", model.resources().ids().get(0)); + Assertions.assertTrue(model.executionParameters().verifyVmAgentHealth()); + Assertions.assertEquals("nc", model.resources().ids().get(0)); + Assertions.assertEquals("vkwlzuvccfwnf", model.resourcesWithContext().resources().get(0).resourceId()); + Assertions.assertEquals("bacfionlebxetq", model.resourcesWithContext().resources().get(0).resourceContext()); Assertions.assertTrue(model.forceDeletion()); } } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteHibernateContentTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteHibernateContentTests.java index ea5e46934b2c..a0313ae0b14e 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteHibernateContentTests.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteHibernateContentTests.java @@ -8,7 +8,9 @@ import com.azure.resourcemanager.compute.bulkactions.models.ExecuteHibernateContent; import com.azure.resourcemanager.compute.bulkactions.models.ExecutionParameters; import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceWithContext; import com.azure.resourcemanager.compute.bulkactions.models.Resources; +import com.azure.resourcemanager.compute.bulkactions.models.ResourcesWithContext; import com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy; import java.util.Arrays; import org.junit.jupiter.api.Assertions; @@ -17,28 +19,39 @@ public final class ExecuteHibernateContentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ExecuteHibernateContent model = BinaryData.fromString( - "{\"executionParameters\":{\"retryPolicy\":{\"retryCount\":1273374631,\"retryWindowInMinutes\":631357498,\"onFailureAction\":\"Delete\"}},\"resources\":{\"ids\":[\"qpsoacctazak\",\"j\"]}}") + "{\"executionParameters\":{\"retryPolicy\":{\"retryCount\":1977769752,\"retryWindowInMinutes\":96730142,\"onFailureAction\":\"Delete\"},\"verifyVmAgentHealth\":true},\"resources\":{\"ids\":[\"wzo\",\"xjtfelluwfzit\",\"np\",\"qfpjk\"]},\"resourcesWithContext\":{\"resources\":[{\"resourceId\":\"ofpdvh\",\"resourceContext\":\"fxxypininmayhuy\"},{\"resourceId\":\"bkpodepooginuv\",\"resourceContext\":\"mihe\"},{\"resourceId\":\"gnarxzxtheo\",\"resourceContext\":\"usivye\"},{\"resourceId\":\"cciqihnhungbwjz\",\"resourceContext\":\"nfygxgispemvtz\"}]}}") .toObject(ExecuteHibernateContent.class); - Assertions.assertEquals(1273374631, model.executionParameters().retryPolicy().retryCount()); - Assertions.assertEquals(631357498, model.executionParameters().retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals(1977769752, model.executionParameters().retryPolicy().retryCount()); + Assertions.assertEquals(96730142, model.executionParameters().retryPolicy().retryWindowInMinutes()); Assertions.assertEquals(ResourceOperationType.DELETE, model.executionParameters().retryPolicy().onFailureAction()); - Assertions.assertEquals("qpsoacctazak", model.resources().ids().get(0)); + Assertions.assertTrue(model.executionParameters().verifyVmAgentHealth()); + Assertions.assertEquals("wzo", model.resources().ids().get(0)); + Assertions.assertEquals("ofpdvh", model.resourcesWithContext().resources().get(0).resourceId()); + Assertions.assertEquals("fxxypininmayhuy", model.resourcesWithContext().resources().get(0).resourceContext()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ExecuteHibernateContent model = new ExecuteHibernateContent() .withExecutionParameters( - new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(1273374631) - .withRetryWindowInMinutes(631357498) - .withOnFailureAction(ResourceOperationType.DELETE))) - .withResources(new Resources().withIds(Arrays.asList("qpsoacctazak", "j"))); + new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(1977769752) + .withRetryWindowInMinutes(96730142) + .withOnFailureAction(ResourceOperationType.DELETE)).withVerifyVmAgentHealth(true)) + .withResources(new Resources().withIds(Arrays.asList("wzo", "xjtfelluwfzit", "np", "qfpjk"))) + .withResourcesWithContext(new ResourcesWithContext().withResources(Arrays.asList( + new ResourceWithContext().withResourceId("ofpdvh").withResourceContext("fxxypininmayhuy"), + new ResourceWithContext().withResourceId("bkpodepooginuv").withResourceContext("mihe"), + new ResourceWithContext().withResourceId("gnarxzxtheo").withResourceContext("usivye"), + new ResourceWithContext().withResourceId("cciqihnhungbwjz").withResourceContext("nfygxgispemvtz")))); model = BinaryData.fromObject(model).toObject(ExecuteHibernateContent.class); - Assertions.assertEquals(1273374631, model.executionParameters().retryPolicy().retryCount()); - Assertions.assertEquals(631357498, model.executionParameters().retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals(1977769752, model.executionParameters().retryPolicy().retryCount()); + Assertions.assertEquals(96730142, model.executionParameters().retryPolicy().retryWindowInMinutes()); Assertions.assertEquals(ResourceOperationType.DELETE, model.executionParameters().retryPolicy().onFailureAction()); - Assertions.assertEquals("qpsoacctazak", model.resources().ids().get(0)); + Assertions.assertTrue(model.executionParameters().verifyVmAgentHealth()); + Assertions.assertEquals("wzo", model.resources().ids().get(0)); + Assertions.assertEquals("ofpdvh", model.resourcesWithContext().resources().get(0).resourceId()); + Assertions.assertEquals("fxxypininmayhuy", model.resourcesWithContext().resources().get(0).resourceContext()); } } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteStartContentTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteStartContentTests.java index 117948f870aa..28fba68e6424 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteStartContentTests.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteStartContentTests.java @@ -8,7 +8,9 @@ import com.azure.resourcemanager.compute.bulkactions.models.ExecuteStartContent; import com.azure.resourcemanager.compute.bulkactions.models.ExecutionParameters; import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceWithContext; import com.azure.resourcemanager.compute.bulkactions.models.Resources; +import com.azure.resourcemanager.compute.bulkactions.models.ResourcesWithContext; import com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy; import java.util.Arrays; import org.junit.jupiter.api.Assertions; @@ -17,28 +19,38 @@ public final class ExecuteStartContentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ExecuteStartContent model = BinaryData.fromString( - "{\"executionParameters\":{\"retryPolicy\":{\"retryCount\":257181558,\"retryWindowInMinutes\":224823369,\"onFailureAction\":\"Hibernate\"}},\"resources\":{\"ids\":[\"f\"]}}") + "{\"executionParameters\":{\"retryPolicy\":{\"retryCount\":947497777,\"retryWindowInMinutes\":3133273,\"onFailureAction\":\"Hibernate\"},\"verifyVmAgentHealth\":true},\"resources\":{\"ids\":[\"rcjd\"]},\"resourcesWithContext\":{\"resources\":[{\"resourceId\":\"nh\",\"resourceContext\":\"bnjbiksqrglssain\"},{\"resourceId\":\"p\",\"resourceContext\":\"wnzlljfmppeeb\"}]}}") .toObject(ExecuteStartContent.class); - Assertions.assertEquals(257181558, model.executionParameters().retryPolicy().retryCount()); - Assertions.assertEquals(224823369, model.executionParameters().retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals(947497777, model.executionParameters().retryPolicy().retryCount()); + Assertions.assertEquals(3133273, model.executionParameters().retryPolicy().retryWindowInMinutes()); Assertions.assertEquals(ResourceOperationType.HIBERNATE, model.executionParameters().retryPolicy().onFailureAction()); - Assertions.assertEquals("f", model.resources().ids().get(0)); + Assertions.assertTrue(model.executionParameters().verifyVmAgentHealth()); + Assertions.assertEquals("rcjd", model.resources().ids().get(0)); + Assertions.assertEquals("nh", model.resourcesWithContext().resources().get(0).resourceId()); + Assertions.assertEquals("bnjbiksqrglssain", model.resourcesWithContext().resources().get(0).resourceContext()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ExecuteStartContent model = new ExecuteStartContent() - .withExecutionParameters( - new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(257181558) - .withRetryWindowInMinutes(224823369) - .withOnFailureAction(ResourceOperationType.HIBERNATE))) - .withResources(new Resources().withIds(Arrays.asList("f"))); + ExecuteStartContent model + = new ExecuteStartContent() + .withExecutionParameters( + new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(947497777) + .withRetryWindowInMinutes(3133273) + .withOnFailureAction(ResourceOperationType.HIBERNATE)).withVerifyVmAgentHealth(true)) + .withResources(new Resources().withIds(Arrays.asList("rcjd"))) + .withResourcesWithContext(new ResourcesWithContext().withResources(Arrays.asList( + new ResourceWithContext().withResourceId("nh").withResourceContext("bnjbiksqrglssain"), + new ResourceWithContext().withResourceId("p").withResourceContext("wnzlljfmppeeb")))); model = BinaryData.fromObject(model).toObject(ExecuteStartContent.class); - Assertions.assertEquals(257181558, model.executionParameters().retryPolicy().retryCount()); - Assertions.assertEquals(224823369, model.executionParameters().retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals(947497777, model.executionParameters().retryPolicy().retryCount()); + Assertions.assertEquals(3133273, model.executionParameters().retryPolicy().retryWindowInMinutes()); Assertions.assertEquals(ResourceOperationType.HIBERNATE, model.executionParameters().retryPolicy().onFailureAction()); - Assertions.assertEquals("f", model.resources().ids().get(0)); + Assertions.assertTrue(model.executionParameters().verifyVmAgentHealth()); + Assertions.assertEquals("rcjd", model.resources().ids().get(0)); + Assertions.assertEquals("nh", model.resourcesWithContext().resources().get(0).resourceId()); + Assertions.assertEquals("bnjbiksqrglssain", model.resourcesWithContext().resources().get(0).resourceContext()); } } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteVdiCreateRequestTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteVdiCreateRequestTests.java new file mode 100644 index 000000000000..74fa775c512a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecuteVdiCreateRequestTests.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.AllocationStrategy; +import com.azure.resourcemanager.compute.bulkactions.models.DistributionStrategy; +import com.azure.resourcemanager.compute.bulkactions.models.EvictionPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.ExecuteVdiCreateRequest; +import com.azure.resourcemanager.compute.bulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.compute.bulkactions.models.FlexProperties; +import com.azure.resourcemanager.compute.bulkactions.models.OsType; +import com.azure.resourcemanager.compute.bulkactions.models.PriorityProfile; +import com.azure.resourcemanager.compute.bulkactions.models.PriorityType; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceOperationType; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceProvisionVdiPayload; +import com.azure.resourcemanager.compute.bulkactions.models.RetryPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.VmSizeProfile; +import com.azure.resourcemanager.compute.bulkactions.models.ZoneAllocationPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.ZonePreference; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ExecuteVdiCreateRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ExecuteVdiCreateRequest model = BinaryData.fromString( + "{\"resourceConfigParameters\":{\"baseProfile\":{\"jeiachboosfl\":\"\\\"dataewmdw\\\"\",\"fqpte\":\"\\\"dataro\\\"\",\"i\":\"\\\"datahzzvypyq\\\"\",\"npvswjdkirso\":\"\\\"dataz\\\"\"},\"resourceOverrides\":[{\"mnoh\":\"\\\"datahc\\\"\"},{\"ifiyipjxsqwpgrj\":\"\\\"datackwhds\\\"\"}],\"resourceCount\":1493964267,\"resourcePrefix\":\"orcjxvsnby\",\"flexProperties\":{\"vmSizeProfiles\":[{\"name\":\"abnmocpcyshu\",\"rank\":818060655},{\"name\":\"afbljjgpbtoqcjmk\",\"rank\":897001974}],\"osType\":\"Windows\",\"priorityProfile\":{\"type\":\"Regular\",\"maxPricePerVM\":51.46626214406764,\"evictionPolicy\":\"Deallocate\",\"allocationStrategy\":\"LowestPrice\"},\"zoneAllocationPolicy\":{\"distributionStrategy\":\"BestEffortBalanced\",\"zonePreferences\":[{\"zone\":\"kudjkrlkhb\",\"rank\":375716095}]},\"minCapacity\":194307867}},\"executionParameters\":{\"retryPolicy\":{\"retryCount\":1382743089,\"retryWindowInMinutes\":701234104,\"onFailureAction\":\"Delete\"},\"verifyVmAgentHealth\":false}}") + .toObject(ExecuteVdiCreateRequest.class); + Assertions.assertEquals(1493964267, model.resourceConfigParameters().resourceCount()); + Assertions.assertEquals("orcjxvsnby", model.resourceConfigParameters().resourcePrefix()); + Assertions.assertEquals("abnmocpcyshu", + model.resourceConfigParameters().flexProperties().vmSizeProfiles().get(0).name()); + Assertions.assertEquals(818060655, + model.resourceConfigParameters().flexProperties().vmSizeProfiles().get(0).rank()); + Assertions.assertEquals(OsType.WINDOWS, model.resourceConfigParameters().flexProperties().osType()); + Assertions.assertEquals(PriorityType.REGULAR, + model.resourceConfigParameters().flexProperties().priorityProfile().type()); + Assertions.assertEquals(51.46626214406764D, + model.resourceConfigParameters().flexProperties().priorityProfile().maxPricePerVM()); + Assertions.assertEquals(EvictionPolicy.DEALLOCATE, + model.resourceConfigParameters().flexProperties().priorityProfile().evictionPolicy()); + Assertions.assertEquals(AllocationStrategy.LOWEST_PRICE, + model.resourceConfigParameters().flexProperties().priorityProfile().allocationStrategy()); + Assertions.assertEquals(DistributionStrategy.BEST_EFFORT_BALANCED, + model.resourceConfigParameters().flexProperties().zoneAllocationPolicy().distributionStrategy()); + Assertions.assertEquals("kudjkrlkhb", + model.resourceConfigParameters().flexProperties().zoneAllocationPolicy().zonePreferences().get(0).zone()); + Assertions.assertEquals(375716095, + model.resourceConfigParameters().flexProperties().zoneAllocationPolicy().zonePreferences().get(0).rank()); + Assertions.assertEquals(194307867, model.resourceConfigParameters().flexProperties().minCapacity()); + Assertions.assertEquals(1382743089, model.executionParameters().retryPolicy().retryCount()); + Assertions.assertEquals(701234104, model.executionParameters().retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals(ResourceOperationType.DELETE, + model.executionParameters().retryPolicy().onFailureAction()); + Assertions.assertFalse(model.executionParameters().verifyVmAgentHealth()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ExecuteVdiCreateRequest model = new ExecuteVdiCreateRequest() + .withResourceConfigParameters(new ResourceProvisionVdiPayload() + .withBaseProfile( + mapOf("jeiachboosfl", BinaryData.fromBytes("\"dataewmdw\"".getBytes(StandardCharsets.UTF_8)), + "fqpte", BinaryData.fromBytes("\"dataro\"".getBytes(StandardCharsets.UTF_8)), "i", + BinaryData.fromBytes("\"datahzzvypyq\"".getBytes(StandardCharsets.UTF_8)), "npvswjdkirso", + BinaryData.fromBytes("\"dataz\"".getBytes(StandardCharsets.UTF_8)))) + .withResourceOverrides( + Arrays.asList(mapOf("mnoh", BinaryData.fromBytes("\"datahc\"".getBytes(StandardCharsets.UTF_8))), + mapOf("ifiyipjxsqwpgrj", + BinaryData.fromBytes("\"datackwhds\"".getBytes(StandardCharsets.UTF_8))))) + .withResourceCount(1493964267) + .withResourcePrefix("orcjxvsnby") + .withFlexProperties(new FlexProperties() + .withVmSizeProfiles(Arrays.asList(new VmSizeProfile().withName("abnmocpcyshu").withRank(818060655), + new VmSizeProfile().withName("afbljjgpbtoqcjmk").withRank(897001974))) + .withOsType(OsType.WINDOWS) + .withPriorityProfile(new PriorityProfile().withType(PriorityType.REGULAR) + .withMaxPricePerVM(51.46626214406764D) + .withEvictionPolicy(EvictionPolicy.DEALLOCATE) + .withAllocationStrategy(AllocationStrategy.LOWEST_PRICE)) + .withZoneAllocationPolicy( + new ZoneAllocationPolicy().withDistributionStrategy(DistributionStrategy.BEST_EFFORT_BALANCED) + .withZonePreferences( + Arrays.asList(new ZonePreference().withZone("kudjkrlkhb").withRank(375716095)))) + .withMinCapacity(194307867))) + .withExecutionParameters( + new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(1382743089) + .withRetryWindowInMinutes(701234104) + .withOnFailureAction(ResourceOperationType.DELETE)).withVerifyVmAgentHealth(false)); + model = BinaryData.fromObject(model).toObject(ExecuteVdiCreateRequest.class); + Assertions.assertEquals(1493964267, model.resourceConfigParameters().resourceCount()); + Assertions.assertEquals("orcjxvsnby", model.resourceConfigParameters().resourcePrefix()); + Assertions.assertEquals("abnmocpcyshu", + model.resourceConfigParameters().flexProperties().vmSizeProfiles().get(0).name()); + Assertions.assertEquals(818060655, + model.resourceConfigParameters().flexProperties().vmSizeProfiles().get(0).rank()); + Assertions.assertEquals(OsType.WINDOWS, model.resourceConfigParameters().flexProperties().osType()); + Assertions.assertEquals(PriorityType.REGULAR, + model.resourceConfigParameters().flexProperties().priorityProfile().type()); + Assertions.assertEquals(51.46626214406764D, + model.resourceConfigParameters().flexProperties().priorityProfile().maxPricePerVM()); + Assertions.assertEquals(EvictionPolicy.DEALLOCATE, + model.resourceConfigParameters().flexProperties().priorityProfile().evictionPolicy()); + Assertions.assertEquals(AllocationStrategy.LOWEST_PRICE, + model.resourceConfigParameters().flexProperties().priorityProfile().allocationStrategy()); + Assertions.assertEquals(DistributionStrategy.BEST_EFFORT_BALANCED, + model.resourceConfigParameters().flexProperties().zoneAllocationPolicy().distributionStrategy()); + Assertions.assertEquals("kudjkrlkhb", + model.resourceConfigParameters().flexProperties().zoneAllocationPolicy().zonePreferences().get(0).zone()); + Assertions.assertEquals(375716095, + model.resourceConfigParameters().flexProperties().zoneAllocationPolicy().zonePreferences().get(0).rank()); + Assertions.assertEquals(194307867, model.resourceConfigParameters().flexProperties().minCapacity()); + Assertions.assertEquals(1382743089, model.executionParameters().retryPolicy().retryCount()); + Assertions.assertEquals(701234104, model.executionParameters().retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals(ResourceOperationType.DELETE, + model.executionParameters().retryPolicy().onFailureAction()); + Assertions.assertFalse(model.executionParameters().verifyVmAgentHealth()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecutionParametersTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecutionParametersTests.java index 3535f88607b0..ffb20d50f6bb 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecutionParametersTests.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ExecutionParametersTests.java @@ -14,22 +14,24 @@ public final class ExecutionParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ExecutionParameters model = BinaryData.fromString( - "{\"retryPolicy\":{\"retryCount\":1575612003,\"retryWindowInMinutes\":761383043,\"onFailureAction\":\"Delete\"}}") + "{\"retryPolicy\":{\"retryCount\":1384277756,\"retryWindowInMinutes\":196107786,\"onFailureAction\":\"Create\"},\"verifyVmAgentHealth\":true}") .toObject(ExecutionParameters.class); - Assertions.assertEquals(1575612003, model.retryPolicy().retryCount()); - Assertions.assertEquals(761383043, model.retryPolicy().retryWindowInMinutes()); - Assertions.assertEquals(ResourceOperationType.DELETE, model.retryPolicy().onFailureAction()); + Assertions.assertEquals(1384277756, model.retryPolicy().retryCount()); + Assertions.assertEquals(196107786, model.retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals(ResourceOperationType.CREATE, model.retryPolicy().onFailureAction()); + Assertions.assertTrue(model.verifyVmAgentHealth()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ExecutionParameters model - = new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(1575612003) - .withRetryWindowInMinutes(761383043) - .withOnFailureAction(ResourceOperationType.DELETE)); + = new ExecutionParameters().withRetryPolicy(new RetryPolicy().withRetryCount(1384277756) + .withRetryWindowInMinutes(196107786) + .withOnFailureAction(ResourceOperationType.CREATE)).withVerifyVmAgentHealth(true); model = BinaryData.fromObject(model).toObject(ExecutionParameters.class); - Assertions.assertEquals(1575612003, model.retryPolicy().retryCount()); - Assertions.assertEquals(761383043, model.retryPolicy().retryWindowInMinutes()); - Assertions.assertEquals(ResourceOperationType.DELETE, model.retryPolicy().onFailureAction()); + Assertions.assertEquals(1384277756, model.retryPolicy().retryCount()); + Assertions.assertEquals(196107786, model.retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals(ResourceOperationType.CREATE, model.retryPolicy().onFailureAction()); + Assertions.assertTrue(model.verifyVmAgentHealth()); } } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/FlexPropertiesTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/FlexPropertiesTests.java new file mode 100644 index 000000000000..8892a06d9b53 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/FlexPropertiesTests.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.AllocationStrategy; +import com.azure.resourcemanager.compute.bulkactions.models.DistributionStrategy; +import com.azure.resourcemanager.compute.bulkactions.models.EvictionPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.FlexProperties; +import com.azure.resourcemanager.compute.bulkactions.models.OsType; +import com.azure.resourcemanager.compute.bulkactions.models.PriorityProfile; +import com.azure.resourcemanager.compute.bulkactions.models.PriorityType; +import com.azure.resourcemanager.compute.bulkactions.models.VmSizeProfile; +import com.azure.resourcemanager.compute.bulkactions.models.ZoneAllocationPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.ZonePreference; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class FlexPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FlexProperties model = BinaryData.fromString( + "{\"vmSizeProfiles\":[{\"name\":\"pyeicxm\",\"rank\":1788510913},{\"name\":\"iwqvhkh\",\"rank\":1053923929},{\"name\":\"uigdtopbobjog\",\"rank\":10300487},{\"name\":\"e\",\"rank\":115410873}],\"osType\":\"Windows\",\"priorityProfile\":{\"type\":\"Regular\",\"maxPricePerVM\":78.93295036491774,\"evictionPolicy\":\"Deallocate\",\"allocationStrategy\":\"CapacityOptimized\"},\"zoneAllocationPolicy\":{\"distributionStrategy\":\"Prioritized\",\"zonePreferences\":[{\"zone\":\"dfgiot\",\"rank\":1858576873},{\"zone\":\"tutqxlngxlefgug\",\"rank\":2132514098}]},\"minCapacity\":1069562904}") + .toObject(FlexProperties.class); + Assertions.assertEquals("pyeicxm", model.vmSizeProfiles().get(0).name()); + Assertions.assertEquals(1788510913, model.vmSizeProfiles().get(0).rank()); + Assertions.assertEquals(OsType.WINDOWS, model.osType()); + Assertions.assertEquals(PriorityType.REGULAR, model.priorityProfile().type()); + Assertions.assertEquals(78.93295036491774D, model.priorityProfile().maxPricePerVM()); + Assertions.assertEquals(EvictionPolicy.DEALLOCATE, model.priorityProfile().evictionPolicy()); + Assertions.assertEquals(AllocationStrategy.CAPACITY_OPTIMIZED, model.priorityProfile().allocationStrategy()); + Assertions.assertEquals(DistributionStrategy.PRIORITIZED, model.zoneAllocationPolicy().distributionStrategy()); + Assertions.assertEquals("dfgiot", model.zoneAllocationPolicy().zonePreferences().get(0).zone()); + Assertions.assertEquals(1858576873, model.zoneAllocationPolicy().zonePreferences().get(0).rank()); + Assertions.assertEquals(1069562904, model.minCapacity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FlexProperties model = new FlexProperties() + .withVmSizeProfiles(Arrays.asList(new VmSizeProfile().withName("pyeicxm").withRank(1788510913), + new VmSizeProfile().withName("iwqvhkh").withRank(1053923929), + new VmSizeProfile().withName("uigdtopbobjog").withRank(10300487), + new VmSizeProfile().withName("e").withRank(115410873))) + .withOsType(OsType.WINDOWS) + .withPriorityProfile(new PriorityProfile().withType(PriorityType.REGULAR) + .withMaxPricePerVM(78.93295036491774D) + .withEvictionPolicy(EvictionPolicy.DEALLOCATE) + .withAllocationStrategy(AllocationStrategy.CAPACITY_OPTIMIZED)) + .withZoneAllocationPolicy( + new ZoneAllocationPolicy().withDistributionStrategy(DistributionStrategy.PRIORITIZED) + .withZonePreferences(Arrays.asList(new ZonePreference().withZone("dfgiot").withRank(1858576873), + new ZonePreference().withZone("tutqxlngxlefgug").withRank(2132514098)))) + .withMinCapacity(1069562904); + model = BinaryData.fromObject(model).toObject(FlexProperties.class); + Assertions.assertEquals("pyeicxm", model.vmSizeProfiles().get(0).name()); + Assertions.assertEquals(1788510913, model.vmSizeProfiles().get(0).rank()); + Assertions.assertEquals(OsType.WINDOWS, model.osType()); + Assertions.assertEquals(PriorityType.REGULAR, model.priorityProfile().type()); + Assertions.assertEquals(78.93295036491774D, model.priorityProfile().maxPricePerVM()); + Assertions.assertEquals(EvictionPolicy.DEALLOCATE, model.priorityProfile().evictionPolicy()); + Assertions.assertEquals(AllocationStrategy.CAPACITY_OPTIMIZED, model.priorityProfile().allocationStrategy()); + Assertions.assertEquals(DistributionStrategy.PRIORITIZED, model.zoneAllocationPolicy().distributionStrategy()); + Assertions.assertEquals("dfgiot", model.zoneAllocationPolicy().zonePreferences().get(0).zone()); + Assertions.assertEquals(1858576873, model.zoneAllocationPolicy().zonePreferences().get(0).rank()); + Assertions.assertEquals(1069562904, model.minCapacity()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/GetOperationStatusContentTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/GetOperationStatusContentTests.java index 157ca131c4e2..6d3bf7e97974 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/GetOperationStatusContentTests.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/GetOperationStatusContentTests.java @@ -12,16 +12,15 @@ public final class GetOperationStatusContentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - GetOperationStatusContent model = BinaryData.fromString("{\"operationIds\":[\"jaeq\",\"hqjbasvmsmj\"]}") - .toObject(GetOperationStatusContent.class); - Assertions.assertEquals("jaeq", model.operationIds().get(0)); + GetOperationStatusContent model + = BinaryData.fromString("{\"operationIds\":[\"xxhejjzzvd\"]}").toObject(GetOperationStatusContent.class); + Assertions.assertEquals("xxhejjzzvd", model.operationIds().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - GetOperationStatusContent model - = new GetOperationStatusContent().withOperationIds(Arrays.asList("jaeq", "hqjbasvmsmj")); + GetOperationStatusContent model = new GetOperationStatusContent().withOperationIds(Arrays.asList("xxhejjzzvd")); model = BinaryData.fromObject(model).toObject(GetOperationStatusContent.class); - Assertions.assertEquals("jaeq", model.operationIds().get(0)); + Assertions.assertEquals("xxhejjzzvd", model.operationIds().get(0)); } } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/HardwareProfileTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/HardwareProfileTests.java new file mode 100644 index 000000000000..0c941c08128e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/HardwareProfileTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.HardwareProfile; +import com.azure.resourcemanager.compute.bulkactions.models.VmSizeProperties; +import org.junit.jupiter.api.Assertions; + +public final class HardwareProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HardwareProfile model = BinaryData.fromString( + "{\"vmSize\":\"uzgwyzmhtx\",\"vmSizeProperties\":{\"vCpusAvailable\":1242740761,\"vCpusPerCore\":831729875}}") + .toObject(HardwareProfile.class); + Assertions.assertEquals("uzgwyzmhtx", model.vmSize()); + Assertions.assertEquals(1242740761, model.vmSizeProperties().vCpusAvailable()); + Assertions.assertEquals(831729875, model.vmSizeProperties().vCpusPerCore()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HardwareProfile model = new HardwareProfile().withVmSize("uzgwyzmhtx") + .withVmSizeProperties(new VmSizeProperties().withVCpusAvailable(1242740761).withVCpusPerCore(831729875)); + model = BinaryData.fromObject(model).toObject(HardwareProfile.class); + Assertions.assertEquals("uzgwyzmhtx", model.vmSize()); + Assertions.assertEquals(1242740761, model.vmSizeProperties().vCpusAvailable()); + Assertions.assertEquals(831729875, model.vmSizeProperties().vCpusPerCore()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/HostEndpointSettingsTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/HostEndpointSettingsTests.java new file mode 100644 index 000000000000..2ccc07747944 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/HostEndpointSettingsTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.HostEndpointSettings; +import com.azure.resourcemanager.compute.bulkactions.models.Modes; +import org.junit.jupiter.api.Assertions; + +public final class HostEndpointSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HostEndpointSettings model + = BinaryData.fromString("{\"mode\":\"Disabled\",\"inVMAccessControlProfileReferenceId\":\"hxx\"}") + .toObject(HostEndpointSettings.class); + Assertions.assertEquals(Modes.DISABLED, model.mode()); + Assertions.assertEquals("hxx", model.inVMAccessControlProfileReferenceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HostEndpointSettings model + = new HostEndpointSettings().withMode(Modes.DISABLED).withInVMAccessControlProfileReferenceId("hxx"); + model = BinaryData.fromObject(model).toObject(HostEndpointSettings.class); + Assertions.assertEquals(Modes.DISABLED, model.mode()); + Assertions.assertEquals("hxx", model.inVMAccessControlProfileReferenceId()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ImageReferenceTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ImageReferenceTests.java new file mode 100644 index 000000000000..2b78c5fa587e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ImageReferenceTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.ImageReference; +import org.junit.jupiter.api.Assertions; + +public final class ImageReferenceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ImageReference model = BinaryData.fromString( + "{\"publisher\":\"ofmxagkvtmelmqkr\",\"offer\":\"hvljuahaquh\",\"sku\":\"hmdua\",\"version\":\"exq\",\"sharedGalleryImageId\":\"fadmws\",\"communityGalleryImageId\":\"r\",\"id\":\"xpvgo\"}") + .toObject(ImageReference.class); + Assertions.assertEquals("xpvgo", model.id()); + Assertions.assertEquals("ofmxagkvtmelmqkr", model.publisher()); + Assertions.assertEquals("hvljuahaquh", model.offer()); + Assertions.assertEquals("hmdua", model.sku()); + Assertions.assertEquals("exq", model.version()); + Assertions.assertEquals("fadmws", model.sharedGalleryImageId()); + Assertions.assertEquals("r", model.communityGalleryImageId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ImageReference model = new ImageReference().withId("xpvgo") + .withPublisher("ofmxagkvtmelmqkr") + .withOffer("hvljuahaquh") + .withSku("hmdua") + .withVersion("exq") + .withSharedGalleryImageId("fadmws") + .withCommunityGalleryImageId("r"); + model = BinaryData.fromObject(model).toObject(ImageReference.class); + Assertions.assertEquals("xpvgo", model.id()); + Assertions.assertEquals("ofmxagkvtmelmqkr", model.publisher()); + Assertions.assertEquals("hvljuahaquh", model.offer()); + Assertions.assertEquals("hmdua", model.sku()); + Assertions.assertEquals("exq", model.version()); + Assertions.assertEquals("fadmws", model.sharedGalleryImageId()); + Assertions.assertEquals("r", model.communityGalleryImageId()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/InnerErrorTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/InnerErrorTests.java new file mode 100644 index 000000000000..082c94a1c72b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/InnerErrorTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.InnerError; +import org.junit.jupiter.api.Assertions; + +public final class InnerErrorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InnerError model = BinaryData.fromString("{\"exceptionType\":\"fxtsgum\",\"errorDetail\":\"glikkxwslolb\"}") + .toObject(InnerError.class); + Assertions.assertEquals("fxtsgum", model.exceptionType()); + Assertions.assertEquals("glikkxwslolb", model.errorDetail()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/LinuxPatchSettingsTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/LinuxPatchSettingsTests.java new file mode 100644 index 000000000000..61ac3bf7f106 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/LinuxPatchSettingsTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.LinuxPatchAssessmentMode; +import com.azure.resourcemanager.compute.bulkactions.models.LinuxPatchSettings; +import com.azure.resourcemanager.compute.bulkactions.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.compute.bulkactions.models.LinuxVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.compute.bulkactions.models.LinuxVMGuestPatchMode; +import org.junit.jupiter.api.Assertions; + +public final class LinuxPatchSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LinuxPatchSettings model = BinaryData.fromString( + "{\"patchMode\":\"AutomaticByPlatform\",\"assessmentMode\":\"AutomaticByPlatform\",\"automaticByPlatformSettings\":{\"rebootSetting\":\"Unknown\",\"bypassPlatformSafetyChecksOnUserSchedule\":true}}") + .toObject(LinuxPatchSettings.class); + Assertions.assertEquals(LinuxVMGuestPatchMode.AUTOMATIC_BY_PLATFORM, model.patchMode()); + Assertions.assertEquals(LinuxPatchAssessmentMode.AUTOMATIC_BY_PLATFORM, model.assessmentMode()); + Assertions.assertEquals(LinuxVMGuestPatchAutomaticByPlatformRebootSetting.UNKNOWN, + model.automaticByPlatformSettings().rebootSetting()); + Assertions.assertTrue(model.automaticByPlatformSettings().bypassPlatformSafetyChecksOnUserSchedule()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + LinuxPatchSettings model = new LinuxPatchSettings().withPatchMode(LinuxVMGuestPatchMode.AUTOMATIC_BY_PLATFORM) + .withAssessmentMode(LinuxPatchAssessmentMode.AUTOMATIC_BY_PLATFORM) + .withAutomaticByPlatformSettings(new LinuxVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting(LinuxVMGuestPatchAutomaticByPlatformRebootSetting.UNKNOWN) + .withBypassPlatformSafetyChecksOnUserSchedule(true)); + model = BinaryData.fromObject(model).toObject(LinuxPatchSettings.class); + Assertions.assertEquals(LinuxVMGuestPatchMode.AUTOMATIC_BY_PLATFORM, model.patchMode()); + Assertions.assertEquals(LinuxPatchAssessmentMode.AUTOMATIC_BY_PLATFORM, model.assessmentMode()); + Assertions.assertEquals(LinuxVMGuestPatchAutomaticByPlatformRebootSetting.UNKNOWN, + model.automaticByPlatformSettings().rebootSetting()); + Assertions.assertTrue(model.automaticByPlatformSettings().bypassPlatformSafetyChecksOnUserSchedule()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/LinuxVMGuestPatchAutomaticByPlatformSettingsTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/LinuxVMGuestPatchAutomaticByPlatformSettingsTests.java new file mode 100644 index 000000000000..3bf3f0c0e6be --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/LinuxVMGuestPatchAutomaticByPlatformSettingsTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.compute.bulkactions.models.LinuxVMGuestPatchAutomaticByPlatformSettings; +import org.junit.jupiter.api.Assertions; + +public final class LinuxVMGuestPatchAutomaticByPlatformSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LinuxVMGuestPatchAutomaticByPlatformSettings model + = BinaryData.fromString("{\"rebootSetting\":\"Never\",\"bypassPlatformSafetyChecksOnUserSchedule\":true}") + .toObject(LinuxVMGuestPatchAutomaticByPlatformSettings.class); + Assertions.assertEquals(LinuxVMGuestPatchAutomaticByPlatformRebootSetting.NEVER, model.rebootSetting()); + Assertions.assertTrue(model.bypassPlatformSafetyChecksOnUserSchedule()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + LinuxVMGuestPatchAutomaticByPlatformSettings model = new LinuxVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting(LinuxVMGuestPatchAutomaticByPlatformRebootSetting.NEVER) + .withBypassPlatformSafetyChecksOnUserSchedule(true); + model = BinaryData.fromObject(model).toObject(LinuxVMGuestPatchAutomaticByPlatformSettings.class); + Assertions.assertEquals(LinuxVMGuestPatchAutomaticByPlatformRebootSetting.NEVER, model.rebootSetting()); + Assertions.assertTrue(model.bypassPlatformSafetyChecksOnUserSchedule()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ManagedDiskParametersContentTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ManagedDiskParametersContentTests.java new file mode 100644 index 000000000000..b128522fe83f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ManagedDiskParametersContentTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.DiskEncryptionSetParametersContent; +import com.azure.resourcemanager.compute.bulkactions.models.ManagedDiskParametersContent; +import com.azure.resourcemanager.compute.bulkactions.models.SecurityEncryptionTypes; +import com.azure.resourcemanager.compute.bulkactions.models.StorageAccountTypes; +import com.azure.resourcemanager.compute.bulkactions.models.VMDiskSecurityProfile; +import org.junit.jupiter.api.Assertions; + +public final class ManagedDiskParametersContentTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedDiskParametersContent model = BinaryData.fromString( + "{\"storageAccountType\":\"StandardSSD_LRS\",\"diskEncryptionSet\":{\"id\":\"euecivyhzceuoj\"},\"securityProfile\":{\"securityEncryptionType\":\"DiskWithVMGuestState\",\"diskEncryptionSet\":{\"id\":\"eiotwmcdytdx\"}},\"id\":\"txnrjaw\"}") + .toObject(ManagedDiskParametersContent.class); + Assertions.assertEquals("txnrjaw", model.id()); + Assertions.assertEquals(StorageAccountTypes.STANDARD_SSD_LRS, model.storageAccountType()); + Assertions.assertEquals("euecivyhzceuoj", model.diskEncryptionSet().id()); + Assertions.assertEquals(SecurityEncryptionTypes.DISK_WITH_VMGUEST_STATE, + model.securityProfile().securityEncryptionType()); + Assertions.assertEquals("eiotwmcdytdx", model.securityProfile().diskEncryptionSet().id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedDiskParametersContent model + = new ManagedDiskParametersContent().withId("txnrjaw") + .withStorageAccountType(StorageAccountTypes.STANDARD_SSD_LRS) + .withDiskEncryptionSet(new DiskEncryptionSetParametersContent().withId("euecivyhzceuoj")) + .withSecurityProfile(new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.DISK_WITH_VMGUEST_STATE) + .withDiskEncryptionSet(new DiskEncryptionSetParametersContent().withId("eiotwmcdytdx"))); + model = BinaryData.fromObject(model).toObject(ManagedDiskParametersContent.class); + Assertions.assertEquals("txnrjaw", model.id()); + Assertions.assertEquals(StorageAccountTypes.STANDARD_SSD_LRS, model.storageAccountType()); + Assertions.assertEquals("euecivyhzceuoj", model.diskEncryptionSet().id()); + Assertions.assertEquals(SecurityEncryptionTypes.DISK_WITH_VMGUEST_STATE, + model.securityProfile().securityEncryptionType()); + Assertions.assertEquals("eiotwmcdytdx", model.securityProfile().diskEncryptionSet().id()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ManagedServiceIdentityTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ManagedServiceIdentityTests.java new file mode 100644 index 000000000000..587c9e696254 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ManagedServiceIdentityTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.compute.bulkactions.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.compute.bulkactions.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedServiceIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedServiceIdentity model = BinaryData.fromString( + "{\"principalId\":\"rncsdtclu\",\"tenantId\":\"ypbsfgytguslfead\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"vk\":{\"principalId\":\"kyhejhzisxgf\",\"clientId\":\"lolp\"},\"rcdlbhshfwpr\":{\"principalId\":\"pqvujzraehtwdwrf\",\"clientId\":\"wib\"},\"pnmdyodnwzxltjcv\":{\"principalId\":\"stwit\",\"clientId\":\"hevxcced\"}}}") + .toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("vk", new UserAssignedIdentity(), "rcdlbhshfwpr", + new UserAssignedIdentity(), "pnmdyodnwzxltjcv", new UserAssignedIdentity())); + model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/NetworkInterfaceReferencePropertiesTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/NetworkInterfaceReferencePropertiesTests.java new file mode 100644 index 000000000000..06ea2c92b24f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/NetworkInterfaceReferencePropertiesTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.DeleteOptions; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceReferenceProperties; +import org.junit.jupiter.api.Assertions; + +public final class NetworkInterfaceReferencePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkInterfaceReferenceProperties model + = BinaryData.fromString("{\"primary\":false,\"deleteOption\":\"Delete\"}") + .toObject(NetworkInterfaceReferenceProperties.class); + Assertions.assertFalse(model.primary()); + Assertions.assertEquals(DeleteOptions.DELETE, model.deleteOption()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkInterfaceReferenceProperties model + = new NetworkInterfaceReferenceProperties().withPrimary(false).withDeleteOption(DeleteOptions.DELETE); + model = BinaryData.fromObject(model).toObject(NetworkInterfaceReferenceProperties.class); + Assertions.assertFalse(model.primary()); + Assertions.assertEquals(DeleteOptions.DELETE, model.deleteOption()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/NetworkInterfaceReferenceTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/NetworkInterfaceReferenceTests.java new file mode 100644 index 000000000000..bbdfc162308e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/NetworkInterfaceReferenceTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.DeleteOptions; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceReference; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceReferenceProperties; +import org.junit.jupiter.api.Assertions; + +public final class NetworkInterfaceReferenceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkInterfaceReference model = BinaryData + .fromString("{\"properties\":{\"primary\":false,\"deleteOption\":\"Delete\"},\"id\":\"bpybsrfbjf\"}") + .toObject(NetworkInterfaceReference.class); + Assertions.assertEquals("bpybsrfbjf", model.id()); + Assertions.assertFalse(model.properties().primary()); + Assertions.assertEquals(DeleteOptions.DELETE, model.properties().deleteOption()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkInterfaceReference model = new NetworkInterfaceReference().withId("bpybsrfbjf") + .withProperties( + new NetworkInterfaceReferenceProperties().withPrimary(false).withDeleteOption(DeleteOptions.DELETE)); + model = BinaryData.fromObject(model).toObject(NetworkInterfaceReference.class); + Assertions.assertEquals("bpybsrfbjf", model.id()); + Assertions.assertFalse(model.properties().primary()); + Assertions.assertEquals(DeleteOptions.DELETE, model.properties().deleteOption()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/NetworkProfileTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/NetworkProfileTests.java new file mode 100644 index 000000000000..7f5aec1873fc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/NetworkProfileTests.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.DeleteOptions; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkApiVersion; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceAuxiliarySku; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceReference; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceReferenceProperties; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkProfile; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceConfigurationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceDnsSettingsConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceIPConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceIPConfigurationProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class NetworkProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkProfile model = BinaryData.fromString( + "{\"networkInterfaces\":[{\"properties\":{\"primary\":true,\"deleteOption\":\"Delete\"},\"id\":\"zfq\"}],\"networkApiVersion\":\"2020-11-01\",\"networkInterfaceConfigurations\":[{\"name\":\"opppcqeq\",\"properties\":{\"primary\":false,\"deleteOption\":\"Detach\",\"enableAcceleratedNetworking\":false,\"disableTcpStateTracking\":false,\"enableFpga\":true,\"enableIPForwarding\":true,\"networkSecurityGroup\":{\"id\":\"dmoizpostmg\"},\"dnsSettings\":{\"dnsServers\":[\"unrmfqjhhkxb\",\"vjymjhxxjyngud\",\"vkr\"]},\"ipConfigurations\":[{\"name\":\"wbxqzvszjfau\",\"properties\":{}},{\"name\":\"fdxxivetvtcqaqtd\",\"properties\":{}}],\"dscpConfiguration\":{\"id\":\"bxvwv\"},\"auxiliaryMode\":\"AcceleratedConnections\",\"auxiliarySku\":\"A2\"},\"tags\":{\"tkblmpewww\":\"sfxobl\",\"hxcr\":\"bkrvrnsvshqj\",\"sub\":\"bfovasrruvwbhsq\"}}]}") + .toObject(NetworkProfile.class); + Assertions.assertEquals("zfq", model.networkInterfaces().get(0).id()); + Assertions.assertTrue(model.networkInterfaces().get(0).properties().primary()); + Assertions.assertEquals(DeleteOptions.DELETE, model.networkInterfaces().get(0).properties().deleteOption()); + Assertions.assertEquals(NetworkApiVersion.TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE, model.networkApiVersion()); + Assertions.assertEquals("opppcqeq", model.networkInterfaceConfigurations().get(0).name()); + Assertions.assertFalse(model.networkInterfaceConfigurations().get(0).properties().primary()); + Assertions.assertEquals(DeleteOptions.DETACH, + model.networkInterfaceConfigurations().get(0).properties().deleteOption()); + Assertions + .assertFalse(model.networkInterfaceConfigurations().get(0).properties().enableAcceleratedNetworking()); + Assertions.assertFalse(model.networkInterfaceConfigurations().get(0).properties().disableTcpStateTracking()); + Assertions.assertTrue(model.networkInterfaceConfigurations().get(0).properties().enableFpga()); + Assertions.assertTrue(model.networkInterfaceConfigurations().get(0).properties().enableIPForwarding()); + Assertions.assertEquals("dmoizpostmg", + model.networkInterfaceConfigurations().get(0).properties().networkSecurityGroup().id()); + Assertions.assertEquals("unrmfqjhhkxb", + model.networkInterfaceConfigurations().get(0).properties().dnsSettings().dnsServers().get(0)); + Assertions.assertEquals("wbxqzvszjfau", + model.networkInterfaceConfigurations().get(0).properties().ipConfigurations().get(0).name()); + Assertions.assertEquals("bxvwv", + model.networkInterfaceConfigurations().get(0).properties().dscpConfiguration().id()); + Assertions.assertEquals(NetworkInterfaceAuxiliaryMode.ACCELERATED_CONNECTIONS, + model.networkInterfaceConfigurations().get(0).properties().auxiliaryMode()); + Assertions.assertEquals(NetworkInterfaceAuxiliarySku.A2, + model.networkInterfaceConfigurations().get(0).properties().auxiliarySku()); + Assertions.assertEquals("sfxobl", model.networkInterfaceConfigurations().get(0).tags().get("tkblmpewww")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkProfile model = new NetworkProfile() + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceReference().withId("zfq") + .withProperties(new NetworkInterfaceReferenceProperties().withPrimary(true) + .withDeleteOption(DeleteOptions.DELETE)))) + .withNetworkApiVersion(NetworkApiVersion.TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE) + .withNetworkInterfaceConfigurations( + Arrays.asList(new VirtualMachineNetworkInterfaceConfiguration().withName("opppcqeq") + .withProperties(new VirtualMachineNetworkInterfaceConfigurationProperties().withPrimary(false) + .withDeleteOption(DeleteOptions.DETACH) + .withEnableAcceleratedNetworking(false) + .withDisableTcpStateTracking(false) + .withEnableFpga(true) + .withEnableIPForwarding(true) + .withNetworkSecurityGroup(new SubResource().withId("dmoizpostmg")) + .withDnsSettings(new VirtualMachineNetworkInterfaceDnsSettingsConfiguration() + .withDnsServers(Arrays.asList("unrmfqjhhkxb", "vjymjhxxjyngud", "vkr"))) + .withIpConfigurations(Arrays.asList( + new VirtualMachineNetworkInterfaceIPConfiguration().withName("wbxqzvszjfau") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties()), + new VirtualMachineNetworkInterfaceIPConfiguration().withName("fdxxivetvtcqaqtd") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties()))) + .withDscpConfiguration(new SubResource().withId("bxvwv")) + .withAuxiliaryMode(NetworkInterfaceAuxiliaryMode.ACCELERATED_CONNECTIONS) + .withAuxiliarySku(NetworkInterfaceAuxiliarySku.A2)) + .withTags(mapOf("tkblmpewww", "sfxobl", "hxcr", "bkrvrnsvshqj", "sub", "bfovasrruvwbhsq")))); + model = BinaryData.fromObject(model).toObject(NetworkProfile.class); + Assertions.assertEquals("zfq", model.networkInterfaces().get(0).id()); + Assertions.assertTrue(model.networkInterfaces().get(0).properties().primary()); + Assertions.assertEquals(DeleteOptions.DELETE, model.networkInterfaces().get(0).properties().deleteOption()); + Assertions.assertEquals(NetworkApiVersion.TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE, model.networkApiVersion()); + Assertions.assertEquals("opppcqeq", model.networkInterfaceConfigurations().get(0).name()); + Assertions.assertFalse(model.networkInterfaceConfigurations().get(0).properties().primary()); + Assertions.assertEquals(DeleteOptions.DETACH, + model.networkInterfaceConfigurations().get(0).properties().deleteOption()); + Assertions + .assertFalse(model.networkInterfaceConfigurations().get(0).properties().enableAcceleratedNetworking()); + Assertions.assertFalse(model.networkInterfaceConfigurations().get(0).properties().disableTcpStateTracking()); + Assertions.assertTrue(model.networkInterfaceConfigurations().get(0).properties().enableFpga()); + Assertions.assertTrue(model.networkInterfaceConfigurations().get(0).properties().enableIPForwarding()); + Assertions.assertEquals("dmoizpostmg", + model.networkInterfaceConfigurations().get(0).properties().networkSecurityGroup().id()); + Assertions.assertEquals("unrmfqjhhkxb", + model.networkInterfaceConfigurations().get(0).properties().dnsSettings().dnsServers().get(0)); + Assertions.assertEquals("wbxqzvszjfau", + model.networkInterfaceConfigurations().get(0).properties().ipConfigurations().get(0).name()); + Assertions.assertEquals("bxvwv", + model.networkInterfaceConfigurations().get(0).properties().dscpConfiguration().id()); + Assertions.assertEquals(NetworkInterfaceAuxiliaryMode.ACCELERATED_CONNECTIONS, + model.networkInterfaceConfigurations().get(0).properties().auxiliaryMode()); + Assertions.assertEquals(NetworkInterfaceAuxiliarySku.A2, + model.networkInterfaceConfigurations().get(0).properties().auxiliarySku()); + Assertions.assertEquals("sfxobl", model.networkInterfaceConfigurations().get(0).tags().get("tkblmpewww")); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/OSImageNotificationProfileTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/OSImageNotificationProfileTests.java new file mode 100644 index 000000000000..79e08c73dd00 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/OSImageNotificationProfileTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.OSImageNotificationProfile; +import org.junit.jupiter.api.Assertions; + +public final class OSImageNotificationProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OSImageNotificationProfile model + = BinaryData.fromString("{\"notBeforeTimeout\":\"vtvudutncormr\",\"enable\":true}") + .toObject(OSImageNotificationProfile.class); + Assertions.assertEquals("vtvudutncormr", model.notBeforeTimeout()); + Assertions.assertTrue(model.enable()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OSImageNotificationProfile model + = new OSImageNotificationProfile().withNotBeforeTimeout("vtvudutncormr").withEnable(true); + model = BinaryData.fromObject(model).toObject(OSImageNotificationProfile.class); + Assertions.assertEquals("vtvudutncormr", model.notBeforeTimeout()); + Assertions.assertTrue(model.enable()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/OperationsListMockTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/OperationsListMockTests.java index 5c258aaa27ec..aacd476a1f7c 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/OperationsListMockTests.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/OperationsListMockTests.java @@ -21,7 +21,7 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"wpdappdsbdkv\",\"isDataAction\":true,\"display\":{\"provider\":\"eusnhutj\",\"resource\":\"tmrldhugjzzdatq\",\"operation\":\"oc\",\"description\":\"eablg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; + = "{\"value\":[{\"name\":\"vuzlm\",\"isDataAction\":false,\"display\":{\"provider\":\"ktgplcr\",\"resource\":\"jxeznoigbrnjwmw\",\"operation\":\"nbsazejjoqkag\",\"description\":\"sxtta\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/PatchSettingsTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/PatchSettingsTests.java new file mode 100644 index 000000000000..fb8b48fe139a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/PatchSettingsTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.PatchSettings; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsPatchAssessmentMode; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsVMGuestPatchMode; +import org.junit.jupiter.api.Assertions; + +public final class PatchSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PatchSettings model = BinaryData.fromString( + "{\"patchMode\":\"AutomaticByPlatform\",\"enableHotpatching\":false,\"assessmentMode\":\"ImageDefault\",\"automaticByPlatformSettings\":{\"rebootSetting\":\"Always\",\"bypassPlatformSafetyChecksOnUserSchedule\":false}}") + .toObject(PatchSettings.class); + Assertions.assertEquals(WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM, model.patchMode()); + Assertions.assertFalse(model.enableHotpatching()); + Assertions.assertEquals(WindowsPatchAssessmentMode.IMAGE_DEFAULT, model.assessmentMode()); + Assertions.assertEquals(WindowsVMGuestPatchAutomaticByPlatformRebootSetting.ALWAYS, + model.automaticByPlatformSettings().rebootSetting()); + Assertions.assertFalse(model.automaticByPlatformSettings().bypassPlatformSafetyChecksOnUserSchedule()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PatchSettings model = new PatchSettings().withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM) + .withEnableHotpatching(false) + .withAssessmentMode(WindowsPatchAssessmentMode.IMAGE_DEFAULT) + .withAutomaticByPlatformSettings(new WindowsVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting(WindowsVMGuestPatchAutomaticByPlatformRebootSetting.ALWAYS) + .withBypassPlatformSafetyChecksOnUserSchedule(false)); + model = BinaryData.fromObject(model).toObject(PatchSettings.class); + Assertions.assertEquals(WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM, model.patchMode()); + Assertions.assertFalse(model.enableHotpatching()); + Assertions.assertEquals(WindowsPatchAssessmentMode.IMAGE_DEFAULT, model.assessmentMode()); + Assertions.assertEquals(WindowsVMGuestPatchAutomaticByPlatformRebootSetting.ALWAYS, + model.automaticByPlatformSettings().rebootSetting()); + Assertions.assertFalse(model.automaticByPlatformSettings().bypassPlatformSafetyChecksOnUserSchedule()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/PriorityProfileTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/PriorityProfileTests.java new file mode 100644 index 000000000000..f456d7dfd106 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/PriorityProfileTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.AllocationStrategy; +import com.azure.resourcemanager.compute.bulkactions.models.EvictionPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.PriorityProfile; +import com.azure.resourcemanager.compute.bulkactions.models.PriorityType; +import org.junit.jupiter.api.Assertions; + +public final class PriorityProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PriorityProfile model = BinaryData.fromString( + "{\"type\":\"Regular\",\"maxPricePerVM\":31.157019464649917,\"evictionPolicy\":\"Delete\",\"allocationStrategy\":\"CapacityOptimized\"}") + .toObject(PriorityProfile.class); + Assertions.assertEquals(PriorityType.REGULAR, model.type()); + Assertions.assertEquals(31.157019464649917D, model.maxPricePerVM()); + Assertions.assertEquals(EvictionPolicy.DELETE, model.evictionPolicy()); + Assertions.assertEquals(AllocationStrategy.CAPACITY_OPTIMIZED, model.allocationStrategy()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PriorityProfile model = new PriorityProfile().withType(PriorityType.REGULAR) + .withMaxPricePerVM(31.157019464649917D) + .withEvictionPolicy(EvictionPolicy.DELETE) + .withAllocationStrategy(AllocationStrategy.CAPACITY_OPTIMIZED); + model = BinaryData.fromObject(model).toObject(PriorityProfile.class); + Assertions.assertEquals(PriorityType.REGULAR, model.type()); + Assertions.assertEquals(31.157019464649917D, model.maxPricePerVM()); + Assertions.assertEquals(EvictionPolicy.DELETE, model.evictionPolicy()); + Assertions.assertEquals(AllocationStrategy.CAPACITY_OPTIMIZED, model.allocationStrategy()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/PublicIPAddressSkuTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/PublicIPAddressSkuTests.java new file mode 100644 index 000000000000..43fd2268d2fa --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/PublicIPAddressSkuTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSku; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSkuName; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSkuTier; +import org.junit.jupiter.api.Assertions; + +public final class PublicIPAddressSkuTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PublicIPAddressSku model + = BinaryData.fromString("{\"name\":\"Standard\",\"tier\":\"Regional\"}").toObject(PublicIPAddressSku.class); + Assertions.assertEquals(PublicIPAddressSkuName.STANDARD, model.name()); + Assertions.assertEquals(PublicIPAddressSkuTier.REGIONAL, model.tier()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PublicIPAddressSku model = new PublicIPAddressSku().withName(PublicIPAddressSkuName.STANDARD) + .withTier(PublicIPAddressSkuTier.REGIONAL); + model = BinaryData.fromObject(model).toObject(PublicIPAddressSku.class); + Assertions.assertEquals(PublicIPAddressSkuName.STANDARD, model.name()); + Assertions.assertEquals(PublicIPAddressSkuTier.REGIONAL, model.tier()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourceNotificationDetailsTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourceNotificationDetailsTests.java new file mode 100644 index 000000000000..78d8d71c5b3e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourceNotificationDetailsTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceNotificationDetails; +import org.junit.jupiter.api.Assertions; + +public final class ResourceNotificationDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceNotificationDetails model + = BinaryData.fromString("{\"resourceContext\":\"dphlxaolt\"}").toObject(ResourceNotificationDetails.class); + Assertions.assertEquals("dphlxaolt", model.resourceContext()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourceProvisionPayloadTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourceProvisionPayloadTests.java new file mode 100644 index 000000000000..cba46c3b97dc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourceProvisionPayloadTests.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceProvisionPayload; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ResourceProvisionPayloadTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceProvisionPayload model = BinaryData.fromString( + "{\"baseProfile\":{\"gbquxigj\":\"\\\"datapbhtqqrolfpfpsa\\\"\",\"lnerkujysvleju\":\"\\\"datajgzjaoyfhrtx\\\"\",\"kcprbnw\":\"\\\"datafqawrlyxw\\\"\"},\"resourceOverrides\":[{\"p\":\"\\\"datavtb\\\"\",\"qguhmuo\":\"\\\"datasszdnru\\\"\",\"uitnwuiz\":\"\\\"dataqfprwzwbn\\\"\"},{\"ckyfih\":\"\\\"datazxufiz\\\"\"}],\"resourceCount\":1778385162,\"resourcePrefix\":\"dfvzwdzuhty\"}") + .toObject(ResourceProvisionPayload.class); + Assertions.assertEquals(1778385162, model.resourceCount()); + Assertions.assertEquals("dfvzwdzuhty", model.resourcePrefix()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceProvisionPayload model = new ResourceProvisionPayload() + .withBaseProfile( + mapOf("gbquxigj", BinaryData.fromBytes("\"datapbhtqqrolfpfpsa\"".getBytes(StandardCharsets.UTF_8)), + "lnerkujysvleju", BinaryData.fromBytes("\"datajgzjaoyfhrtx\"".getBytes(StandardCharsets.UTF_8)), + "kcprbnw", BinaryData.fromBytes("\"datafqawrlyxw\"".getBytes(StandardCharsets.UTF_8)))) + .withResourceOverrides(Arrays.asList( + mapOf("p", BinaryData.fromBytes("\"datavtb\"".getBytes(StandardCharsets.UTF_8)), "qguhmuo", + BinaryData.fromBytes("\"datasszdnru\"".getBytes(StandardCharsets.UTF_8)), "uitnwuiz", + BinaryData.fromBytes("\"dataqfprwzwbn\"".getBytes(StandardCharsets.UTF_8))), + mapOf("ckyfih", BinaryData.fromBytes("\"datazxufiz\"".getBytes(StandardCharsets.UTF_8))))) + .withResourceCount(1778385162) + .withResourcePrefix("dfvzwdzuhty"); + model = BinaryData.fromObject(model).toObject(ResourceProvisionPayload.class); + Assertions.assertEquals(1778385162, model.resourceCount()); + Assertions.assertEquals("dfvzwdzuhty", model.resourcePrefix()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourceProvisionVdiPayloadTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourceProvisionVdiPayloadTests.java new file mode 100644 index 000000000000..65bb63d77e6e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourceProvisionVdiPayloadTests.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.AllocationStrategy; +import com.azure.resourcemanager.compute.bulkactions.models.DistributionStrategy; +import com.azure.resourcemanager.compute.bulkactions.models.EvictionPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.FlexProperties; +import com.azure.resourcemanager.compute.bulkactions.models.OsType; +import com.azure.resourcemanager.compute.bulkactions.models.PriorityProfile; +import com.azure.resourcemanager.compute.bulkactions.models.PriorityType; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceProvisionVdiPayload; +import com.azure.resourcemanager.compute.bulkactions.models.VmSizeProfile; +import com.azure.resourcemanager.compute.bulkactions.models.ZoneAllocationPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.ZonePreference; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ResourceProvisionVdiPayloadTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceProvisionVdiPayload model = BinaryData.fromString( + "{\"baseProfile\":{\"glu\":\"\\\"dataxscpaierhhbc\\\"\"},\"resourceOverrides\":[{\"xkqpxo\":\"\\\"datatjaodxobnb\\\"\",\"po\":\"\\\"dataajionpimexgstxg\\\"\",\"djwzrlov\":\"\\\"datagmaajrm\\\"\",\"qsqsy\":\"\\\"dataclwhijcoejctbz\\\"\"}],\"resourceCount\":934868772,\"resourcePrefix\":\"bfkgukdkex\",\"flexProperties\":{\"vmSizeProfiles\":[{\"name\":\"pofm\",\"rank\":1878270858},{\"name\":\"x\",\"rank\":1757077121},{\"name\":\"jpgd\",\"rank\":681879854},{\"name\":\"ocjjxhvpmouexh\",\"rank\":2146697807}],\"osType\":\"Linux\",\"priorityProfile\":{\"type\":\"Regular\",\"maxPricePerVM\":73.19025188602264,\"evictionPolicy\":\"Deallocate\",\"allocationStrategy\":\"Prioritized\"},\"zoneAllocationPolicy\":{\"distributionStrategy\":\"Prioritized\",\"zonePreferences\":[{\"zone\":\"ntwndeicbtwnpzao\",\"rank\":1391069168},{\"zone\":\"uhrhcffcyddgl\",\"rank\":661873212},{\"zone\":\"t\",\"rank\":439652711}]},\"minCapacity\":478155788}}") + .toObject(ResourceProvisionVdiPayload.class); + Assertions.assertEquals(934868772, model.resourceCount()); + Assertions.assertEquals("bfkgukdkex", model.resourcePrefix()); + Assertions.assertEquals("pofm", model.flexProperties().vmSizeProfiles().get(0).name()); + Assertions.assertEquals(1878270858, model.flexProperties().vmSizeProfiles().get(0).rank()); + Assertions.assertEquals(OsType.LINUX, model.flexProperties().osType()); + Assertions.assertEquals(PriorityType.REGULAR, model.flexProperties().priorityProfile().type()); + Assertions.assertEquals(73.19025188602264D, model.flexProperties().priorityProfile().maxPricePerVM()); + Assertions.assertEquals(EvictionPolicy.DEALLOCATE, model.flexProperties().priorityProfile().evictionPolicy()); + Assertions.assertEquals(AllocationStrategy.PRIORITIZED, + model.flexProperties().priorityProfile().allocationStrategy()); + Assertions.assertEquals(DistributionStrategy.PRIORITIZED, + model.flexProperties().zoneAllocationPolicy().distributionStrategy()); + Assertions.assertEquals("ntwndeicbtwnpzao", + model.flexProperties().zoneAllocationPolicy().zonePreferences().get(0).zone()); + Assertions.assertEquals(1391069168, + model.flexProperties().zoneAllocationPolicy().zonePreferences().get(0).rank()); + Assertions.assertEquals(478155788, model.flexProperties().minCapacity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceProvisionVdiPayload model = new ResourceProvisionVdiPayload() + .withBaseProfile( + mapOf("glu", BinaryData.fromBytes("\"dataxscpaierhhbc\"".getBytes(StandardCharsets.UTF_8)))) + .withResourceOverrides(Arrays + .asList(mapOf("xkqpxo", BinaryData.fromBytes("\"datatjaodxobnb\"".getBytes(StandardCharsets.UTF_8)), + "po", BinaryData.fromBytes("\"dataajionpimexgstxg\"".getBytes(StandardCharsets.UTF_8)), "djwzrlov", + BinaryData.fromBytes("\"datagmaajrm\"".getBytes(StandardCharsets.UTF_8)), "qsqsy", + BinaryData.fromBytes("\"dataclwhijcoejctbz\"".getBytes(StandardCharsets.UTF_8))))) + .withResourceCount(934868772) + .withResourcePrefix("bfkgukdkex") + .withFlexProperties(new FlexProperties() + .withVmSizeProfiles(Arrays.asList(new VmSizeProfile().withName("pofm").withRank(1878270858), + new VmSizeProfile().withName("x").withRank(1757077121), + new VmSizeProfile().withName("jpgd").withRank(681879854), + new VmSizeProfile().withName("ocjjxhvpmouexh").withRank(2146697807))) + .withOsType(OsType.LINUX) + .withPriorityProfile(new PriorityProfile().withType(PriorityType.REGULAR) + .withMaxPricePerVM(73.19025188602264D) + .withEvictionPolicy(EvictionPolicy.DEALLOCATE) + .withAllocationStrategy(AllocationStrategy.PRIORITIZED)) + .withZoneAllocationPolicy( + new ZoneAllocationPolicy().withDistributionStrategy(DistributionStrategy.PRIORITIZED) + .withZonePreferences( + Arrays.asList(new ZonePreference().withZone("ntwndeicbtwnpzao").withRank(1391069168), + new ZonePreference().withZone("uhrhcffcyddgl").withRank(661873212), + new ZonePreference().withZone("t").withRank(439652711)))) + .withMinCapacity(478155788)); + model = BinaryData.fromObject(model).toObject(ResourceProvisionVdiPayload.class); + Assertions.assertEquals(934868772, model.resourceCount()); + Assertions.assertEquals("bfkgukdkex", model.resourcePrefix()); + Assertions.assertEquals("pofm", model.flexProperties().vmSizeProfiles().get(0).name()); + Assertions.assertEquals(1878270858, model.flexProperties().vmSizeProfiles().get(0).rank()); + Assertions.assertEquals(OsType.LINUX, model.flexProperties().osType()); + Assertions.assertEquals(PriorityType.REGULAR, model.flexProperties().priorityProfile().type()); + Assertions.assertEquals(73.19025188602264D, model.flexProperties().priorityProfile().maxPricePerVM()); + Assertions.assertEquals(EvictionPolicy.DEALLOCATE, model.flexProperties().priorityProfile().evictionPolicy()); + Assertions.assertEquals(AllocationStrategy.PRIORITIZED, + model.flexProperties().priorityProfile().allocationStrategy()); + Assertions.assertEquals(DistributionStrategy.PRIORITIZED, + model.flexProperties().zoneAllocationPolicy().distributionStrategy()); + Assertions.assertEquals("ntwndeicbtwnpzao", + model.flexProperties().zoneAllocationPolicy().zonePreferences().get(0).zone()); + Assertions.assertEquals(1391069168, + model.flexProperties().zoneAllocationPolicy().zonePreferences().get(0).rank()); + Assertions.assertEquals(478155788, model.flexProperties().minCapacity()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourceWithContextTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourceWithContextTests.java new file mode 100644 index 000000000000..a8bfad2bf40d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourceWithContextTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceWithContext; +import org.junit.jupiter.api.Assertions; + +public final class ResourceWithContextTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceWithContext model + = BinaryData.fromString("{\"resourceId\":\"nhsjcnyej\",\"resourceContext\":\"kryhtnapczwlokj\"}") + .toObject(ResourceWithContext.class); + Assertions.assertEquals("nhsjcnyej", model.resourceId()); + Assertions.assertEquals("kryhtnapczwlokj", model.resourceContext()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceWithContext model + = new ResourceWithContext().withResourceId("nhsjcnyej").withResourceContext("kryhtnapczwlokj"); + model = BinaryData.fromObject(model).toObject(ResourceWithContext.class); + Assertions.assertEquals("nhsjcnyej", model.resourceId()); + Assertions.assertEquals("kryhtnapczwlokj", model.resourceContext()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourcesTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourcesTests.java index 905cc7caa410..a6e7d743abc1 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourcesTests.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourcesTests.java @@ -12,15 +12,14 @@ public final class ResourcesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Resources model - = BinaryData.fromString("{\"ids\":[\"yscnpqxu\",\"ivyqniwbybrkxvd\"]}").toObject(Resources.class); - Assertions.assertEquals("yscnpqxu", model.ids().get(0)); + Resources model = BinaryData.fromString("{\"ids\":[\"ybrk\"]}").toObject(Resources.class); + Assertions.assertEquals("ybrk", model.ids().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Resources model = new Resources().withIds(Arrays.asList("yscnpqxu", "ivyqniwbybrkxvd")); + Resources model = new Resources().withIds(Arrays.asList("ybrk")); model = BinaryData.fromObject(model).toObject(Resources.class); - Assertions.assertEquals("yscnpqxu", model.ids().get(0)); + Assertions.assertEquals("ybrk", model.ids().get(0)); } } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourcesWithContextTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourcesWithContextTests.java new file mode 100644 index 000000000000..1d415106d4b3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ResourcesWithContextTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.ResourceWithContext; +import com.azure.resourcemanager.compute.bulkactions.models.ResourcesWithContext; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ResourcesWithContextTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourcesWithContext model = BinaryData + .fromString("{\"resources\":[{\"resourceId\":\"dumjgrtfwvuk\",\"resourceContext\":\"gaudcc\"}]}") + .toObject(ResourcesWithContext.class); + Assertions.assertEquals("dumjgrtfwvuk", model.resources().get(0).resourceId()); + Assertions.assertEquals("gaudcc", model.resources().get(0).resourceContext()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourcesWithContext model = new ResourcesWithContext().withResources( + Arrays.asList(new ResourceWithContext().withResourceId("dumjgrtfwvuk").withResourceContext("gaudcc"))); + model = BinaryData.fromObject(model).toObject(ResourcesWithContext.class); + Assertions.assertEquals("dumjgrtfwvuk", model.resources().get(0).resourceId()); + Assertions.assertEquals("gaudcc", model.resources().get(0).resourceContext()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/RetryPolicyTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/RetryPolicyTests.java index 21da01ec51bb..f147d6fd1268 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/RetryPolicyTests.java +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/RetryPolicyTests.java @@ -13,22 +13,21 @@ public final class RetryPolicyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RetryPolicy model = BinaryData - .fromString( - "{\"retryCount\":1913076092,\"retryWindowInMinutes\":1434472255,\"onFailureAction\":\"Create\"}") + .fromString("{\"retryCount\":222313615,\"retryWindowInMinutes\":1846033,\"onFailureAction\":\"Delete\"}") .toObject(RetryPolicy.class); - Assertions.assertEquals(1913076092, model.retryCount()); - Assertions.assertEquals(1434472255, model.retryWindowInMinutes()); - Assertions.assertEquals(ResourceOperationType.CREATE, model.onFailureAction()); + Assertions.assertEquals(222313615, model.retryCount()); + Assertions.assertEquals(1846033, model.retryWindowInMinutes()); + Assertions.assertEquals(ResourceOperationType.DELETE, model.onFailureAction()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RetryPolicy model = new RetryPolicy().withRetryCount(1913076092) - .withRetryWindowInMinutes(1434472255) - .withOnFailureAction(ResourceOperationType.CREATE); + RetryPolicy model = new RetryPolicy().withRetryCount(222313615) + .withRetryWindowInMinutes(1846033) + .withOnFailureAction(ResourceOperationType.DELETE); model = BinaryData.fromObject(model).toObject(RetryPolicy.class); - Assertions.assertEquals(1913076092, model.retryCount()); - Assertions.assertEquals(1434472255, model.retryWindowInMinutes()); - Assertions.assertEquals(ResourceOperationType.CREATE, model.onFailureAction()); + Assertions.assertEquals(222313615, model.retryCount()); + Assertions.assertEquals(1846033, model.retryWindowInMinutes()); + Assertions.assertEquals(ResourceOperationType.DELETE, model.onFailureAction()); } } diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ScheduledEventsAdditionalPublishingTargetsTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ScheduledEventsAdditionalPublishingTargetsTests.java new file mode 100644 index 000000000000..ae1680f1a3cb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ScheduledEventsAdditionalPublishingTargetsTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.EventGridAndResourceGraph; +import com.azure.resourcemanager.compute.bulkactions.models.ScheduledEventsAdditionalPublishingTargets; +import org.junit.jupiter.api.Assertions; + +public final class ScheduledEventsAdditionalPublishingTargetsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ScheduledEventsAdditionalPublishingTargets model = BinaryData + .fromString( + "{\"eventGridAndResourceGraph\":{\"enable\":true,\"scheduledEventsApiVersion\":\"uyonobglaoc\"}}") + .toObject(ScheduledEventsAdditionalPublishingTargets.class); + Assertions.assertTrue(model.eventGridAndResourceGraph().enable()); + Assertions.assertEquals("uyonobglaoc", model.eventGridAndResourceGraph().scheduledEventsApiVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ScheduledEventsAdditionalPublishingTargets model + = new ScheduledEventsAdditionalPublishingTargets().withEventGridAndResourceGraph( + new EventGridAndResourceGraph().withEnable(true).withScheduledEventsApiVersion("uyonobglaoc")); + model = BinaryData.fromObject(model).toObject(ScheduledEventsAdditionalPublishingTargets.class); + Assertions.assertTrue(model.eventGridAndResourceGraph().enable()); + Assertions.assertEquals("uyonobglaoc", model.eventGridAndResourceGraph().scheduledEventsApiVersion()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ScheduledEventsPolicyTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ScheduledEventsPolicyTests.java new file mode 100644 index 000000000000..edf70fdd189a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ScheduledEventsPolicyTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.AllInstancesDown; +import com.azure.resourcemanager.compute.bulkactions.models.EventGridAndResourceGraph; +import com.azure.resourcemanager.compute.bulkactions.models.ScheduledEventsAdditionalPublishingTargets; +import com.azure.resourcemanager.compute.bulkactions.models.ScheduledEventsPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.UserInitiatedReboot; +import com.azure.resourcemanager.compute.bulkactions.models.UserInitiatedRedeploy; +import org.junit.jupiter.api.Assertions; + +public final class ScheduledEventsPolicyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ScheduledEventsPolicy model = BinaryData.fromString( + "{\"userInitiatedRedeploy\":{\"automaticallyApprove\":true},\"userInitiatedReboot\":{\"automaticallyApprove\":true},\"scheduledEventsAdditionalPublishingTargets\":{\"eventGridAndResourceGraph\":{\"enable\":true,\"scheduledEventsApiVersion\":\"ef\"}},\"allInstancesDown\":{\"automaticallyApprove\":false}}") + .toObject(ScheduledEventsPolicy.class); + Assertions.assertTrue(model.userInitiatedRedeploy().userInitiatedRedeployAutomaticallyApprove()); + Assertions.assertTrue(model.userInitiatedReboot().userInitiatedRebootAutomaticallyApprove()); + Assertions.assertTrue(model.scheduledEventsAdditionalPublishingTargets().eventGridAndResourceGraph().enable()); + Assertions.assertEquals("ef", + model.scheduledEventsAdditionalPublishingTargets().eventGridAndResourceGraph().scheduledEventsApiVersion()); + Assertions.assertFalse(model.allInstancesDown().allInstancesDownAutomaticallyApprove()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ScheduledEventsPolicy model = new ScheduledEventsPolicy() + .withUserInitiatedRedeploy(new UserInitiatedRedeploy().withUserInitiatedRedeployAutomaticallyApprove(true)) + .withUserInitiatedReboot(new UserInitiatedReboot().withUserInitiatedRebootAutomaticallyApprove(true)) + .withScheduledEventsAdditionalPublishingTargets( + new ScheduledEventsAdditionalPublishingTargets().withEventGridAndResourceGraph( + new EventGridAndResourceGraph().withEnable(true).withScheduledEventsApiVersion("ef"))) + .withAllInstancesDown(new AllInstancesDown().withAllInstancesDownAutomaticallyApprove(false)); + model = BinaryData.fromObject(model).toObject(ScheduledEventsPolicy.class); + Assertions.assertTrue(model.userInitiatedRedeploy().userInitiatedRedeployAutomaticallyApprove()); + Assertions.assertTrue(model.userInitiatedReboot().userInitiatedRebootAutomaticallyApprove()); + Assertions.assertTrue(model.scheduledEventsAdditionalPublishingTargets().eventGridAndResourceGraph().enable()); + Assertions.assertEquals("ef", + model.scheduledEventsAdditionalPublishingTargets().eventGridAndResourceGraph().scheduledEventsApiVersion()); + Assertions.assertFalse(model.allInstancesDown().allInstancesDownAutomaticallyApprove()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ScheduledEventsProfileTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ScheduledEventsProfileTests.java new file mode 100644 index 000000000000..031d135c6259 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ScheduledEventsProfileTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.OSImageNotificationProfile; +import com.azure.resourcemanager.compute.bulkactions.models.ScheduledEventsProfile; +import com.azure.resourcemanager.compute.bulkactions.models.TerminateNotificationProfile; +import org.junit.jupiter.api.Assertions; + +public final class ScheduledEventsProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ScheduledEventsProfile model = BinaryData.fromString( + "{\"terminateNotificationProfile\":{\"notBeforeTimeout\":\"altol\",\"enable\":true},\"osImageNotificationProfile\":{\"notBeforeTimeout\":\"obqwcsdbnwdcfh\",\"enable\":true}}") + .toObject(ScheduledEventsProfile.class); + Assertions.assertEquals("altol", model.terminateNotificationProfile().notBeforeTimeout()); + Assertions.assertTrue(model.terminateNotificationProfile().enable()); + Assertions.assertEquals("obqwcsdbnwdcfh", model.osImageNotificationProfile().notBeforeTimeout()); + Assertions.assertTrue(model.osImageNotificationProfile().enable()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ScheduledEventsProfile model = new ScheduledEventsProfile() + .withTerminateNotificationProfile( + new TerminateNotificationProfile().withNotBeforeTimeout("altol").withEnable(true)) + .withOsImageNotificationProfile( + new OSImageNotificationProfile().withNotBeforeTimeout("obqwcsdbnwdcfh").withEnable(true)); + model = BinaryData.fromObject(model).toObject(ScheduledEventsProfile.class); + Assertions.assertEquals("altol", model.terminateNotificationProfile().notBeforeTimeout()); + Assertions.assertTrue(model.terminateNotificationProfile().enable()); + Assertions.assertEquals("obqwcsdbnwdcfh", model.osImageNotificationProfile().notBeforeTimeout()); + Assertions.assertTrue(model.osImageNotificationProfile().enable()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/TerminateNotificationProfileTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/TerminateNotificationProfileTests.java new file mode 100644 index 000000000000..fdef0e5fd01f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/TerminateNotificationProfileTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.TerminateNotificationProfile; +import org.junit.jupiter.api.Assertions; + +public final class TerminateNotificationProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TerminateNotificationProfile model + = BinaryData.fromString("{\"notBeforeTimeout\":\"pfuvglsbjjca\",\"enable\":false}") + .toObject(TerminateNotificationProfile.class); + Assertions.assertEquals("pfuvglsbjjca", model.notBeforeTimeout()); + Assertions.assertFalse(model.enable()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TerminateNotificationProfile model + = new TerminateNotificationProfile().withNotBeforeTimeout("pfuvglsbjjca").withEnable(false); + model = BinaryData.fromObject(model).toObject(TerminateNotificationProfile.class); + Assertions.assertEquals("pfuvglsbjjca", model.notBeforeTimeout()); + Assertions.assertFalse(model.enable()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/UefiSettingsTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/UefiSettingsTests.java new file mode 100644 index 000000000000..bd4e881e121e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/UefiSettingsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.UefiSettings; +import org.junit.jupiter.api.Assertions; + +public final class UefiSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UefiSettings model + = BinaryData.fromString("{\"secureBootEnabled\":true,\"vTpmEnabled\":false}").toObject(UefiSettings.class); + Assertions.assertTrue(model.secureBootEnabled()); + Assertions.assertFalse(model.vTpmEnabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UefiSettings model = new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(false); + model = BinaryData.fromObject(model).toObject(UefiSettings.class); + Assertions.assertTrue(model.secureBootEnabled()); + Assertions.assertFalse(model.vTpmEnabled()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/UserAssignedIdentityTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/UserAssignedIdentityTests.java new file mode 100644 index 000000000000..e2a9c6d24935 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/UserAssignedIdentityTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.UserAssignedIdentity; + +public final class UserAssignedIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserAssignedIdentity model = BinaryData.fromString("{\"principalId\":\"ltiugcxnavv\",\"clientId\":\"qiby\"}") + .toObject(UserAssignedIdentity.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserAssignedIdentity model = new UserAssignedIdentity(); + model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/UserInitiatedRebootTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/UserInitiatedRebootTests.java new file mode 100644 index 000000000000..7eebd3bcc0d0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/UserInitiatedRebootTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.UserInitiatedReboot; +import org.junit.jupiter.api.Assertions; + +public final class UserInitiatedRebootTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserInitiatedReboot model + = BinaryData.fromString("{\"automaticallyApprove\":true}").toObject(UserInitiatedReboot.class); + Assertions.assertTrue(model.userInitiatedRebootAutomaticallyApprove()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserInitiatedReboot model = new UserInitiatedReboot().withUserInitiatedRebootAutomaticallyApprove(true); + model = BinaryData.fromObject(model).toObject(UserInitiatedReboot.class); + Assertions.assertTrue(model.userInitiatedRebootAutomaticallyApprove()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/UserInitiatedRedeployTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/UserInitiatedRedeployTests.java new file mode 100644 index 000000000000..2c414a37ec49 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/UserInitiatedRedeployTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.UserInitiatedRedeploy; +import org.junit.jupiter.api.Assertions; + +public final class UserInitiatedRedeployTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserInitiatedRedeploy model + = BinaryData.fromString("{\"automaticallyApprove\":true}").toObject(UserInitiatedRedeploy.class); + Assertions.assertTrue(model.userInitiatedRedeployAutomaticallyApprove()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserInitiatedRedeploy model = new UserInitiatedRedeploy().withUserInitiatedRedeployAutomaticallyApprove(true); + model = BinaryData.fromObject(model).toObject(UserInitiatedRedeploy.class); + Assertions.assertTrue(model.userInitiatedRedeployAutomaticallyApprove()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VMAttributeMinMaxDoubleTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VMAttributeMinMaxDoubleTests.java new file mode 100644 index 000000000000..824114873856 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VMAttributeMinMaxDoubleTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.VMAttributeMinMaxDouble; +import org.junit.jupiter.api.Assertions; + +public final class VMAttributeMinMaxDoubleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VMAttributeMinMaxDouble model = BinaryData.fromString("{\"min\":43.032452835512146,\"max\":17.869411204038087}") + .toObject(VMAttributeMinMaxDouble.class); + Assertions.assertEquals(43.032452835512146D, model.min()); + Assertions.assertEquals(17.869411204038087D, model.max()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VMAttributeMinMaxDouble model + = new VMAttributeMinMaxDouble().withMin(43.032452835512146D).withMax(17.869411204038087D); + model = BinaryData.fromObject(model).toObject(VMAttributeMinMaxDouble.class); + Assertions.assertEquals(43.032452835512146D, model.min()); + Assertions.assertEquals(17.869411204038087D, model.max()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VMAttributeMinMaxIntegerTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VMAttributeMinMaxIntegerTests.java new file mode 100644 index 000000000000..50684201a1a9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VMAttributeMinMaxIntegerTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.VMAttributeMinMaxInteger; +import org.junit.jupiter.api.Assertions; + +public final class VMAttributeMinMaxIntegerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VMAttributeMinMaxInteger model + = BinaryData.fromString("{\"min\":687811406,\"max\":650781860}").toObject(VMAttributeMinMaxInteger.class); + Assertions.assertEquals(687811406, model.min()); + Assertions.assertEquals(650781860, model.max()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VMAttributeMinMaxInteger model = new VMAttributeMinMaxInteger().withMin(687811406).withMax(650781860); + model = BinaryData.fromObject(model).toObject(VMAttributeMinMaxInteger.class); + Assertions.assertEquals(687811406, model.min()); + Assertions.assertEquals(650781860, model.max()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VMAttributesTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VMAttributesTests.java new file mode 100644 index 000000000000..0d0b6612f976 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VMAttributesTests.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.AcceleratorManufacturer; +import com.azure.resourcemanager.compute.bulkactions.models.AcceleratorType; +import com.azure.resourcemanager.compute.bulkactions.models.ArchitectureType; +import com.azure.resourcemanager.compute.bulkactions.models.CpuManufacturer; +import com.azure.resourcemanager.compute.bulkactions.models.HyperVGeneration; +import com.azure.resourcemanager.compute.bulkactions.models.LocalStorageDiskType; +import com.azure.resourcemanager.compute.bulkactions.models.VMAttributeMinMaxDouble; +import com.azure.resourcemanager.compute.bulkactions.models.VMAttributeMinMaxInteger; +import com.azure.resourcemanager.compute.bulkactions.models.VMAttributeSupport; +import com.azure.resourcemanager.compute.bulkactions.models.VMAttributes; +import com.azure.resourcemanager.compute.bulkactions.models.VMCategory; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class VMAttributesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VMAttributes model = BinaryData.fromString( + "{\"vCpuCount\":{\"min\":917020287,\"max\":318845420},\"memoryInGiB\":{\"min\":38.210549104842904,\"max\":76.772205985773},\"architectureTypes\":[\"ARM64\"],\"memoryInGiBPerVCpu\":{\"min\":23.569121947887684,\"max\":60.242871455795566},\"localStorageSupport\":\"Required\",\"localStorageInGiB\":{\"min\":71.06123911787623,\"max\":4.33005629706712},\"localStorageDiskTypes\":[\"SSD\",\"SSD\",\"HDD\",\"HDD\"],\"dataDiskCount\":{\"min\":1182551695,\"max\":1572483367},\"networkInterfaceCount\":{\"min\":801364840,\"max\":296949281},\"networkBandwidthInMbps\":{\"min\":47.56353030523734,\"max\":12.420617055588522},\"rdmaSupport\":\"Required\",\"rdmaNetworkInterfaceCount\":{\"min\":1396816712,\"max\":1529613290},\"acceleratorSupport\":\"Excluded\",\"acceleratorManufacturers\":[\"Xilinx\",\"AMD\",\"Nvidia\"],\"acceleratorTypes\":[\"FPGA\",\"FPGA\",\"GPU\"],\"acceleratorCount\":{\"min\":795615702,\"max\":1043765409},\"vmCategories\":[\"GpuAccelerated\",\"MemoryOptimized\"],\"cpuManufacturers\":[\"Ampere\"],\"hyperVGenerations\":[\"Gen1\",\"Gen2\",\"Gen1\"],\"burstableSupport\":\"Required\",\"allowedVMSizes\":[\"muzyoxaepdk\",\"jancu\"],\"excludedVMSizes\":[\"d\",\"bavxbniwdjswzt\",\"dbpgnxytxhp\",\"xbzpfzab\"]}") + .toObject(VMAttributes.class); + Assertions.assertEquals(917020287, model.vCpuCount().min()); + Assertions.assertEquals(318845420, model.vCpuCount().max()); + Assertions.assertEquals(38.210549104842904D, model.memoryInGiB().min()); + Assertions.assertEquals(76.772205985773D, model.memoryInGiB().max()); + Assertions.assertEquals(ArchitectureType.ARM64, model.architectureTypes().get(0)); + Assertions.assertEquals(23.569121947887684D, model.memoryInGiBPerVCpu().min()); + Assertions.assertEquals(60.242871455795566D, model.memoryInGiBPerVCpu().max()); + Assertions.assertEquals(VMAttributeSupport.REQUIRED, model.localStorageSupport()); + Assertions.assertEquals(71.06123911787623D, model.localStorageInGiB().min()); + Assertions.assertEquals(4.33005629706712D, model.localStorageInGiB().max()); + Assertions.assertEquals(LocalStorageDiskType.SSD, model.localStorageDiskTypes().get(0)); + Assertions.assertEquals(1182551695, model.dataDiskCount().min()); + Assertions.assertEquals(1572483367, model.dataDiskCount().max()); + Assertions.assertEquals(801364840, model.networkInterfaceCount().min()); + Assertions.assertEquals(296949281, model.networkInterfaceCount().max()); + Assertions.assertEquals(47.56353030523734D, model.networkBandwidthInMbps().min()); + Assertions.assertEquals(12.420617055588522D, model.networkBandwidthInMbps().max()); + Assertions.assertEquals(VMAttributeSupport.REQUIRED, model.rdmaSupport()); + Assertions.assertEquals(1396816712, model.rdmaNetworkInterfaceCount().min()); + Assertions.assertEquals(1529613290, model.rdmaNetworkInterfaceCount().max()); + Assertions.assertEquals(VMAttributeSupport.EXCLUDED, model.acceleratorSupport()); + Assertions.assertEquals(AcceleratorManufacturer.XILINX, model.acceleratorManufacturers().get(0)); + Assertions.assertEquals(AcceleratorType.FPGA, model.acceleratorTypes().get(0)); + Assertions.assertEquals(795615702, model.acceleratorCount().min()); + Assertions.assertEquals(1043765409, model.acceleratorCount().max()); + Assertions.assertEquals(VMCategory.GPU_ACCELERATED, model.vmCategories().get(0)); + Assertions.assertEquals(CpuManufacturer.AMPERE, model.cpuManufacturers().get(0)); + Assertions.assertEquals(HyperVGeneration.GEN1, model.hyperVGenerations().get(0)); + Assertions.assertEquals(VMAttributeSupport.REQUIRED, model.burstableSupport()); + Assertions.assertEquals("muzyoxaepdk", model.allowedVMSizes().get(0)); + Assertions.assertEquals("d", model.excludedVMSizes().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VMAttributes model = new VMAttributes() + .withVCpuCount(new VMAttributeMinMaxInteger().withMin(917020287).withMax(318845420)) + .withMemoryInGiB(new VMAttributeMinMaxDouble().withMin(38.210549104842904D).withMax(76.772205985773D)) + .withArchitectureTypes(Arrays.asList(ArchitectureType.ARM64)) + .withMemoryInGiBPerVCpu( + new VMAttributeMinMaxDouble().withMin(23.569121947887684D).withMax(60.242871455795566D)) + .withLocalStorageSupport(VMAttributeSupport.REQUIRED) + .withLocalStorageInGiB(new VMAttributeMinMaxDouble().withMin(71.06123911787623D).withMax(4.33005629706712D)) + .withLocalStorageDiskTypes(Arrays.asList(LocalStorageDiskType.SSD, LocalStorageDiskType.SSD, + LocalStorageDiskType.HDD, LocalStorageDiskType.HDD)) + .withDataDiskCount(new VMAttributeMinMaxInteger().withMin(1182551695).withMax(1572483367)) + .withNetworkInterfaceCount(new VMAttributeMinMaxInteger().withMin(801364840).withMax(296949281)) + .withNetworkBandwidthInMbps( + new VMAttributeMinMaxDouble().withMin(47.56353030523734D).withMax(12.420617055588522D)) + .withRdmaSupport(VMAttributeSupport.REQUIRED) + .withRdmaNetworkInterfaceCount(new VMAttributeMinMaxInteger().withMin(1396816712).withMax(1529613290)) + .withAcceleratorSupport(VMAttributeSupport.EXCLUDED) + .withAcceleratorManufacturers(Arrays.asList(AcceleratorManufacturer.XILINX, AcceleratorManufacturer.AMD, + AcceleratorManufacturer.NVIDIA)) + .withAcceleratorTypes(Arrays.asList(AcceleratorType.FPGA, AcceleratorType.FPGA, AcceleratorType.GPU)) + .withAcceleratorCount(new VMAttributeMinMaxInteger().withMin(795615702).withMax(1043765409)) + .withVmCategories(Arrays.asList(VMCategory.GPU_ACCELERATED, VMCategory.MEMORY_OPTIMIZED)) + .withCpuManufacturers(Arrays.asList(CpuManufacturer.AMPERE)) + .withHyperVGenerations(Arrays.asList(HyperVGeneration.GEN1, HyperVGeneration.GEN2, HyperVGeneration.GEN1)) + .withBurstableSupport(VMAttributeSupport.REQUIRED) + .withAllowedVMSizes(Arrays.asList("muzyoxaepdk", "jancu")) + .withExcludedVMSizes(Arrays.asList("d", "bavxbniwdjswzt", "dbpgnxytxhp", "xbzpfzab")); + model = BinaryData.fromObject(model).toObject(VMAttributes.class); + Assertions.assertEquals(917020287, model.vCpuCount().min()); + Assertions.assertEquals(318845420, model.vCpuCount().max()); + Assertions.assertEquals(38.210549104842904D, model.memoryInGiB().min()); + Assertions.assertEquals(76.772205985773D, model.memoryInGiB().max()); + Assertions.assertEquals(ArchitectureType.ARM64, model.architectureTypes().get(0)); + Assertions.assertEquals(23.569121947887684D, model.memoryInGiBPerVCpu().min()); + Assertions.assertEquals(60.242871455795566D, model.memoryInGiBPerVCpu().max()); + Assertions.assertEquals(VMAttributeSupport.REQUIRED, model.localStorageSupport()); + Assertions.assertEquals(71.06123911787623D, model.localStorageInGiB().min()); + Assertions.assertEquals(4.33005629706712D, model.localStorageInGiB().max()); + Assertions.assertEquals(LocalStorageDiskType.SSD, model.localStorageDiskTypes().get(0)); + Assertions.assertEquals(1182551695, model.dataDiskCount().min()); + Assertions.assertEquals(1572483367, model.dataDiskCount().max()); + Assertions.assertEquals(801364840, model.networkInterfaceCount().min()); + Assertions.assertEquals(296949281, model.networkInterfaceCount().max()); + Assertions.assertEquals(47.56353030523734D, model.networkBandwidthInMbps().min()); + Assertions.assertEquals(12.420617055588522D, model.networkBandwidthInMbps().max()); + Assertions.assertEquals(VMAttributeSupport.REQUIRED, model.rdmaSupport()); + Assertions.assertEquals(1396816712, model.rdmaNetworkInterfaceCount().min()); + Assertions.assertEquals(1529613290, model.rdmaNetworkInterfaceCount().max()); + Assertions.assertEquals(VMAttributeSupport.EXCLUDED, model.acceleratorSupport()); + Assertions.assertEquals(AcceleratorManufacturer.XILINX, model.acceleratorManufacturers().get(0)); + Assertions.assertEquals(AcceleratorType.FPGA, model.acceleratorTypes().get(0)); + Assertions.assertEquals(795615702, model.acceleratorCount().min()); + Assertions.assertEquals(1043765409, model.acceleratorCount().max()); + Assertions.assertEquals(VMCategory.GPU_ACCELERATED, model.vmCategories().get(0)); + Assertions.assertEquals(CpuManufacturer.AMPERE, model.cpuManufacturers().get(0)); + Assertions.assertEquals(HyperVGeneration.GEN1, model.hyperVGenerations().get(0)); + Assertions.assertEquals(VMAttributeSupport.REQUIRED, model.burstableSupport()); + Assertions.assertEquals("muzyoxaepdk", model.allowedVMSizes().get(0)); + Assertions.assertEquals("d", model.excludedVMSizes().get(0)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VMDiskSecurityProfileTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VMDiskSecurityProfileTests.java new file mode 100644 index 000000000000..ffa849060804 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VMDiskSecurityProfileTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.DiskEncryptionSetParametersContent; +import com.azure.resourcemanager.compute.bulkactions.models.SecurityEncryptionTypes; +import com.azure.resourcemanager.compute.bulkactions.models.VMDiskSecurityProfile; +import org.junit.jupiter.api.Assertions; + +public final class VMDiskSecurityProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VMDiskSecurityProfile model = BinaryData + .fromString("{\"securityEncryptionType\":\"VMGuestStateOnly\",\"diskEncryptionSet\":{\"id\":\"bkpyc\"}}") + .toObject(VMDiskSecurityProfile.class); + Assertions.assertEquals(SecurityEncryptionTypes.VMGUEST_STATE_ONLY, model.securityEncryptionType()); + Assertions.assertEquals("bkpyc", model.diskEncryptionSet().id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VMDiskSecurityProfile model + = new VMDiskSecurityProfile().withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet(new DiskEncryptionSetParametersContent().withId("bkpyc")); + model = BinaryData.fromObject(model).toObject(VMDiskSecurityProfile.class); + Assertions.assertEquals(SecurityEncryptionTypes.VMGUEST_STATE_ONLY, model.securityEncryptionType()); + Assertions.assertEquals("bkpyc", model.diskEncryptionSet().id()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VMGalleryApplicationTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VMGalleryApplicationTests.java new file mode 100644 index 000000000000..54b12f83d03f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VMGalleryApplicationTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.VMGalleryApplication; +import org.junit.jupiter.api.Assertions; + +public final class VMGalleryApplicationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VMGalleryApplication model = BinaryData.fromString( + "{\"tags\":\"jed\",\"order\":659482239,\"packageReferenceId\":\"waezkojvd\",\"configurationReference\":\"zfoqouicybxar\",\"treatFailureAsDeploymentFailure\":true,\"enableAutomaticUpgrade\":false}") + .toObject(VMGalleryApplication.class); + Assertions.assertEquals("jed", model.tags()); + Assertions.assertEquals(659482239, model.order()); + Assertions.assertEquals("waezkojvd", model.packageReferenceId()); + Assertions.assertEquals("zfoqouicybxar", model.configurationReference()); + Assertions.assertTrue(model.treatFailureAsDeploymentFailure()); + Assertions.assertFalse(model.enableAutomaticUpgrade()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VMGalleryApplication model = new VMGalleryApplication().withTags("jed") + .withOrder(659482239) + .withPackageReferenceId("waezkojvd") + .withConfigurationReference("zfoqouicybxar") + .withTreatFailureAsDeploymentFailure(true) + .withEnableAutomaticUpgrade(false); + model = BinaryData.fromObject(model).toObject(VMGalleryApplication.class); + Assertions.assertEquals("jed", model.tags()); + Assertions.assertEquals(659482239, model.order()); + Assertions.assertEquals("waezkojvd", model.packageReferenceId()); + Assertions.assertEquals("zfoqouicybxar", model.configurationReference()); + Assertions.assertTrue(model.treatFailureAsDeploymentFailure()); + Assertions.assertFalse(model.enableAutomaticUpgrade()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VaultCertificateTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VaultCertificateTests.java new file mode 100644 index 000000000000..d9a854207cee --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VaultCertificateTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.VaultCertificate; +import org.junit.jupiter.api.Assertions; + +public final class VaultCertificateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VaultCertificate model + = BinaryData.fromString("{\"certificateUrl\":\"rmgucnap\",\"certificateStore\":\"eoellwptfdygp\"}") + .toObject(VaultCertificate.class); + Assertions.assertEquals("rmgucnap", model.certificateUrl()); + Assertions.assertEquals("eoellwptfdygp", model.certificateStore()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VaultCertificate model + = new VaultCertificate().withCertificateUrl("rmgucnap").withCertificateStore("eoellwptfdygp"); + model = BinaryData.fromObject(model).toObject(VaultCertificate.class); + Assertions.assertEquals("rmgucnap", model.certificateUrl()); + Assertions.assertEquals("eoellwptfdygp", model.certificateStore()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VaultSecretGroupTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VaultSecretGroupTests.java new file mode 100644 index 000000000000..3e1ce6aeb68f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VaultSecretGroupTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.VaultCertificate; +import com.azure.resourcemanager.compute.bulkactions.models.VaultSecretGroup; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class VaultSecretGroupTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VaultSecretGroup model = BinaryData.fromString( + "{\"sourceVault\":{\"id\":\"ulppggdtpnapnyir\"},\"vaultCertificates\":[{\"certificateUrl\":\"pigvpgylgqgitx\",\"certificateStore\":\"djvcsl\"},{\"certificateUrl\":\"qwwncw\",\"certificateStore\":\"hxg\"}]}") + .toObject(VaultSecretGroup.class); + Assertions.assertEquals("ulppggdtpnapnyir", model.sourceVault().id()); + Assertions.assertEquals("pigvpgylgqgitx", model.vaultCertificates().get(0).certificateUrl()); + Assertions.assertEquals("djvcsl", model.vaultCertificates().get(0).certificateStore()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VaultSecretGroup model = new VaultSecretGroup().withSourceVault(new SubResource().withId("ulppggdtpnapnyir")) + .withVaultCertificates(Arrays.asList( + new VaultCertificate().withCertificateUrl("pigvpgylgqgitx").withCertificateStore("djvcsl"), + new VaultCertificate().withCertificateUrl("qwwncw").withCertificateStore("hxg"))); + model = BinaryData.fromObject(model).toObject(VaultSecretGroup.class); + Assertions.assertEquals("ulppggdtpnapnyir", model.sourceVault().id()); + Assertions.assertEquals("pigvpgylgqgitx", model.vaultCertificates().get(0).certificateUrl()); + Assertions.assertEquals("djvcsl", model.vaultCertificates().get(0).certificateStore()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualHardDiskTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualHardDiskTests.java new file mode 100644 index 000000000000..1ce14eba2d70 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualHardDiskTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualHardDisk; +import org.junit.jupiter.api.Assertions; + +public final class VirtualHardDiskTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VirtualHardDisk model = BinaryData.fromString("{\"uri\":\"ooxdjebwpuc\"}").toObject(VirtualHardDisk.class); + Assertions.assertEquals("ooxdjebwpuc", model.uri()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualHardDisk model = new VirtualHardDisk().withUri("ooxdjebwpuc"); + model = BinaryData.fromObject(model).toObject(VirtualHardDisk.class); + Assertions.assertEquals("ooxdjebwpuc", model.uri()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkAcknowledgeOperationErrorsWithResponseMockTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkAcknowledgeOperationErrorsWithResponseMockTests.java new file mode 100644 index 000000000000..ad153a23ddbe --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineBulkOperationsBulkAcknowledgeOperationErrorsWithResponseMockTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.compute.bulkactions.ComputeBulkActionsManager; +import com.azure.resourcemanager.compute.bulkactions.models.AcknowledgeBulkOperationErrorsRequest; +import com.azure.resourcemanager.compute.bulkactions.models.AcknowledgeBulkOperationErrorsResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class VirtualMachineBulkOperationsBulkAcknowledgeOperationErrorsWithResponseMockTests { + @Test + public void testBulkAcknowledgeOperationErrorsWithResponse() throws Exception { + String responseStr + = "{\"acknowledged\":[\"sjkmnwqj\"],\"notFound\":[\"baiyhddviaceg\",\"n\",\"ntfpmvmemfnc\",\"dwvvba\"],\"skipped\":[\"lllchpodb\",\"evwrdnhfuk\"]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ComputeBulkActionsManager manager = ComputeBulkActionsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + AcknowledgeBulkOperationErrorsResponse response = manager.virtualMachineBulkOperations() + .bulkAcknowledgeOperationErrorsWithResponse("payakkud", "px", + new AcknowledgeBulkOperationErrorsRequest() + .withOperationIds(Arrays.asList("jplmagstcy", "hpfkyrkdbdgi")), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("sjkmnwqj", response.acknowledged().get(0)); + Assertions.assertEquals("baiyhddviaceg", response.notFound().get(0)); + Assertions.assertEquals("lllchpodb", response.skipped().get(0)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineInfoTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineInfoTests.java new file mode 100644 index 000000000000..c4d59d8f29e1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineInfoTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineInfo; +import org.junit.jupiter.api.Assertions; + +public final class VirtualMachineInfoTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VirtualMachineInfo model + = BinaryData.fromString("{\"vmSize\":\"trg\",\"zone\":\"bpf\"}").toObject(VirtualMachineInfo.class); + Assertions.assertEquals("trg", model.vmSize()); + Assertions.assertEquals("bpf", model.zone()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineIpTagTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineIpTagTests.java new file mode 100644 index 000000000000..70454432bad9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineIpTagTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineIpTag; +import org.junit.jupiter.api.Assertions; + +public final class VirtualMachineIpTagTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VirtualMachineIpTag model + = BinaryData.fromString("{\"ipTagType\":\"dszue\",\"tag\":\"sbzkf\"}").toObject(VirtualMachineIpTag.class); + Assertions.assertEquals("dszue", model.ipTagType()); + Assertions.assertEquals("sbzkf", model.tag()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualMachineIpTag model = new VirtualMachineIpTag().withIpTagType("dszue").withTag("sbzkf"); + model = BinaryData.fromObject(model).toObject(VirtualMachineIpTag.class); + Assertions.assertEquals("dszue", model.ipTagType()); + Assertions.assertEquals("sbzkf", model.tag()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineNetworkInterfaceConfigurationPropertiesTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineNetworkInterfaceConfigurationPropertiesTests.java new file mode 100644 index 000000000000..e003701acf6e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineNetworkInterfaceConfigurationPropertiesTests.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.DeleteOptions; +import com.azure.resourcemanager.compute.bulkactions.models.IPVersions; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceAuxiliarySku; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSku; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSkuName; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSkuTier; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAllocationMethod; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineIpTag; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceConfigurationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceDnsSettingsConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceIPConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceIPConfigurationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressConfigurationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressDnsSettingsConfiguration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class VirtualMachineNetworkInterfaceConfigurationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VirtualMachineNetworkInterfaceConfigurationProperties model = BinaryData.fromString( + "{\"primary\":true,\"deleteOption\":\"Detach\",\"enableAcceleratedNetworking\":true,\"disableTcpStateTracking\":false,\"enableFpga\":true,\"enableIPForwarding\":false,\"networkSecurityGroup\":{\"id\":\"dyhtozfikdowwquu\"},\"dnsSettings\":{\"dnsServers\":[\"clvit\",\"hqzonosggbhcoh\"]},\"ipConfigurations\":[{\"name\":\"dsjnka\",\"properties\":{\"subnet\":{\"id\":\"iiswacffgdkzze\"},\"primary\":false,\"publicIPAddressConfiguration\":{\"name\":\"hqcrailvpnpp\",\"properties\":{\"idleTimeoutInMinutes\":749760843,\"deleteOption\":\"Detach\",\"dnsSettings\":{\"domainNameLabel\":\"mh\"},\"ipTags\":[{},{},{},{}],\"publicIPPrefix\":{},\"publicIPAddressVersion\":\"IPv6\",\"publicIPAllocationMethod\":\"Dynamic\"},\"sku\":{\"name\":\"Basic\",\"tier\":\"Global\"},\"tags\":{\"apnedgfbcvkc\":\"hgw\",\"pkeqdcvdrhvoo\":\"q\",\"dopcjwvnh\":\"sotbob\",\"mgxcxrslpm\":\"ld\"}},\"privateIPAddressVersion\":\"IPv4\",\"applicationSecurityGroups\":[{\"id\":\"grpkhjwniyqs\"},{\"id\":\"i\"},{\"id\":\"dggkzzlvmbmpa\"}],\"applicationGatewayBackendAddressPools\":[{\"id\":\"fv\"},{\"id\":\"fy\"},{\"id\":\"bpfvm\"}],\"loadBalancerBackendAddressPools\":[{\"id\":\"fouyf\"},{\"id\":\"akcp\"}]}},{\"name\":\"iyzvqtmnub\",\"properties\":{\"subnet\":{\"id\":\"zksmondj\"},\"primary\":true,\"publicIPAddressConfiguration\":{\"name\":\"vypomgkopkwho\",\"properties\":{\"idleTimeoutInMinutes\":1397433575,\"deleteOption\":\"Delete\",\"dnsSettings\":{\"domainNameLabel\":\"xysmoc\"},\"ipTags\":[{},{}],\"publicIPPrefix\":{},\"publicIPAddressVersion\":\"IPv4\",\"publicIPAllocationMethod\":\"Static\"},\"sku\":{\"name\":\"Basic\",\"tier\":\"Global\"},\"tags\":{\"dd\":\"helxprglya\",\"rjxgciqib\":\"kcbcue\",\"sdqrhzoymibmrq\":\"hos\",\"dtmhrkwofyyvoqa\":\"ibahwflus\"}},\"privateIPAddressVersion\":\"IPv6\",\"applicationSecurityGroups\":[{\"id\":\"btgiwbwoenwas\"},{\"id\":\"tdtkcn\"},{\"id\":\"wbpokulpiujwaasi\"}],\"applicationGatewayBackendAddressPools\":[{\"id\":\"obyu\"}],\"loadBalancerBackendAddressPools\":[{\"id\":\"qlpqwcciuq\"},{\"id\":\"dbutauvfbtkuwhh\"}]}},{\"name\":\"hykojoxafnndlpic\",\"properties\":{\"subnet\":{\"id\":\"mkcdyhbpkkpwdre\"},\"primary\":true,\"publicIPAddressConfiguration\":{\"name\":\"vq\",\"properties\":{\"idleTimeoutInMinutes\":1842469815,\"deleteOption\":\"Delete\",\"dnsSettings\":{\"domainNameLabel\":\"wsuwsyr\"},\"ipTags\":[{},{},{}],\"publicIPPrefix\":{},\"publicIPAddressVersion\":\"IPv6\",\"publicIPAllocationMethod\":\"Static\"},\"sku\":{\"name\":\"Standard\",\"tier\":\"Global\"},\"tags\":{\"qnzarrwl\":\"en\",\"jfqka\":\"uu\",\"iipfpubj\":\"e\"}},\"privateIPAddressVersion\":\"IPv6\",\"applicationSecurityGroups\":[{\"id\":\"tohqkvpuvksgp\"},{\"id\":\"aknynfsynljphuop\"},{\"id\":\"dlqiyntorzih\"}],\"applicationGatewayBackendAddressPools\":[{\"id\":\"jswsrmslyz\"},{\"id\":\"zbchckqqzqioxiy\"}],\"loadBalancerBackendAddressPools\":[{\"id\":\"zynkedya\"},{\"id\":\"wyhqmibzyhwits\"},{\"id\":\"pyy\"},{\"id\":\"cdpu\"}]}}],\"dscpConfiguration\":{\"id\":\"g\"},\"auxiliaryMode\":\"None\",\"auxiliarySku\":\"None\"}") + .toObject(VirtualMachineNetworkInterfaceConfigurationProperties.class); + Assertions.assertTrue(model.primary()); + Assertions.assertEquals(DeleteOptions.DETACH, model.deleteOption()); + Assertions.assertTrue(model.enableAcceleratedNetworking()); + Assertions.assertFalse(model.disableTcpStateTracking()); + Assertions.assertTrue(model.enableFpga()); + Assertions.assertFalse(model.enableIPForwarding()); + Assertions.assertEquals("dyhtozfikdowwquu", model.networkSecurityGroup().id()); + Assertions.assertEquals("clvit", model.dnsSettings().dnsServers().get(0)); + Assertions.assertEquals("dsjnka", model.ipConfigurations().get(0).name()); + Assertions.assertEquals("iiswacffgdkzze", model.ipConfigurations().get(0).properties().subnet().id()); + Assertions.assertFalse(model.ipConfigurations().get(0).properties().primary()); + Assertions.assertEquals("hqcrailvpnpp", + model.ipConfigurations().get(0).properties().publicIPAddressConfiguration().name()); + Assertions.assertEquals(749760843, + model.ipConfigurations() + .get(0) + .properties() + .publicIPAddressConfiguration() + .properties() + .idleTimeoutInMinutes()); + Assertions.assertEquals(DeleteOptions.DETACH, + model.ipConfigurations().get(0).properties().publicIPAddressConfiguration().properties().deleteOption()); + Assertions.assertEquals("mh", + model.ipConfigurations() + .get(0) + .properties() + .publicIPAddressConfiguration() + .properties() + .dnsSettings() + .domainNameLabel()); + Assertions.assertEquals(IPVersions.IPV6, + model.ipConfigurations() + .get(0) + .properties() + .publicIPAddressConfiguration() + .properties() + .publicIPAddressVersion()); + Assertions.assertEquals(PublicIPAllocationMethod.DYNAMIC, + model.ipConfigurations() + .get(0) + .properties() + .publicIPAddressConfiguration() + .properties() + .publicIPAllocationMethod()); + Assertions.assertEquals(PublicIPAddressSkuName.BASIC, + model.ipConfigurations().get(0).properties().publicIPAddressConfiguration().sku().name()); + Assertions.assertEquals(PublicIPAddressSkuTier.GLOBAL, + model.ipConfigurations().get(0).properties().publicIPAddressConfiguration().sku().tier()); + Assertions.assertEquals("hgw", + model.ipConfigurations().get(0).properties().publicIPAddressConfiguration().tags().get("apnedgfbcvkc")); + Assertions.assertEquals(IPVersions.IPV4, + model.ipConfigurations().get(0).properties().privateIPAddressVersion()); + Assertions.assertEquals("grpkhjwniyqs", + model.ipConfigurations().get(0).properties().applicationSecurityGroups().get(0).id()); + Assertions.assertEquals("fv", + model.ipConfigurations().get(0).properties().applicationGatewayBackendAddressPools().get(0).id()); + Assertions.assertEquals("fouyf", + model.ipConfigurations().get(0).properties().loadBalancerBackendAddressPools().get(0).id()); + Assertions.assertEquals("g", model.dscpConfiguration().id()); + Assertions.assertEquals(NetworkInterfaceAuxiliaryMode.NONE, model.auxiliaryMode()); + Assertions.assertEquals(NetworkInterfaceAuxiliarySku.NONE, model.auxiliarySku()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualMachineNetworkInterfaceConfigurationProperties model + = new VirtualMachineNetworkInterfaceConfigurationProperties().withPrimary(true) + .withDeleteOption(DeleteOptions.DETACH) + .withEnableAcceleratedNetworking(true) + .withDisableTcpStateTracking(false) + .withEnableFpga(true) + .withEnableIPForwarding(false) + .withNetworkSecurityGroup(new SubResource().withId("dyhtozfikdowwquu")) + .withDnsSettings(new VirtualMachineNetworkInterfaceDnsSettingsConfiguration() + .withDnsServers(Arrays.asList("clvit", "hqzonosggbhcoh"))) + .withIpConfigurations( + Arrays.asList( + new VirtualMachineNetworkInterfaceIPConfiguration().withName("dsjnka") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties() + .withSubnet(new SubResource().withId("iiswacffgdkzze")) + .withPrimary(false) + .withPublicIPAddressConfiguration(new VirtualMachinePublicIPAddressConfiguration() + .withName("hqcrailvpnpp") + .withProperties(new VirtualMachinePublicIPAddressConfigurationProperties() + .withIdleTimeoutInMinutes(749760843) + .withDeleteOption(DeleteOptions.DETACH) + .withDnsSettings(new VirtualMachinePublicIPAddressDnsSettingsConfiguration() + .withDomainNameLabel("mh")) + .withIpTags(Arrays.asList(new VirtualMachineIpTag(), new VirtualMachineIpTag(), + new VirtualMachineIpTag(), new VirtualMachineIpTag())) + .withPublicIPPrefix(new SubResource()) + .withPublicIPAddressVersion(IPVersions.IPV6) + .withPublicIPAllocationMethod(PublicIPAllocationMethod.DYNAMIC)) + .withSku(new PublicIPAddressSku().withName(PublicIPAddressSkuName.BASIC) + .withTier(PublicIPAddressSkuTier.GLOBAL)) + .withTags(mapOf("apnedgfbcvkc", "hgw", "pkeqdcvdrhvoo", "q", "dopcjwvnh", "sotbob", + "mgxcxrslpm", "ld"))) + .withPrivateIPAddressVersion(IPVersions.IPV4) + .withApplicationSecurityGroups(Arrays.asList(new SubResource().withId("grpkhjwniyqs"), + new SubResource().withId("i"), new SubResource().withId("dggkzzlvmbmpa"))) + .withApplicationGatewayBackendAddressPools(Arrays.asList(new SubResource().withId("fv"), + new SubResource().withId("fy"), new SubResource().withId("bpfvm"))) + .withLoadBalancerBackendAddressPools(Arrays.asList(new SubResource().withId("fouyf"), + new SubResource().withId("akcp")))), + new VirtualMachineNetworkInterfaceIPConfiguration().withName("iyzvqtmnub") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties() + .withSubnet(new SubResource().withId("zksmondj")) + .withPrimary(true) + .withPublicIPAddressConfiguration(new VirtualMachinePublicIPAddressConfiguration() + .withName("vypomgkopkwho") + .withProperties(new VirtualMachinePublicIPAddressConfigurationProperties() + .withIdleTimeoutInMinutes(1397433575) + .withDeleteOption(DeleteOptions.DELETE) + .withDnsSettings(new VirtualMachinePublicIPAddressDnsSettingsConfiguration() + .withDomainNameLabel("xysmoc")) + .withIpTags(Arrays.asList(new VirtualMachineIpTag(), new VirtualMachineIpTag())) + .withPublicIPPrefix(new SubResource()) + .withPublicIPAddressVersion(IPVersions.IPV4) + .withPublicIPAllocationMethod(PublicIPAllocationMethod.STATIC)) + .withSku(new PublicIPAddressSku().withName(PublicIPAddressSkuName.BASIC) + .withTier(PublicIPAddressSkuTier.GLOBAL)) + .withTags(mapOf("dd", "helxprglya", "rjxgciqib", "kcbcue", "sdqrhzoymibmrq", "hos", + "dtmhrkwofyyvoqa", "ibahwflus"))) + .withPrivateIPAddressVersion(IPVersions.IPV6) + .withApplicationSecurityGroups(Arrays.asList(new SubResource().withId("btgiwbwoenwas"), + new SubResource().withId("tdtkcn"), new SubResource().withId("wbpokulpiujwaasi"))) + .withApplicationGatewayBackendAddressPools( + Arrays.asList(new SubResource().withId("obyu"))) + .withLoadBalancerBackendAddressPools( + Arrays.asList(new SubResource().withId("qlpqwcciuq"), + new SubResource().withId("dbutauvfbtkuwhh")))), + new VirtualMachineNetworkInterfaceIPConfiguration().withName("hykojoxafnndlpic") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties() + .withSubnet(new SubResource().withId("mkcdyhbpkkpwdre")) + .withPrimary(true) + .withPublicIPAddressConfiguration( + new VirtualMachinePublicIPAddressConfiguration().withName("vq") + .withProperties(new VirtualMachinePublicIPAddressConfigurationProperties() + .withIdleTimeoutInMinutes(1842469815) + .withDeleteOption(DeleteOptions.DELETE) + .withDnsSettings(new VirtualMachinePublicIPAddressDnsSettingsConfiguration() + .withDomainNameLabel("wsuwsyr")) + .withIpTags(Arrays.asList(new VirtualMachineIpTag(), + new VirtualMachineIpTag(), new VirtualMachineIpTag())) + .withPublicIPPrefix(new SubResource()) + .withPublicIPAddressVersion(IPVersions.IPV6) + .withPublicIPAllocationMethod(PublicIPAllocationMethod.STATIC)) + .withSku(new PublicIPAddressSku().withName(PublicIPAddressSkuName.STANDARD) + .withTier(PublicIPAddressSkuTier.GLOBAL)) + .withTags(mapOf("qnzarrwl", "en", "jfqka", "uu", "iipfpubj", "e"))) + .withPrivateIPAddressVersion(IPVersions.IPV6) + .withApplicationSecurityGroups(Arrays.asList(new SubResource().withId("tohqkvpuvksgp"), + new SubResource().withId("aknynfsynljphuop"), + new SubResource().withId("dlqiyntorzih"))) + .withApplicationGatewayBackendAddressPools( + Arrays.asList(new SubResource().withId("jswsrmslyz"), + new SubResource().withId("zbchckqqzqioxiy"))) + .withLoadBalancerBackendAddressPools(Arrays.asList(new SubResource().withId("zynkedya"), + new SubResource().withId("wyhqmibzyhwits"), new SubResource().withId("pyy"), + new SubResource().withId("cdpu")))))) + .withDscpConfiguration(new SubResource().withId("g")) + .withAuxiliaryMode(NetworkInterfaceAuxiliaryMode.NONE) + .withAuxiliarySku(NetworkInterfaceAuxiliarySku.NONE); + model = BinaryData.fromObject(model).toObject(VirtualMachineNetworkInterfaceConfigurationProperties.class); + Assertions.assertTrue(model.primary()); + Assertions.assertEquals(DeleteOptions.DETACH, model.deleteOption()); + Assertions.assertTrue(model.enableAcceleratedNetworking()); + Assertions.assertFalse(model.disableTcpStateTracking()); + Assertions.assertTrue(model.enableFpga()); + Assertions.assertFalse(model.enableIPForwarding()); + Assertions.assertEquals("dyhtozfikdowwquu", model.networkSecurityGroup().id()); + Assertions.assertEquals("clvit", model.dnsSettings().dnsServers().get(0)); + Assertions.assertEquals("dsjnka", model.ipConfigurations().get(0).name()); + Assertions.assertEquals("iiswacffgdkzze", model.ipConfigurations().get(0).properties().subnet().id()); + Assertions.assertFalse(model.ipConfigurations().get(0).properties().primary()); + Assertions.assertEquals("hqcrailvpnpp", + model.ipConfigurations().get(0).properties().publicIPAddressConfiguration().name()); + Assertions.assertEquals(749760843, + model.ipConfigurations() + .get(0) + .properties() + .publicIPAddressConfiguration() + .properties() + .idleTimeoutInMinutes()); + Assertions.assertEquals(DeleteOptions.DETACH, + model.ipConfigurations().get(0).properties().publicIPAddressConfiguration().properties().deleteOption()); + Assertions.assertEquals("mh", + model.ipConfigurations() + .get(0) + .properties() + .publicIPAddressConfiguration() + .properties() + .dnsSettings() + .domainNameLabel()); + Assertions.assertEquals(IPVersions.IPV6, + model.ipConfigurations() + .get(0) + .properties() + .publicIPAddressConfiguration() + .properties() + .publicIPAddressVersion()); + Assertions.assertEquals(PublicIPAllocationMethod.DYNAMIC, + model.ipConfigurations() + .get(0) + .properties() + .publicIPAddressConfiguration() + .properties() + .publicIPAllocationMethod()); + Assertions.assertEquals(PublicIPAddressSkuName.BASIC, + model.ipConfigurations().get(0).properties().publicIPAddressConfiguration().sku().name()); + Assertions.assertEquals(PublicIPAddressSkuTier.GLOBAL, + model.ipConfigurations().get(0).properties().publicIPAddressConfiguration().sku().tier()); + Assertions.assertEquals("hgw", + model.ipConfigurations().get(0).properties().publicIPAddressConfiguration().tags().get("apnedgfbcvkc")); + Assertions.assertEquals(IPVersions.IPV4, + model.ipConfigurations().get(0).properties().privateIPAddressVersion()); + Assertions.assertEquals("grpkhjwniyqs", + model.ipConfigurations().get(0).properties().applicationSecurityGroups().get(0).id()); + Assertions.assertEquals("fv", + model.ipConfigurations().get(0).properties().applicationGatewayBackendAddressPools().get(0).id()); + Assertions.assertEquals("fouyf", + model.ipConfigurations().get(0).properties().loadBalancerBackendAddressPools().get(0).id()); + Assertions.assertEquals("g", model.dscpConfiguration().id()); + Assertions.assertEquals(NetworkInterfaceAuxiliaryMode.NONE, model.auxiliaryMode()); + Assertions.assertEquals(NetworkInterfaceAuxiliarySku.NONE, model.auxiliarySku()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineNetworkInterfaceConfigurationTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineNetworkInterfaceConfigurationTests.java new file mode 100644 index 000000000000..5b2d43944b37 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineNetworkInterfaceConfigurationTests.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.DeleteOptions; +import com.azure.resourcemanager.compute.bulkactions.models.IPVersions; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.compute.bulkactions.models.NetworkInterfaceAuxiliarySku; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSku; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceConfigurationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceDnsSettingsConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceIPConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceIPConfigurationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressConfigurationProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class VirtualMachineNetworkInterfaceConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VirtualMachineNetworkInterfaceConfiguration model = BinaryData.fromString( + "{\"name\":\"otftpvjzbexilz\",\"properties\":{\"primary\":false,\"deleteOption\":\"Detach\",\"enableAcceleratedNetworking\":false,\"disableTcpStateTracking\":true,\"enableFpga\":true,\"enableIPForwarding\":false,\"networkSecurityGroup\":{\"id\":\"ujmkcjhwqy\"},\"dnsSettings\":{\"dnsServers\":[\"bnw\"]},\"ipConfigurations\":[{\"name\":\"wgdrjervnaenqp\",\"properties\":{\"subnet\":{\"id\":\"doy\"},\"primary\":false,\"publicIPAddressConfiguration\":{\"name\":\"thnzd\",\"properties\":{},\"sku\":{},\"tags\":{\"ynduha\":\"nayqi\",\"bgycduiertgccym\":\"hqlkthumaqo\",\"lqlfm\":\"aolps\"}},\"privateIPAddressVersion\":\"IPv4\",\"applicationSecurityGroups\":[{},{}],\"applicationGatewayBackendAddressPools\":[{},{},{}],\"loadBalancerBackendAddressPools\":[{},{},{}]}},{\"name\":\"swiydmcwyhzdx\",\"properties\":{\"subnet\":{\"id\":\"bzmnvdfznud\"},\"primary\":true,\"publicIPAddressConfiguration\":{\"name\":\"xzb\",\"properties\":{},\"sku\":{},\"tags\":{\"cers\":\"lpstdbhhxsrzdz\",\"wjmy\":\"dntnevf\",\"s\":\"tdss\",\"emwabnet\":\"tmweriofzpyq\"}},\"privateIPAddressVersion\":\"IPv6\",\"applicationSecurityGroups\":[{},{},{}],\"applicationGatewayBackendAddressPools\":[{},{},{}],\"loadBalancerBackendAddressPools\":[{},{},{},{}]}},{\"name\":\"lvwiwubmwmbesl\",\"properties\":{\"subnet\":{\"id\":\"wtppjflcxogaoko\"},\"primary\":false,\"publicIPAddressConfiguration\":{\"name\":\"sikvmkqzeqqkdlt\",\"properties\":{},\"sku\":{},\"tags\":{\"wobdagxtibqdx\":\"hvhgureod\"}},\"privateIPAddressVersion\":\"IPv6\",\"applicationSecurityGroups\":[{},{},{},{}],\"applicationGatewayBackendAddressPools\":[{},{},{},{}],\"loadBalancerBackendAddressPools\":[{}]}}],\"dscpConfiguration\":{\"id\":\"dlkzgxhuri\"},\"auxiliaryMode\":\"AcceleratedConnections\",\"auxiliarySku\":\"A2\"},\"tags\":{\"ubyyntw\":\"unkbebx\",\"seotgqrllt\":\"rbqtkoie\",\"lauwzizxbmpgcjef\":\"u\",\"bmnzbtbhjpgl\":\"zmuvpbttdumorppx\"}}") + .toObject(VirtualMachineNetworkInterfaceConfiguration.class); + Assertions.assertEquals("otftpvjzbexilz", model.name()); + Assertions.assertFalse(model.properties().primary()); + Assertions.assertEquals(DeleteOptions.DETACH, model.properties().deleteOption()); + Assertions.assertFalse(model.properties().enableAcceleratedNetworking()); + Assertions.assertTrue(model.properties().disableTcpStateTracking()); + Assertions.assertTrue(model.properties().enableFpga()); + Assertions.assertFalse(model.properties().enableIPForwarding()); + Assertions.assertEquals("ujmkcjhwqy", model.properties().networkSecurityGroup().id()); + Assertions.assertEquals("bnw", model.properties().dnsSettings().dnsServers().get(0)); + Assertions.assertEquals("wgdrjervnaenqp", model.properties().ipConfigurations().get(0).name()); + Assertions.assertEquals("doy", model.properties().ipConfigurations().get(0).properties().subnet().id()); + Assertions.assertFalse(model.properties().ipConfigurations().get(0).properties().primary()); + Assertions.assertEquals("thnzd", + model.properties().ipConfigurations().get(0).properties().publicIPAddressConfiguration().name()); + Assertions.assertEquals("nayqi", + model.properties() + .ipConfigurations() + .get(0) + .properties() + .publicIPAddressConfiguration() + .tags() + .get("ynduha")); + Assertions.assertEquals(IPVersions.IPV4, + model.properties().ipConfigurations().get(0).properties().privateIPAddressVersion()); + Assertions.assertEquals("dlkzgxhuri", model.properties().dscpConfiguration().id()); + Assertions.assertEquals(NetworkInterfaceAuxiliaryMode.ACCELERATED_CONNECTIONS, + model.properties().auxiliaryMode()); + Assertions.assertEquals(NetworkInterfaceAuxiliarySku.A2, model.properties().auxiliarySku()); + Assertions.assertEquals("unkbebx", model.tags().get("ubyyntw")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualMachineNetworkInterfaceConfiguration model + = new VirtualMachineNetworkInterfaceConfiguration().withName("otftpvjzbexilz") + .withProperties( + new VirtualMachineNetworkInterfaceConfigurationProperties().withPrimary(false) + .withDeleteOption(DeleteOptions.DETACH) + .withEnableAcceleratedNetworking(false) + .withDisableTcpStateTracking(true) + .withEnableFpga(true) + .withEnableIPForwarding(false) + .withNetworkSecurityGroup(new SubResource().withId("ujmkcjhwqy")) + .withDnsSettings(new VirtualMachineNetworkInterfaceDnsSettingsConfiguration() + .withDnsServers(Arrays.asList("bnw"))) + .withIpConfigurations( + Arrays.asList( + new VirtualMachineNetworkInterfaceIPConfiguration().withName("wgdrjervnaenqp") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties() + .withSubnet(new SubResource().withId("doy")) + .withPrimary(false) + .withPublicIPAddressConfiguration( + new VirtualMachinePublicIPAddressConfiguration().withName("thnzd") + .withProperties( + new VirtualMachinePublicIPAddressConfigurationProperties()) + .withSku(new PublicIPAddressSku()) + .withTags(mapOf("ynduha", "nayqi", "bgycduiertgccym", "hqlkthumaqo", + "lqlfm", "aolps"))) + .withPrivateIPAddressVersion(IPVersions.IPV4) + .withApplicationSecurityGroups( + Arrays.asList(new SubResource(), new SubResource())) + .withApplicationGatewayBackendAddressPools( + Arrays.asList(new SubResource(), new SubResource(), new SubResource())) + .withLoadBalancerBackendAddressPools( + Arrays.asList(new SubResource(), new SubResource(), new SubResource()))), + new VirtualMachineNetworkInterfaceIPConfiguration().withName("swiydmcwyhzdx") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties() + .withSubnet(new SubResource().withId("bzmnvdfznud")) + .withPrimary(true) + .withPublicIPAddressConfiguration( + new VirtualMachinePublicIPAddressConfiguration().withName("xzb") + .withProperties( + new VirtualMachinePublicIPAddressConfigurationProperties()) + .withSku(new PublicIPAddressSku()) + .withTags(mapOf("cers", "lpstdbhhxsrzdz", "wjmy", "dntnevf", "s", + "tdss", "emwabnet", "tmweriofzpyq"))) + .withPrivateIPAddressVersion(IPVersions.IPV6) + .withApplicationSecurityGroups( + Arrays.asList(new SubResource(), new SubResource(), new SubResource())) + .withApplicationGatewayBackendAddressPools( + Arrays.asList(new SubResource(), new SubResource(), new SubResource())) + .withLoadBalancerBackendAddressPools( + Arrays.asList(new SubResource(), new SubResource(), new SubResource(), + new SubResource()))), + new VirtualMachineNetworkInterfaceIPConfiguration().withName("lvwiwubmwmbesl") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties() + .withSubnet(new SubResource().withId("wtppjflcxogaoko")) + .withPrimary(false) + .withPublicIPAddressConfiguration( + new VirtualMachinePublicIPAddressConfiguration().withName("sikvmkqzeqqkdlt") + .withProperties( + new VirtualMachinePublicIPAddressConfigurationProperties()) + .withSku(new PublicIPAddressSku()) + .withTags(mapOf("wobdagxtibqdx", "hvhgureod"))) + .withPrivateIPAddressVersion(IPVersions.IPV6) + .withApplicationSecurityGroups(Arrays.asList(new SubResource(), + new SubResource(), new SubResource(), new SubResource())) + .withApplicationGatewayBackendAddressPools(Arrays.asList(new SubResource(), + new SubResource(), new SubResource(), new SubResource())) + .withLoadBalancerBackendAddressPools(Arrays.asList(new SubResource()))))) + .withDscpConfiguration(new SubResource().withId("dlkzgxhuri")) + .withAuxiliaryMode(NetworkInterfaceAuxiliaryMode.ACCELERATED_CONNECTIONS) + .withAuxiliarySku(NetworkInterfaceAuxiliarySku.A2)) + .withTags(mapOf("ubyyntw", "unkbebx", "seotgqrllt", "rbqtkoie", "lauwzizxbmpgcjef", "u", "bmnzbtbhjpgl", + "zmuvpbttdumorppx")); + model = BinaryData.fromObject(model).toObject(VirtualMachineNetworkInterfaceConfiguration.class); + Assertions.assertEquals("otftpvjzbexilz", model.name()); + Assertions.assertFalse(model.properties().primary()); + Assertions.assertEquals(DeleteOptions.DETACH, model.properties().deleteOption()); + Assertions.assertFalse(model.properties().enableAcceleratedNetworking()); + Assertions.assertTrue(model.properties().disableTcpStateTracking()); + Assertions.assertTrue(model.properties().enableFpga()); + Assertions.assertFalse(model.properties().enableIPForwarding()); + Assertions.assertEquals("ujmkcjhwqy", model.properties().networkSecurityGroup().id()); + Assertions.assertEquals("bnw", model.properties().dnsSettings().dnsServers().get(0)); + Assertions.assertEquals("wgdrjervnaenqp", model.properties().ipConfigurations().get(0).name()); + Assertions.assertEquals("doy", model.properties().ipConfigurations().get(0).properties().subnet().id()); + Assertions.assertFalse(model.properties().ipConfigurations().get(0).properties().primary()); + Assertions.assertEquals("thnzd", + model.properties().ipConfigurations().get(0).properties().publicIPAddressConfiguration().name()); + Assertions.assertEquals("nayqi", + model.properties() + .ipConfigurations() + .get(0) + .properties() + .publicIPAddressConfiguration() + .tags() + .get("ynduha")); + Assertions.assertEquals(IPVersions.IPV4, + model.properties().ipConfigurations().get(0).properties().privateIPAddressVersion()); + Assertions.assertEquals("dlkzgxhuri", model.properties().dscpConfiguration().id()); + Assertions.assertEquals(NetworkInterfaceAuxiliaryMode.ACCELERATED_CONNECTIONS, + model.properties().auxiliaryMode()); + Assertions.assertEquals(NetworkInterfaceAuxiliarySku.A2, model.properties().auxiliarySku()); + Assertions.assertEquals("unkbebx", model.tags().get("ubyyntw")); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineNetworkInterfaceDnsSettingsConfigurationTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineNetworkInterfaceDnsSettingsConfigurationTests.java new file mode 100644 index 000000000000..e1fa65d487d6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineNetworkInterfaceDnsSettingsConfigurationTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceDnsSettingsConfiguration; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class VirtualMachineNetworkInterfaceDnsSettingsConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VirtualMachineNetworkInterfaceDnsSettingsConfiguration model + = BinaryData.fromString("{\"dnsServers\":[\"iknsorgjh\",\"bldtlww\",\"lkdmtncvokotllxd\",\"h\"]}") + .toObject(VirtualMachineNetworkInterfaceDnsSettingsConfiguration.class); + Assertions.assertEquals("iknsorgjh", model.dnsServers().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualMachineNetworkInterfaceDnsSettingsConfiguration model + = new VirtualMachineNetworkInterfaceDnsSettingsConfiguration() + .withDnsServers(Arrays.asList("iknsorgjh", "bldtlww", "lkdmtncvokotllxd", "h")); + model = BinaryData.fromObject(model).toObject(VirtualMachineNetworkInterfaceDnsSettingsConfiguration.class); + Assertions.assertEquals("iknsorgjh", model.dnsServers().get(0)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineNetworkInterfaceIPConfigurationPropertiesTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineNetworkInterfaceIPConfigurationPropertiesTests.java new file mode 100644 index 000000000000..638e6561de07 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineNetworkInterfaceIPConfigurationPropertiesTests.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.DeleteOptions; +import com.azure.resourcemanager.compute.bulkactions.models.DomainNameLabelScopeTypes; +import com.azure.resourcemanager.compute.bulkactions.models.IPVersions; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSku; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSkuName; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSkuTier; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAllocationMethod; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineIpTag; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceIPConfigurationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressConfigurationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressDnsSettingsConfiguration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class VirtualMachineNetworkInterfaceIPConfigurationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VirtualMachineNetworkInterfaceIPConfigurationProperties model = BinaryData.fromString( + "{\"subnet\":{\"id\":\"eae\"},\"primary\":false,\"publicIPAddressConfiguration\":{\"name\":\"fatkld\",\"properties\":{\"idleTimeoutInMinutes\":863801878,\"deleteOption\":\"Delete\",\"dnsSettings\":{\"domainNameLabel\":\"aanozjosphyoulpj\",\"domainNameLabelScope\":\"TenantReuse\"},\"ipTags\":[{\"ipTagType\":\"rvimjwosytxitcsk\",\"tag\":\"k\"},{\"ipTagType\":\"umiekkezzi\",\"tag\":\"ly\"},{\"ipTagType\":\"hdgqggeb\",\"tag\":\"nyga\"},{\"ipTagType\":\"idb\",\"tag\":\"atpxl\"}],\"publicIPPrefix\":{\"id\":\"cyjmoadsuvarmy\"},\"publicIPAddressVersion\":\"IPv4\",\"publicIPAllocationMethod\":\"Static\"},\"sku\":{\"name\":\"Basic\",\"tier\":\"Regional\"},\"tags\":{\"rw\":\"x\",\"duhpk\":\"yc\",\"hky\":\"kgymareqnajxqug\"}},\"privateIPAddressVersion\":\"IPv6\",\"applicationSecurityGroups\":[{\"id\":\"gssofwq\"}],\"applicationGatewayBackendAddressPools\":[{\"id\":\"lkrm\"}],\"loadBalancerBackendAddressPools\":[{\"id\":\"pxacqqudfn\"}]}") + .toObject(VirtualMachineNetworkInterfaceIPConfigurationProperties.class); + Assertions.assertEquals("eae", model.subnet().id()); + Assertions.assertFalse(model.primary()); + Assertions.assertEquals("fatkld", model.publicIPAddressConfiguration().name()); + Assertions.assertEquals(863801878, model.publicIPAddressConfiguration().properties().idleTimeoutInMinutes()); + Assertions.assertEquals(DeleteOptions.DELETE, model.publicIPAddressConfiguration().properties().deleteOption()); + Assertions.assertEquals("aanozjosphyoulpj", + model.publicIPAddressConfiguration().properties().dnsSettings().domainNameLabel()); + Assertions.assertEquals(DomainNameLabelScopeTypes.TENANT_REUSE, + model.publicIPAddressConfiguration().properties().dnsSettings().domainNameLabelScope()); + Assertions.assertEquals("rvimjwosytxitcsk", + model.publicIPAddressConfiguration().properties().ipTags().get(0).ipTagType()); + Assertions.assertEquals("k", model.publicIPAddressConfiguration().properties().ipTags().get(0).tag()); + Assertions.assertEquals("cyjmoadsuvarmy", + model.publicIPAddressConfiguration().properties().publicIPPrefix().id()); + Assertions.assertEquals(IPVersions.IPV4, + model.publicIPAddressConfiguration().properties().publicIPAddressVersion()); + Assertions.assertEquals(PublicIPAllocationMethod.STATIC, + model.publicIPAddressConfiguration().properties().publicIPAllocationMethod()); + Assertions.assertEquals(PublicIPAddressSkuName.BASIC, model.publicIPAddressConfiguration().sku().name()); + Assertions.assertEquals(PublicIPAddressSkuTier.REGIONAL, model.publicIPAddressConfiguration().sku().tier()); + Assertions.assertEquals("x", model.publicIPAddressConfiguration().tags().get("rw")); + Assertions.assertEquals(IPVersions.IPV6, model.privateIPAddressVersion()); + Assertions.assertEquals("gssofwq", model.applicationSecurityGroups().get(0).id()); + Assertions.assertEquals("lkrm", model.applicationGatewayBackendAddressPools().get(0).id()); + Assertions.assertEquals("pxacqqudfn", model.loadBalancerBackendAddressPools().get(0).id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualMachineNetworkInterfaceIPConfigurationProperties model + = new VirtualMachineNetworkInterfaceIPConfigurationProperties().withSubnet(new SubResource().withId("eae")) + .withPrimary(false) + .withPublicIPAddressConfiguration( + new VirtualMachinePublicIPAddressConfiguration().withName("fatkld") + .withProperties(new VirtualMachinePublicIPAddressConfigurationProperties() + .withIdleTimeoutInMinutes(863801878) + .withDeleteOption(DeleteOptions.DELETE) + .withDnsSettings(new VirtualMachinePublicIPAddressDnsSettingsConfiguration() + .withDomainNameLabel("aanozjosphyoulpj") + .withDomainNameLabelScope(DomainNameLabelScopeTypes.TENANT_REUSE)) + .withIpTags( + Arrays.asList(new VirtualMachineIpTag().withIpTagType("rvimjwosytxitcsk").withTag("k"), + new VirtualMachineIpTag().withIpTagType("umiekkezzi").withTag("ly"), + new VirtualMachineIpTag().withIpTagType("hdgqggeb").withTag("nyga"), + new VirtualMachineIpTag().withIpTagType("idb").withTag("atpxl"))) + .withPublicIPPrefix(new SubResource().withId("cyjmoadsuvarmy")) + .withPublicIPAddressVersion(IPVersions.IPV4) + .withPublicIPAllocationMethod(PublicIPAllocationMethod.STATIC)) + .withSku(new PublicIPAddressSku().withName(PublicIPAddressSkuName.BASIC) + .withTier(PublicIPAddressSkuTier.REGIONAL)) + .withTags(mapOf("rw", "x", "duhpk", "yc", "hky", "kgymareqnajxqug"))) + .withPrivateIPAddressVersion(IPVersions.IPV6) + .withApplicationSecurityGroups(Arrays.asList(new SubResource().withId("gssofwq"))) + .withApplicationGatewayBackendAddressPools(Arrays.asList(new SubResource().withId("lkrm"))) + .withLoadBalancerBackendAddressPools(Arrays.asList(new SubResource().withId("pxacqqudfn"))); + model = BinaryData.fromObject(model).toObject(VirtualMachineNetworkInterfaceIPConfigurationProperties.class); + Assertions.assertEquals("eae", model.subnet().id()); + Assertions.assertFalse(model.primary()); + Assertions.assertEquals("fatkld", model.publicIPAddressConfiguration().name()); + Assertions.assertEquals(863801878, model.publicIPAddressConfiguration().properties().idleTimeoutInMinutes()); + Assertions.assertEquals(DeleteOptions.DELETE, model.publicIPAddressConfiguration().properties().deleteOption()); + Assertions.assertEquals("aanozjosphyoulpj", + model.publicIPAddressConfiguration().properties().dnsSettings().domainNameLabel()); + Assertions.assertEquals(DomainNameLabelScopeTypes.TENANT_REUSE, + model.publicIPAddressConfiguration().properties().dnsSettings().domainNameLabelScope()); + Assertions.assertEquals("rvimjwosytxitcsk", + model.publicIPAddressConfiguration().properties().ipTags().get(0).ipTagType()); + Assertions.assertEquals("k", model.publicIPAddressConfiguration().properties().ipTags().get(0).tag()); + Assertions.assertEquals("cyjmoadsuvarmy", + model.publicIPAddressConfiguration().properties().publicIPPrefix().id()); + Assertions.assertEquals(IPVersions.IPV4, + model.publicIPAddressConfiguration().properties().publicIPAddressVersion()); + Assertions.assertEquals(PublicIPAllocationMethod.STATIC, + model.publicIPAddressConfiguration().properties().publicIPAllocationMethod()); + Assertions.assertEquals(PublicIPAddressSkuName.BASIC, model.publicIPAddressConfiguration().sku().name()); + Assertions.assertEquals(PublicIPAddressSkuTier.REGIONAL, model.publicIPAddressConfiguration().sku().tier()); + Assertions.assertEquals("x", model.publicIPAddressConfiguration().tags().get("rw")); + Assertions.assertEquals(IPVersions.IPV6, model.privateIPAddressVersion()); + Assertions.assertEquals("gssofwq", model.applicationSecurityGroups().get(0).id()); + Assertions.assertEquals("lkrm", model.applicationGatewayBackendAddressPools().get(0).id()); + Assertions.assertEquals("pxacqqudfn", model.loadBalancerBackendAddressPools().get(0).id()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineNetworkInterfaceIPConfigurationTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineNetworkInterfaceIPConfigurationTests.java new file mode 100644 index 000000000000..e4a487c6ffd2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachineNetworkInterfaceIPConfigurationTests.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.DeleteOptions; +import com.azure.resourcemanager.compute.bulkactions.models.DomainNameLabelScopeTypes; +import com.azure.resourcemanager.compute.bulkactions.models.IPVersions; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSku; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSkuName; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSkuTier; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAllocationMethod; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineIpTag; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceIPConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineNetworkInterfaceIPConfigurationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressConfigurationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressDnsSettingsConfiguration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class VirtualMachineNetworkInterfaceIPConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VirtualMachineNetworkInterfaceIPConfiguration model = BinaryData.fromString( + "{\"name\":\"syocogjltdtbnnha\",\"properties\":{\"subnet\":{\"id\":\"rkvcikhnvpa\"},\"primary\":true,\"publicIPAddressConfiguration\":{\"name\":\"qqu\",\"properties\":{\"idleTimeoutInMinutes\":1817330156,\"deleteOption\":\"Detach\",\"dnsSettings\":{\"domainNameLabel\":\"gxk\",\"domainNameLabelScope\":\"TenantReuse\"},\"ipTags\":[{\"ipTagType\":\"elwuipi\",\"tag\":\"jzkzi\"},{\"ipTagType\":\"vvcnayr\",\"tag\":\"rnxxmueed\"}],\"publicIPPrefix\":{\"id\":\"dvstkw\"},\"publicIPAddressVersion\":\"IPv4\",\"publicIPAllocationMethod\":\"Static\"},\"sku\":{\"name\":\"Standard\",\"tier\":\"Global\"},\"tags\":{\"aygdvwvgpioh\":\"d\",\"udxepxgyqagv\":\"wxrt\",\"wi\":\"vmnpkukghimdblx\"}},\"privateIPAddressVersion\":\"IPv4\",\"applicationSecurityGroups\":[{\"id\":\"j\"}],\"applicationGatewayBackendAddressPools\":[{\"id\":\"zk\"},{\"id\":\"oqreyfkzikfjawn\"}],\"loadBalancerBackendAddressPools\":[{\"id\":\"xwczelpcire\"}]}}") + .toObject(VirtualMachineNetworkInterfaceIPConfiguration.class); + Assertions.assertEquals("syocogjltdtbnnha", model.name()); + Assertions.assertEquals("rkvcikhnvpa", model.properties().subnet().id()); + Assertions.assertTrue(model.properties().primary()); + Assertions.assertEquals("qqu", model.properties().publicIPAddressConfiguration().name()); + Assertions.assertEquals(1817330156, + model.properties().publicIPAddressConfiguration().properties().idleTimeoutInMinutes()); + Assertions.assertEquals(DeleteOptions.DETACH, + model.properties().publicIPAddressConfiguration().properties().deleteOption()); + Assertions.assertEquals("gxk", + model.properties().publicIPAddressConfiguration().properties().dnsSettings().domainNameLabel()); + Assertions.assertEquals(DomainNameLabelScopeTypes.TENANT_REUSE, + model.properties().publicIPAddressConfiguration().properties().dnsSettings().domainNameLabelScope()); + Assertions.assertEquals("elwuipi", + model.properties().publicIPAddressConfiguration().properties().ipTags().get(0).ipTagType()); + Assertions.assertEquals("jzkzi", + model.properties().publicIPAddressConfiguration().properties().ipTags().get(0).tag()); + Assertions.assertEquals("dvstkw", + model.properties().publicIPAddressConfiguration().properties().publicIPPrefix().id()); + Assertions.assertEquals(IPVersions.IPV4, + model.properties().publicIPAddressConfiguration().properties().publicIPAddressVersion()); + Assertions.assertEquals(PublicIPAllocationMethod.STATIC, + model.properties().publicIPAddressConfiguration().properties().publicIPAllocationMethod()); + Assertions.assertEquals(PublicIPAddressSkuName.STANDARD, + model.properties().publicIPAddressConfiguration().sku().name()); + Assertions.assertEquals(PublicIPAddressSkuTier.GLOBAL, + model.properties().publicIPAddressConfiguration().sku().tier()); + Assertions.assertEquals("d", model.properties().publicIPAddressConfiguration().tags().get("aygdvwvgpioh")); + Assertions.assertEquals(IPVersions.IPV4, model.properties().privateIPAddressVersion()); + Assertions.assertEquals("j", model.properties().applicationSecurityGroups().get(0).id()); + Assertions.assertEquals("zk", model.properties().applicationGatewayBackendAddressPools().get(0).id()); + Assertions.assertEquals("xwczelpcire", model.properties().loadBalancerBackendAddressPools().get(0).id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualMachineNetworkInterfaceIPConfiguration model = new VirtualMachineNetworkInterfaceIPConfiguration() + .withName("syocogjltdtbnnha") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties() + .withSubnet(new SubResource().withId("rkvcikhnvpa")) + .withPrimary(true) + .withPublicIPAddressConfiguration(new VirtualMachinePublicIPAddressConfiguration().withName("qqu") + .withProperties(new VirtualMachinePublicIPAddressConfigurationProperties() + .withIdleTimeoutInMinutes(1817330156) + .withDeleteOption(DeleteOptions.DETACH) + .withDnsSettings( + new VirtualMachinePublicIPAddressDnsSettingsConfiguration().withDomainNameLabel("gxk") + .withDomainNameLabelScope(DomainNameLabelScopeTypes.TENANT_REUSE)) + .withIpTags(Arrays.asList(new VirtualMachineIpTag().withIpTagType("elwuipi").withTag("jzkzi"), + new VirtualMachineIpTag().withIpTagType("vvcnayr").withTag("rnxxmueed"))) + .withPublicIPPrefix(new SubResource().withId("dvstkw")) + .withPublicIPAddressVersion(IPVersions.IPV4) + .withPublicIPAllocationMethod(PublicIPAllocationMethod.STATIC)) + .withSku(new PublicIPAddressSku().withName(PublicIPAddressSkuName.STANDARD) + .withTier(PublicIPAddressSkuTier.GLOBAL)) + .withTags(mapOf("aygdvwvgpioh", "d", "udxepxgyqagv", "wxrt", "wi", "vmnpkukghimdblx"))) + .withPrivateIPAddressVersion(IPVersions.IPV4) + .withApplicationSecurityGroups(Arrays.asList(new SubResource().withId("j"))) + .withApplicationGatewayBackendAddressPools( + Arrays.asList(new SubResource().withId("zk"), new SubResource().withId("oqreyfkzikfjawn"))) + .withLoadBalancerBackendAddressPools(Arrays.asList(new SubResource().withId("xwczelpcire")))); + model = BinaryData.fromObject(model).toObject(VirtualMachineNetworkInterfaceIPConfiguration.class); + Assertions.assertEquals("syocogjltdtbnnha", model.name()); + Assertions.assertEquals("rkvcikhnvpa", model.properties().subnet().id()); + Assertions.assertTrue(model.properties().primary()); + Assertions.assertEquals("qqu", model.properties().publicIPAddressConfiguration().name()); + Assertions.assertEquals(1817330156, + model.properties().publicIPAddressConfiguration().properties().idleTimeoutInMinutes()); + Assertions.assertEquals(DeleteOptions.DETACH, + model.properties().publicIPAddressConfiguration().properties().deleteOption()); + Assertions.assertEquals("gxk", + model.properties().publicIPAddressConfiguration().properties().dnsSettings().domainNameLabel()); + Assertions.assertEquals(DomainNameLabelScopeTypes.TENANT_REUSE, + model.properties().publicIPAddressConfiguration().properties().dnsSettings().domainNameLabelScope()); + Assertions.assertEquals("elwuipi", + model.properties().publicIPAddressConfiguration().properties().ipTags().get(0).ipTagType()); + Assertions.assertEquals("jzkzi", + model.properties().publicIPAddressConfiguration().properties().ipTags().get(0).tag()); + Assertions.assertEquals("dvstkw", + model.properties().publicIPAddressConfiguration().properties().publicIPPrefix().id()); + Assertions.assertEquals(IPVersions.IPV4, + model.properties().publicIPAddressConfiguration().properties().publicIPAddressVersion()); + Assertions.assertEquals(PublicIPAllocationMethod.STATIC, + model.properties().publicIPAddressConfiguration().properties().publicIPAllocationMethod()); + Assertions.assertEquals(PublicIPAddressSkuName.STANDARD, + model.properties().publicIPAddressConfiguration().sku().name()); + Assertions.assertEquals(PublicIPAddressSkuTier.GLOBAL, + model.properties().publicIPAddressConfiguration().sku().tier()); + Assertions.assertEquals("d", model.properties().publicIPAddressConfiguration().tags().get("aygdvwvgpioh")); + Assertions.assertEquals(IPVersions.IPV4, model.properties().privateIPAddressVersion()); + Assertions.assertEquals("j", model.properties().applicationSecurityGroups().get(0).id()); + Assertions.assertEquals("zk", model.properties().applicationGatewayBackendAddressPools().get(0).id()); + Assertions.assertEquals("xwczelpcire", model.properties().loadBalancerBackendAddressPools().get(0).id()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachinePublicIPAddressConfigurationPropertiesTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachinePublicIPAddressConfigurationPropertiesTests.java new file mode 100644 index 000000000000..8aa6d89d01db --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachinePublicIPAddressConfigurationPropertiesTests.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.DeleteOptions; +import com.azure.resourcemanager.compute.bulkactions.models.DomainNameLabelScopeTypes; +import com.azure.resourcemanager.compute.bulkactions.models.IPVersions; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAllocationMethod; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineIpTag; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressConfigurationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressDnsSettingsConfiguration; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class VirtualMachinePublicIPAddressConfigurationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VirtualMachinePublicIPAddressConfigurationProperties model = BinaryData.fromString( + "{\"idleTimeoutInMinutes\":576385447,\"deleteOption\":\"Detach\",\"dnsSettings\":{\"domainNameLabel\":\"wxuqlcvydypatdoo\",\"domainNameLabelScope\":\"SubscriptionReuse\"},\"ipTags\":[{\"ipTagType\":\"odko\",\"tag\":\"bw\"},{\"ipTagType\":\"jhemms\",\"tag\":\"dkcrodt\"},{\"ipTagType\":\"nfwjlfltkacjvefk\",\"tag\":\"foakgg\"}],\"publicIPPrefix\":{\"id\":\"agaowpulpqblylsy\"},\"publicIPAddressVersion\":\"IPv6\",\"publicIPAllocationMethod\":\"Dynamic\"}") + .toObject(VirtualMachinePublicIPAddressConfigurationProperties.class); + Assertions.assertEquals(576385447, model.idleTimeoutInMinutes()); + Assertions.assertEquals(DeleteOptions.DETACH, model.deleteOption()); + Assertions.assertEquals("wxuqlcvydypatdoo", model.dnsSettings().domainNameLabel()); + Assertions.assertEquals(DomainNameLabelScopeTypes.SUBSCRIPTION_REUSE, + model.dnsSettings().domainNameLabelScope()); + Assertions.assertEquals("odko", model.ipTags().get(0).ipTagType()); + Assertions.assertEquals("bw", model.ipTags().get(0).tag()); + Assertions.assertEquals("agaowpulpqblylsy", model.publicIPPrefix().id()); + Assertions.assertEquals(IPVersions.IPV6, model.publicIPAddressVersion()); + Assertions.assertEquals(PublicIPAllocationMethod.DYNAMIC, model.publicIPAllocationMethod()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualMachinePublicIPAddressConfigurationProperties model + = new VirtualMachinePublicIPAddressConfigurationProperties().withIdleTimeoutInMinutes(576385447) + .withDeleteOption(DeleteOptions.DETACH) + .withDnsSettings( + new VirtualMachinePublicIPAddressDnsSettingsConfiguration().withDomainNameLabel("wxuqlcvydypatdoo") + .withDomainNameLabelScope(DomainNameLabelScopeTypes.SUBSCRIPTION_REUSE)) + .withIpTags(Arrays.asList(new VirtualMachineIpTag().withIpTagType("odko").withTag("bw"), + new VirtualMachineIpTag().withIpTagType("jhemms").withTag("dkcrodt"), + new VirtualMachineIpTag().withIpTagType("nfwjlfltkacjvefk").withTag("foakgg"))) + .withPublicIPPrefix(new SubResource().withId("agaowpulpqblylsy")) + .withPublicIPAddressVersion(IPVersions.IPV6) + .withPublicIPAllocationMethod(PublicIPAllocationMethod.DYNAMIC); + model = BinaryData.fromObject(model).toObject(VirtualMachinePublicIPAddressConfigurationProperties.class); + Assertions.assertEquals(576385447, model.idleTimeoutInMinutes()); + Assertions.assertEquals(DeleteOptions.DETACH, model.deleteOption()); + Assertions.assertEquals("wxuqlcvydypatdoo", model.dnsSettings().domainNameLabel()); + Assertions.assertEquals(DomainNameLabelScopeTypes.SUBSCRIPTION_REUSE, + model.dnsSettings().domainNameLabelScope()); + Assertions.assertEquals("odko", model.ipTags().get(0).ipTagType()); + Assertions.assertEquals("bw", model.ipTags().get(0).tag()); + Assertions.assertEquals("agaowpulpqblylsy", model.publicIPPrefix().id()); + Assertions.assertEquals(IPVersions.IPV6, model.publicIPAddressVersion()); + Assertions.assertEquals(PublicIPAllocationMethod.DYNAMIC, model.publicIPAllocationMethod()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachinePublicIPAddressConfigurationTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachinePublicIPAddressConfigurationTests.java new file mode 100644 index 000000000000..75bac989751b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachinePublicIPAddressConfigurationTests.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.DeleteOptions; +import com.azure.resourcemanager.compute.bulkactions.models.DomainNameLabelScopeTypes; +import com.azure.resourcemanager.compute.bulkactions.models.IPVersions; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSku; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSkuName; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAddressSkuTier; +import com.azure.resourcemanager.compute.bulkactions.models.PublicIPAllocationMethod; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachineIpTag; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressConfigurationProperties; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressDnsSettingsConfiguration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class VirtualMachinePublicIPAddressConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VirtualMachinePublicIPAddressConfiguration model = BinaryData.fromString( + "{\"name\":\"yxbaaabjyvayf\",\"properties\":{\"idleTimeoutInMinutes\":936751244,\"deleteOption\":\"Delete\",\"dnsSettings\":{\"domainNameLabel\":\"uzqogsexnevf\",\"domainNameLabelScope\":\"SubscriptionReuse\"},\"ipTags\":[{\"ipTagType\":\"ewzsyyceuzsoib\",\"tag\":\"dpfrxtrthzvaytdw\"},{\"ipTagType\":\"brqubp\",\"tag\":\"h\"}],\"publicIPPrefix\":{\"id\":\"i\"},\"publicIPAddressVersion\":\"IPv6\",\"publicIPAllocationMethod\":\"Dynamic\"},\"sku\":{\"name\":\"Basic\",\"tier\":\"Regional\"},\"tags\":{\"uyfxrxxleptramxj\":\"qoaxoruzfgs\"}}") + .toObject(VirtualMachinePublicIPAddressConfiguration.class); + Assertions.assertEquals("yxbaaabjyvayf", model.name()); + Assertions.assertEquals(936751244, model.properties().idleTimeoutInMinutes()); + Assertions.assertEquals(DeleteOptions.DELETE, model.properties().deleteOption()); + Assertions.assertEquals("uzqogsexnevf", model.properties().dnsSettings().domainNameLabel()); + Assertions.assertEquals(DomainNameLabelScopeTypes.SUBSCRIPTION_REUSE, + model.properties().dnsSettings().domainNameLabelScope()); + Assertions.assertEquals("ewzsyyceuzsoib", model.properties().ipTags().get(0).ipTagType()); + Assertions.assertEquals("dpfrxtrthzvaytdw", model.properties().ipTags().get(0).tag()); + Assertions.assertEquals("i", model.properties().publicIPPrefix().id()); + Assertions.assertEquals(IPVersions.IPV6, model.properties().publicIPAddressVersion()); + Assertions.assertEquals(PublicIPAllocationMethod.DYNAMIC, model.properties().publicIPAllocationMethod()); + Assertions.assertEquals(PublicIPAddressSkuName.BASIC, model.sku().name()); + Assertions.assertEquals(PublicIPAddressSkuTier.REGIONAL, model.sku().tier()); + Assertions.assertEquals("qoaxoruzfgs", model.tags().get("uyfxrxxleptramxj")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualMachinePublicIPAddressConfiguration model = new VirtualMachinePublicIPAddressConfiguration() + .withName("yxbaaabjyvayf") + .withProperties(new VirtualMachinePublicIPAddressConfigurationProperties() + .withIdleTimeoutInMinutes(936751244) + .withDeleteOption(DeleteOptions.DELETE) + .withDnsSettings( + new VirtualMachinePublicIPAddressDnsSettingsConfiguration().withDomainNameLabel("uzqogsexnevf") + .withDomainNameLabelScope(DomainNameLabelScopeTypes.SUBSCRIPTION_REUSE)) + .withIpTags( + Arrays.asList(new VirtualMachineIpTag().withIpTagType("ewzsyyceuzsoib").withTag("dpfrxtrthzvaytdw"), + new VirtualMachineIpTag().withIpTagType("brqubp").withTag("h"))) + .withPublicIPPrefix(new SubResource().withId("i")) + .withPublicIPAddressVersion(IPVersions.IPV6) + .withPublicIPAllocationMethod(PublicIPAllocationMethod.DYNAMIC)) + .withSku(new PublicIPAddressSku().withName(PublicIPAddressSkuName.BASIC) + .withTier(PublicIPAddressSkuTier.REGIONAL)) + .withTags(mapOf("uyfxrxxleptramxj", "qoaxoruzfgs")); + model = BinaryData.fromObject(model).toObject(VirtualMachinePublicIPAddressConfiguration.class); + Assertions.assertEquals("yxbaaabjyvayf", model.name()); + Assertions.assertEquals(936751244, model.properties().idleTimeoutInMinutes()); + Assertions.assertEquals(DeleteOptions.DELETE, model.properties().deleteOption()); + Assertions.assertEquals("uzqogsexnevf", model.properties().dnsSettings().domainNameLabel()); + Assertions.assertEquals(DomainNameLabelScopeTypes.SUBSCRIPTION_REUSE, + model.properties().dnsSettings().domainNameLabelScope()); + Assertions.assertEquals("ewzsyyceuzsoib", model.properties().ipTags().get(0).ipTagType()); + Assertions.assertEquals("dpfrxtrthzvaytdw", model.properties().ipTags().get(0).tag()); + Assertions.assertEquals("i", model.properties().publicIPPrefix().id()); + Assertions.assertEquals(IPVersions.IPV6, model.properties().publicIPAddressVersion()); + Assertions.assertEquals(PublicIPAllocationMethod.DYNAMIC, model.properties().publicIPAllocationMethod()); + Assertions.assertEquals(PublicIPAddressSkuName.BASIC, model.sku().name()); + Assertions.assertEquals(PublicIPAddressSkuTier.REGIONAL, model.sku().tier()); + Assertions.assertEquals("qoaxoruzfgs", model.tags().get("uyfxrxxleptramxj")); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachinePublicIPAddressDnsSettingsConfigurationTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachinePublicIPAddressDnsSettingsConfigurationTests.java new file mode 100644 index 000000000000..7e75df43f7f3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VirtualMachinePublicIPAddressDnsSettingsConfigurationTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.DomainNameLabelScopeTypes; +import com.azure.resourcemanager.compute.bulkactions.models.VirtualMachinePublicIPAddressDnsSettingsConfiguration; +import org.junit.jupiter.api.Assertions; + +public final class VirtualMachinePublicIPAddressDnsSettingsConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VirtualMachinePublicIPAddressDnsSettingsConfiguration model + = BinaryData.fromString("{\"domainNameLabel\":\"sjervti\",\"domainNameLabelScope\":\"ResourceGroupReuse\"}") + .toObject(VirtualMachinePublicIPAddressDnsSettingsConfiguration.class); + Assertions.assertEquals("sjervti", model.domainNameLabel()); + Assertions.assertEquals(DomainNameLabelScopeTypes.RESOURCE_GROUP_REUSE, model.domainNameLabelScope()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualMachinePublicIPAddressDnsSettingsConfiguration model + = new VirtualMachinePublicIPAddressDnsSettingsConfiguration().withDomainNameLabel("sjervti") + .withDomainNameLabelScope(DomainNameLabelScopeTypes.RESOURCE_GROUP_REUSE); + model = BinaryData.fromObject(model).toObject(VirtualMachinePublicIPAddressDnsSettingsConfiguration.class); + Assertions.assertEquals("sjervti", model.domainNameLabel()); + Assertions.assertEquals(DomainNameLabelScopeTypes.RESOURCE_GROUP_REUSE, model.domainNameLabelScope()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VmSizeProfileTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VmSizeProfileTests.java new file mode 100644 index 000000000000..cacd83ecb759 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VmSizeProfileTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.VmSizeProfile; +import org.junit.jupiter.api.Assertions; + +public final class VmSizeProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VmSizeProfile model = BinaryData.fromString("{\"name\":\"xdqmidtthzrvqdra\",\"rank\":1245336174}") + .toObject(VmSizeProfile.class); + Assertions.assertEquals("xdqmidtthzrvqdra", model.name()); + Assertions.assertEquals(1245336174, model.rank()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VmSizeProfile model = new VmSizeProfile().withName("xdqmidtthzrvqdra").withRank(1245336174); + model = BinaryData.fromObject(model).toObject(VmSizeProfile.class); + Assertions.assertEquals("xdqmidtthzrvqdra", model.name()); + Assertions.assertEquals(1245336174, model.rank()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VmSizePropertiesTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VmSizePropertiesTests.java new file mode 100644 index 000000000000..df2c787fc9e7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/VmSizePropertiesTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.VmSizeProperties; +import org.junit.jupiter.api.Assertions; + +public final class VmSizePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VmSizeProperties model = BinaryData.fromString("{\"vCpusAvailable\":1391077197,\"vCpusPerCore\":1151721891}") + .toObject(VmSizeProperties.class); + Assertions.assertEquals(1391077197, model.vCpusAvailable()); + Assertions.assertEquals(1151721891, model.vCpusPerCore()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VmSizeProperties model = new VmSizeProperties().withVCpusAvailable(1391077197).withVCpusPerCore(1151721891); + model = BinaryData.fromObject(model).toObject(VmSizeProperties.class); + Assertions.assertEquals(1391077197, model.vCpusAvailable()); + Assertions.assertEquals(1151721891, model.vCpusPerCore()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/WinRMConfigurationTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/WinRMConfigurationTests.java new file mode 100644 index 000000000000..5f7792efb48e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/WinRMConfigurationTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.ProtocolTypes; +import com.azure.resourcemanager.compute.bulkactions.models.WinRMConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.WinRMListener; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class WinRMConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WinRMConfiguration model + = BinaryData.fromString("{\"listeners\":[{\"protocol\":\"Https\",\"certificateUrl\":\"touwaboekqv\"}]}") + .toObject(WinRMConfiguration.class); + Assertions.assertEquals(ProtocolTypes.HTTPS, model.listeners().get(0).protocol()); + Assertions.assertEquals("touwaboekqv", model.listeners().get(0).certificateUrl()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WinRMConfiguration model = new WinRMConfiguration().withListeners( + Arrays.asList(new WinRMListener().withProtocol(ProtocolTypes.HTTPS).withCertificateUrl("touwaboekqv"))); + model = BinaryData.fromObject(model).toObject(WinRMConfiguration.class); + Assertions.assertEquals(ProtocolTypes.HTTPS, model.listeners().get(0).protocol()); + Assertions.assertEquals("touwaboekqv", model.listeners().get(0).certificateUrl()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/WinRMListenerTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/WinRMListenerTests.java new file mode 100644 index 000000000000..f5f4e2f29b8d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/WinRMListenerTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.ProtocolTypes; +import com.azure.resourcemanager.compute.bulkactions.models.WinRMListener; +import org.junit.jupiter.api.Assertions; + +public final class WinRMListenerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WinRMListener model + = BinaryData.fromString("{\"protocol\":\"Http\",\"certificateUrl\":\"smv\"}").toObject(WinRMListener.class); + Assertions.assertEquals(ProtocolTypes.HTTP, model.protocol()); + Assertions.assertEquals("smv", model.certificateUrl()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WinRMListener model = new WinRMListener().withProtocol(ProtocolTypes.HTTP).withCertificateUrl("smv"); + model = BinaryData.fromObject(model).toObject(WinRMListener.class); + Assertions.assertEquals(ProtocolTypes.HTTP, model.protocol()); + Assertions.assertEquals("smv", model.certificateUrl()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/WindowsConfigurationTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/WindowsConfigurationTests.java new file mode 100644 index 000000000000..429e2c973e39 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/WindowsConfigurationTests.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.AdditionalUnattendContent; +import com.azure.resourcemanager.compute.bulkactions.models.AdditionalUnattendContentComponentName; +import com.azure.resourcemanager.compute.bulkactions.models.AdditionalUnattendContentPassName; +import com.azure.resourcemanager.compute.bulkactions.models.PatchSettings; +import com.azure.resourcemanager.compute.bulkactions.models.ProtocolTypes; +import com.azure.resourcemanager.compute.bulkactions.models.SettingNames; +import com.azure.resourcemanager.compute.bulkactions.models.WinRMConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.WinRMListener; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsConfiguration; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsPatchAssessmentMode; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsVMGuestPatchMode; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class WindowsConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WindowsConfiguration model = BinaryData.fromString( + "{\"provisionVMAgent\":false,\"enableAutomaticUpdates\":false,\"timeZone\":\"yqbexrmcqibycno\",\"additionalUnattendContent\":[{\"passName\":\"OobeSystem\",\"componentName\":\"Microsoft-Windows-Shell-Setup\",\"settingName\":\"FirstLogonCommands\",\"content\":\"zvahapjy\"}],\"patchSettings\":{\"patchMode\":\"AutomaticByPlatform\",\"enableHotpatching\":true,\"assessmentMode\":\"AutomaticByPlatform\",\"automaticByPlatformSettings\":{\"rebootSetting\":\"Always\",\"bypassPlatformSafetyChecksOnUserSchedule\":false}},\"winRM\":{\"listeners\":[{\"protocol\":\"Https\",\"certificateUrl\":\"xkvugfhzov\"},{\"protocol\":\"Https\",\"certificateUrl\":\"zunlu\"},{\"protocol\":\"Http\",\"certificateUrl\":\"prnxipeil\"},{\"protocol\":\"Http\",\"certificateUrl\":\"aejxd\"}]}}") + .toObject(WindowsConfiguration.class); + Assertions.assertFalse(model.provisionVMAgent()); + Assertions.assertFalse(model.enableAutomaticUpdates()); + Assertions.assertEquals("yqbexrmcqibycno", model.timeZone()); + Assertions.assertEquals(AdditionalUnattendContentPassName.OOBE_SYSTEM, + model.additionalUnattendContent().get(0).passName()); + Assertions.assertEquals(AdditionalUnattendContentComponentName.MICROSOFT_WINDOWS_SHELL_SETUP, + model.additionalUnattendContent().get(0).componentName()); + Assertions.assertEquals(SettingNames.FIRST_LOGON_COMMANDS, + model.additionalUnattendContent().get(0).settingName()); + Assertions.assertEquals("zvahapjy", model.additionalUnattendContent().get(0).content()); + Assertions.assertEquals(WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM, model.patchSettings().patchMode()); + Assertions.assertTrue(model.patchSettings().enableHotpatching()); + Assertions.assertEquals(WindowsPatchAssessmentMode.AUTOMATIC_BY_PLATFORM, + model.patchSettings().assessmentMode()); + Assertions.assertEquals(WindowsVMGuestPatchAutomaticByPlatformRebootSetting.ALWAYS, + model.patchSettings().automaticByPlatformSettings().rebootSetting()); + Assertions.assertFalse( + model.patchSettings().automaticByPlatformSettings().bypassPlatformSafetyChecksOnUserSchedule()); + Assertions.assertEquals(ProtocolTypes.HTTPS, model.winRM().listeners().get(0).protocol()); + Assertions.assertEquals("xkvugfhzov", model.winRM().listeners().get(0).certificateUrl()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WindowsConfiguration model = new WindowsConfiguration().withProvisionVMAgent(false) + .withEnableAutomaticUpdates(false) + .withTimeZone("yqbexrmcqibycno") + .withAdditionalUnattendContent(Arrays + .asList(new AdditionalUnattendContent().withPassName(AdditionalUnattendContentPassName.OOBE_SYSTEM) + .withComponentName(AdditionalUnattendContentComponentName.MICROSOFT_WINDOWS_SHELL_SETUP) + .withSettingName(SettingNames.FIRST_LOGON_COMMANDS) + .withContent("zvahapjy"))) + .withPatchSettings(new PatchSettings().withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM) + .withEnableHotpatching(true) + .withAssessmentMode(WindowsPatchAssessmentMode.AUTOMATIC_BY_PLATFORM) + .withAutomaticByPlatformSettings(new WindowsVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting(WindowsVMGuestPatchAutomaticByPlatformRebootSetting.ALWAYS) + .withBypassPlatformSafetyChecksOnUserSchedule(false))) + .withWinRM(new WinRMConfiguration().withListeners( + Arrays.asList(new WinRMListener().withProtocol(ProtocolTypes.HTTPS).withCertificateUrl("xkvugfhzov"), + new WinRMListener().withProtocol(ProtocolTypes.HTTPS).withCertificateUrl("zunlu"), + new WinRMListener().withProtocol(ProtocolTypes.HTTP).withCertificateUrl("prnxipeil"), + new WinRMListener().withProtocol(ProtocolTypes.HTTP).withCertificateUrl("aejxd")))); + model = BinaryData.fromObject(model).toObject(WindowsConfiguration.class); + Assertions.assertFalse(model.provisionVMAgent()); + Assertions.assertFalse(model.enableAutomaticUpdates()); + Assertions.assertEquals("yqbexrmcqibycno", model.timeZone()); + Assertions.assertEquals(AdditionalUnattendContentPassName.OOBE_SYSTEM, + model.additionalUnattendContent().get(0).passName()); + Assertions.assertEquals(AdditionalUnattendContentComponentName.MICROSOFT_WINDOWS_SHELL_SETUP, + model.additionalUnattendContent().get(0).componentName()); + Assertions.assertEquals(SettingNames.FIRST_LOGON_COMMANDS, + model.additionalUnattendContent().get(0).settingName()); + Assertions.assertEquals("zvahapjy", model.additionalUnattendContent().get(0).content()); + Assertions.assertEquals(WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM, model.patchSettings().patchMode()); + Assertions.assertTrue(model.patchSettings().enableHotpatching()); + Assertions.assertEquals(WindowsPatchAssessmentMode.AUTOMATIC_BY_PLATFORM, + model.patchSettings().assessmentMode()); + Assertions.assertEquals(WindowsVMGuestPatchAutomaticByPlatformRebootSetting.ALWAYS, + model.patchSettings().automaticByPlatformSettings().rebootSetting()); + Assertions.assertFalse( + model.patchSettings().automaticByPlatformSettings().bypassPlatformSafetyChecksOnUserSchedule()); + Assertions.assertEquals(ProtocolTypes.HTTPS, model.winRM().listeners().get(0).protocol()); + Assertions.assertEquals("xkvugfhzov", model.winRM().listeners().get(0).certificateUrl()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/WindowsVMGuestPatchAutomaticByPlatformSettingsTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/WindowsVMGuestPatchAutomaticByPlatformSettingsTests.java new file mode 100644 index 000000000000..7522bde7b628 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/WindowsVMGuestPatchAutomaticByPlatformSettingsTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.compute.bulkactions.models.WindowsVMGuestPatchAutomaticByPlatformSettings; +import org.junit.jupiter.api.Assertions; + +public final class WindowsVMGuestPatchAutomaticByPlatformSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WindowsVMGuestPatchAutomaticByPlatformSettings model = BinaryData + .fromString("{\"rebootSetting\":\"IfRequired\",\"bypassPlatformSafetyChecksOnUserSchedule\":false}") + .toObject(WindowsVMGuestPatchAutomaticByPlatformSettings.class); + Assertions.assertEquals(WindowsVMGuestPatchAutomaticByPlatformRebootSetting.IF_REQUIRED, model.rebootSetting()); + Assertions.assertFalse(model.bypassPlatformSafetyChecksOnUserSchedule()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WindowsVMGuestPatchAutomaticByPlatformSettings model = new WindowsVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting(WindowsVMGuestPatchAutomaticByPlatformRebootSetting.IF_REQUIRED) + .withBypassPlatformSafetyChecksOnUserSchedule(false); + model = BinaryData.fromObject(model).toObject(WindowsVMGuestPatchAutomaticByPlatformSettings.class); + Assertions.assertEquals(WindowsVMGuestPatchAutomaticByPlatformRebootSetting.IF_REQUIRED, model.rebootSetting()); + Assertions.assertFalse(model.bypassPlatformSafetyChecksOnUserSchedule()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ZoneAllocationPolicyTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ZoneAllocationPolicyTests.java new file mode 100644 index 000000000000..268465677fc8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ZoneAllocationPolicyTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.DistributionStrategy; +import com.azure.resourcemanager.compute.bulkactions.models.ZoneAllocationPolicy; +import com.azure.resourcemanager.compute.bulkactions.models.ZonePreference; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ZoneAllocationPolicyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ZoneAllocationPolicy model = BinaryData.fromString( + "{\"distributionStrategy\":\"Prioritized\",\"zonePreferences\":[{\"zone\":\"skanyk\",\"rank\":1937589018}]}") + .toObject(ZoneAllocationPolicy.class); + Assertions.assertEquals(DistributionStrategy.PRIORITIZED, model.distributionStrategy()); + Assertions.assertEquals("skanyk", model.zonePreferences().get(0).zone()); + Assertions.assertEquals(1937589018, model.zonePreferences().get(0).rank()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ZoneAllocationPolicy model + = new ZoneAllocationPolicy().withDistributionStrategy(DistributionStrategy.PRIORITIZED) + .withZonePreferences(Arrays.asList(new ZonePreference().withZone("skanyk").withRank(1937589018))); + model = BinaryData.fromObject(model).toObject(ZoneAllocationPolicy.class); + Assertions.assertEquals(DistributionStrategy.PRIORITIZED, model.distributionStrategy()); + Assertions.assertEquals("skanyk", model.zonePreferences().get(0).zone()); + Assertions.assertEquals(1937589018, model.zonePreferences().get(0).rank()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ZonePreferenceTests.java b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ZonePreferenceTests.java new file mode 100644 index 000000000000..8b091557ac33 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/src/test/java/com/azure/resourcemanager/compute/bulkactions/generated/ZonePreferenceTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.compute.bulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.compute.bulkactions.models.ZonePreference; +import org.junit.jupiter.api.Assertions; + +public final class ZonePreferenceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ZonePreference model + = BinaryData.fromString("{\"zone\":\"lcuiywgqywgndr\",\"rank\":1043685699}").toObject(ZonePreference.class); + Assertions.assertEquals("lcuiywgqywgndr", model.zone()); + Assertions.assertEquals(1043685699, model.rank()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ZonePreference model = new ZonePreference().withZone("lcuiywgqywgndr").withRank(1043685699); + model = BinaryData.fromObject(model).toObject(ZonePreference.class); + Assertions.assertEquals("lcuiywgqywgndr", model.zone()); + Assertions.assertEquals(1043685699, model.rank()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-bulkactions/tsp-location.yaml b/sdk/compute/azure-resourcemanager-compute-bulkactions/tsp-location.yaml index 4e4655e1df3a..a071281aebb9 100644 --- a/sdk/compute/azure-resourcemanager-compute-bulkactions/tsp-location.yaml +++ b/sdk/compute/azure-resourcemanager-compute-bulkactions/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/compute/resource-manager/Microsoft.Compute/Bulkactions -commit: f9e51702e77018f56bf335c340c9173087d354c5 +commit: 5c99613e9a48fae7fc92e8d7178c2124319fe954 repo: Azure/azure-rest-api-specs additionalDirectories: