diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 744c013ad2cc..bcd0db9cc207 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -518,6 +518,7 @@ com.azure.resourcemanager:azure-resourcemanager-computelimit;1.0.0-beta.1;1.0.0- com.azure.resourcemanager:azure-resourcemanager-containerregistry-tasks;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-virtualenclaves;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-edgeactions;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-computebulkactions;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 com.azure.v2:azure-client-sdk-parent;2.0.0-beta.2;2.0.0-beta.2 diff --git a/pom.xml b/pom.xml index 8be141c10ea9..32e5aa9a78fb 100644 --- a/pom.xml +++ b/pom.xml @@ -51,6 +51,7 @@ sdk/commerce sdk/communication sdk/compute + sdk/computebulkactions sdk/computefleet sdk/computelimit sdk/computeschedule diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/CHANGELOG.md b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/CHANGELOG.md new file mode 100644 index 000000000000..b5c4f5e3a6a2 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/CHANGELOG.md @@ -0,0 +1,9 @@ +# Release History + +## 1.0.0-beta.1 (2026-02-10) + +- Azure Resource Manager Compute BulkActions client library for Java. This package contains Microsoft Azure SDK for Compute BulkActions Management SDK. Microsoft.ComputeBulkActions Resource Provider management API. Package api-version 2026-02-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-computebulkactions Java SDK. + diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/README.md b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/README.md new file mode 100644 index 000000000000..b0e6f2cc072f --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Compute BulkActions client library for Java + +Azure Resource Manager Compute BulkActions client library for Java. + +This package contains Microsoft Azure SDK for Compute BulkActions Management SDK. Microsoft.ComputeBulkActions Resource Provider management API. Package api-version 2026-02-01-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 + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-computebulkactions;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-computebulkactions + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ComputeBulkActionsManager manager = ComputeBulkActionsManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/computebulkactions/azure-resourcemanager-computebulkactions/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/SAMPLE.md b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/SAMPLE.md new file mode 100644 index 000000000000..d26af4fe395c --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/SAMPLE.md @@ -0,0 +1,1070 @@ +# Code snippets and samples + + +## BulkActions + +- [Cancel](#bulkactions_cancel) +- [CreateOrUpdate](#bulkactions_createorupdate) +- [Delete](#bulkactions_delete) +- [Get](#bulkactions_get) +- [GetOperationStatus](#bulkactions_getoperationstatus) +- [ListByResourceGroup](#bulkactions_listbyresourcegroup) +- [ListBySubscription](#bulkactions_listbysubscription) +- [ListVirtualMachines](#bulkactions_listvirtualmachines) +- [VirtualMachinesCancelOperations](#bulkactions_virtualmachinescanceloperations) +- [VirtualMachinesExecuteCreate](#bulkactions_virtualmachinesexecutecreate) +- [VirtualMachinesExecuteDeallocate](#bulkactions_virtualmachinesexecutedeallocate) +- [VirtualMachinesExecuteDelete](#bulkactions_virtualmachinesexecutedelete) +- [VirtualMachinesExecuteHibernate](#bulkactions_virtualmachinesexecutehibernate) +- [VirtualMachinesExecuteStart](#bulkactions_virtualmachinesexecutestart) +- [VirtualMachinesGetOperationStatus](#bulkactions_virtualmachinesgetoperationstatus) + +## Operations + +- [List](#operations_list) +### BulkActions_Cancel + +```java +/** + * Samples for BulkActions Cancel. + */ +public final class BulkActionsCancelSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_Cancel_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_Cancel - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsCancelGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .cancel("rgcomputebulkactions", "eastus2euap", "3ec2ab23-9f13-4328-85c8-21928acbc7b8", + com.azure.core.util.Context.NONE); + } +} +``` + +### BulkActions_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.computebulkactions.models.AcceleratorManufacturer; +import com.azure.resourcemanager.computebulkactions.models.AcceleratorType; +import com.azure.resourcemanager.computebulkactions.models.AdditionalCapabilities; +import com.azure.resourcemanager.computebulkactions.models.AdditionalUnattendContent; +import com.azure.resourcemanager.computebulkactions.models.AdditionalUnattendContentComponentName; +import com.azure.resourcemanager.computebulkactions.models.AdditionalUnattendContentPassName; +import com.azure.resourcemanager.computebulkactions.models.AllInstancesDown; +import com.azure.resourcemanager.computebulkactions.models.AllocationStrategy; +import com.azure.resourcemanager.computebulkactions.models.ApiEntityReference; +import com.azure.resourcemanager.computebulkactions.models.ApplicationProfile; +import com.azure.resourcemanager.computebulkactions.models.ArchitectureType; +import com.azure.resourcemanager.computebulkactions.models.BootDiagnostics; +import com.azure.resourcemanager.computebulkactions.models.CachingTypes; +import com.azure.resourcemanager.computebulkactions.models.CapacityReservationProfile; +import com.azure.resourcemanager.computebulkactions.models.CapacityType; +import com.azure.resourcemanager.computebulkactions.models.ComputeProfile; +import com.azure.resourcemanager.computebulkactions.models.CpuManufacturer; +import com.azure.resourcemanager.computebulkactions.models.DataDisk; +import com.azure.resourcemanager.computebulkactions.models.DeleteOptions; +import com.azure.resourcemanager.computebulkactions.models.DiagnosticsProfile; +import com.azure.resourcemanager.computebulkactions.models.DiffDiskOptions; +import com.azure.resourcemanager.computebulkactions.models.DiffDiskPlacement; +import com.azure.resourcemanager.computebulkactions.models.DiffDiskSettings; +import com.azure.resourcemanager.computebulkactions.models.DiskControllerTypes; +import com.azure.resourcemanager.computebulkactions.models.DiskCreateOptionTypes; +import com.azure.resourcemanager.computebulkactions.models.DiskDeleteOptionTypes; +import com.azure.resourcemanager.computebulkactions.models.DiskDetachOptionTypes; +import com.azure.resourcemanager.computebulkactions.models.DiskEncryptionSetParameters; +import com.azure.resourcemanager.computebulkactions.models.DiskEncryptionSettings; +import com.azure.resourcemanager.computebulkactions.models.DomainNameLabelScopeTypes; +import com.azure.resourcemanager.computebulkactions.models.EncryptionIdentity; +import com.azure.resourcemanager.computebulkactions.models.EventGridAndResourceGraph; +import com.azure.resourcemanager.computebulkactions.models.EvictionPolicy; +import com.azure.resourcemanager.computebulkactions.models.HostEndpointSettings; +import com.azure.resourcemanager.computebulkactions.models.HyperVGeneration; +import com.azure.resourcemanager.computebulkactions.models.IPVersions; +import com.azure.resourcemanager.computebulkactions.models.ImageReference; +import com.azure.resourcemanager.computebulkactions.models.KeyVaultKeyReference; +import com.azure.resourcemanager.computebulkactions.models.KeyVaultSecretReference; +import com.azure.resourcemanager.computebulkactions.models.LaunchBulkInstancesOperationProperties; +import com.azure.resourcemanager.computebulkactions.models.LinuxConfiguration; +import com.azure.resourcemanager.computebulkactions.models.LinuxPatchAssessmentMode; +import com.azure.resourcemanager.computebulkactions.models.LinuxPatchSettings; +import com.azure.resourcemanager.computebulkactions.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.computebulkactions.models.LinuxVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.computebulkactions.models.LinuxVMGuestPatchMode; +import com.azure.resourcemanager.computebulkactions.models.LocalStorageDiskType; +import com.azure.resourcemanager.computebulkactions.models.ManagedDiskParameters; +import com.azure.resourcemanager.computebulkactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.computebulkactions.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.computebulkactions.models.Mode; +import com.azure.resourcemanager.computebulkactions.models.Modes; +import com.azure.resourcemanager.computebulkactions.models.NetworkApiVersion; +import com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceAuxiliarySku; +import com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceReference; +import com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceReferenceProperties; +import com.azure.resourcemanager.computebulkactions.models.NetworkProfile; +import com.azure.resourcemanager.computebulkactions.models.OSDisk; +import com.azure.resourcemanager.computebulkactions.models.OSImageNotificationProfile; +import com.azure.resourcemanager.computebulkactions.models.OSProfile; +import com.azure.resourcemanager.computebulkactions.models.OperatingSystemTypes; +import com.azure.resourcemanager.computebulkactions.models.PatchSettings; +import com.azure.resourcemanager.computebulkactions.models.Plan; +import com.azure.resourcemanager.computebulkactions.models.PriorityProfile; +import com.azure.resourcemanager.computebulkactions.models.ProtocolTypes; +import com.azure.resourcemanager.computebulkactions.models.ProxyAgentSettings; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSku; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSkuName; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSkuTier; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAllocationMethod; +import com.azure.resourcemanager.computebulkactions.models.RetryPolicy; +import com.azure.resourcemanager.computebulkactions.models.ScheduledEventsAdditionalPublishingTargets; +import com.azure.resourcemanager.computebulkactions.models.ScheduledEventsPolicy; +import com.azure.resourcemanager.computebulkactions.models.ScheduledEventsProfile; +import com.azure.resourcemanager.computebulkactions.models.SecurityEncryptionTypes; +import com.azure.resourcemanager.computebulkactions.models.SecurityProfile; +import com.azure.resourcemanager.computebulkactions.models.SecurityTypes; +import com.azure.resourcemanager.computebulkactions.models.SettingNames; +import com.azure.resourcemanager.computebulkactions.models.SshConfiguration; +import com.azure.resourcemanager.computebulkactions.models.SshPublicKey; +import com.azure.resourcemanager.computebulkactions.models.StorageAccountTypes; +import com.azure.resourcemanager.computebulkactions.models.StorageProfile; +import com.azure.resourcemanager.computebulkactions.models.TerminateNotificationProfile; +import com.azure.resourcemanager.computebulkactions.models.UefiSettings; +import com.azure.resourcemanager.computebulkactions.models.UserInitiatedReboot; +import com.azure.resourcemanager.computebulkactions.models.UserInitiatedRedeploy; +import com.azure.resourcemanager.computebulkactions.models.VMAttributeMinMaxDouble; +import com.azure.resourcemanager.computebulkactions.models.VMAttributeMinMaxInteger; +import com.azure.resourcemanager.computebulkactions.models.VMAttributeSupport; +import com.azure.resourcemanager.computebulkactions.models.VMAttributes; +import com.azure.resourcemanager.computebulkactions.models.VMCategory; +import com.azure.resourcemanager.computebulkactions.models.VMDiskSecurityProfile; +import com.azure.resourcemanager.computebulkactions.models.VMGalleryApplication; +import com.azure.resourcemanager.computebulkactions.models.VaultCertificate; +import com.azure.resourcemanager.computebulkactions.models.VaultSecretGroup; +import com.azure.resourcemanager.computebulkactions.models.VirtualHardDisk; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineExtension; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineExtensionProperties; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineIpTag; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceConfigurationProperties; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceDnsSettingsConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceIPConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceIPConfigurationProperties; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineProfile; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressConfigurationProperties; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressDnsSettingsConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineType; +import com.azure.resourcemanager.computebulkactions.models.VmSizeProfile; +import com.azure.resourcemanager.computebulkactions.models.WinRMConfiguration; +import com.azure.resourcemanager.computebulkactions.models.WinRMListener; +import com.azure.resourcemanager.computebulkactions.models.WindowsConfiguration; +import com.azure.resourcemanager.computebulkactions.models.WindowsPatchAssessmentMode; +import com.azure.resourcemanager.computebulkactions.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.computebulkactions.models.WindowsVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.computebulkactions.models.WindowsVMGuestPatchMode; +import com.azure.resourcemanager.computebulkactions.models.ZoneAllocationPolicy; +import com.azure.resourcemanager.computebulkactions.models.ZoneDistributionStrategy; +import com.azure.resourcemanager.computebulkactions.models.ZonePreference; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for BulkActions CreateOrUpdate. + */ +public final class BulkActionsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_CreateOrUpdate - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsCreateOrUpdateGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .define("3ec2ab23-9f13-4328-85c8-21928acbc7b8") + .withExistingLocation("rgcomputebulkactions", "eastus2euap") + .withProperties(new LaunchBulkInstancesOperationProperties().withCapacity(24) + .withCapacityType(CapacityType.VM) + .withPriorityProfile(new PriorityProfile().withType(VirtualMachineType.REGULAR) + .withMaxPricePerVM(21.0D) + .withEvictionPolicy(EvictionPolicy.DELETE) + .withAllocationStrategy(AllocationStrategy.LOWEST_PRICE)) + .withVmSizesProfile(Arrays.asList(new VmSizeProfile().withName("nolktwnfqdwikqiat").withRank(46189))) + .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("dmtpdlqphckngwjhvkucfze")) + .withExcludedVMSizes(Arrays.asList("yhjhharuhcyfxjnhxmflvsrdmei"))) + .withComputeProfile(new ComputeProfile() + .withVirtualMachineProfile(new VirtualMachineProfile() + .withScheduledEventsPolicy(new ScheduledEventsPolicy() + .withUserInitiatedRedeploy(new UserInitiatedRedeploy().withAutomaticallyApprove(true)) + .withUserInitiatedReboot(new UserInitiatedReboot().withAutomaticallyApprove(true)) + .withScheduledEventsAdditionalPublishingTargets( + new ScheduledEventsAdditionalPublishingTargets() + .withEventGridAndResourceGraph(new EventGridAndResourceGraph().withEnable(true) + .withScheduledEventsApiVersion("sbzjonqss"))) + .withAllInstancesDown(new AllInstancesDown().withAutomaticallyApprove(true))) + .withStorageProfile(new StorageProfile() + .withImageReference(new ImageReference().withId("iwqrkiccafacxfctrxb") + .withPublisher("edjvbyisusjhyvnzgyvhixmnfzzsy") + .withOffer("olkxwdozixpjkjuk") + .withSku("qmsq") + .withVersion("hruassyajrafmgmub") + .withSharedGalleryImageId("ahzweiez") + .withCommunityGalleryImageId("bysd")) + .withOsDisk(new OSDisk().withOsType(OperatingSystemTypes.WINDOWS) + .withEncryptionSettings(new DiskEncryptionSettings() + .withDiskEncryptionKey( + new KeyVaultSecretReference().withSecretUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("ioypuofzltakyfcomjwfkmyz"))) + .withKeyEncryptionKey(new KeyVaultKeyReference().withKeyUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("ioypuofzltakyfcomjwfkmyz"))) + .withEnabled(true)) + .withName("pccysrjeo") + .withVhd(new VirtualHardDisk().withUri("anvtwgmfthxmyhdnbvabmzyrknxwf")) + .withImage(new VirtualHardDisk().withUri("https://microsoft.com/a")) + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withDiffDiskSettings(new DiffDiskSettings().withOption(DiffDiskOptions.LOCAL) + .withPlacement(DiffDiskPlacement.CACHE_DISK)) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiskSizeGB(18) + .withManagedDisk(new ManagedDiskParameters().withId("wuqdcyunrkewr") + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet(new DiskEncryptionSetParameters().withId("thmks")) + .withSecurityProfile(new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet(new DiskEncryptionSetParameters().withId("thmks")))) + .withDeleteOption(DiskDeleteOptionTypes.DELETE)) + .withDataDisks(Arrays.asList(new DataDisk().withLun(1) + .withName("aq") + .withVhd(new VirtualHardDisk().withUri("anvtwgmfthxmyhdnbvabmzyrknxwf")) + .withImage(new VirtualHardDisk().withUri("anvtwgmfthxmyhdnbvabmzyrknxwf")) + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiskSizeGB(24) + .withManagedDisk(new ManagedDiskParameters().withId("zcoqnxlomkordbdolkxraqbwgsh") + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet(new DiskEncryptionSetParameters().withId("thmks")) + .withSecurityProfile(new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet(new DiskEncryptionSetParameters().withId("thmks")))) + .withSourceResource(new ApiEntityReference().withId("fpabycyqmkqqfdfrzqmnykmy")) + .withToBeDetached(true) + .withDetachOption(DiskDetachOptionTypes.FORCE_DETACH) + .withDeleteOption(DiskDeleteOptionTypes.DELETE))) + .withDiskControllerType(DiskControllerTypes.SCSI)) + .withAdditionalCapabilities( + new AdditionalCapabilities().withUltraSSDEnabled(true).withHibernationEnabled(true)) + .withOsProfile( + new OSProfile().withComputerName("jagkikqx") + .withAdminUsername("tjdagcdhlpihlhkrz") + .withAdminPassword("fakeTokenPlaceholder") + .withCustomData("jemgccf") + .withWindowsConfiguration( + new WindowsConfiguration().withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withTimeZone("kiibvtut") + .withAdditionalUnattendContent(Arrays.asList(new AdditionalUnattendContent() + .withPassName(AdditionalUnattendContentPassName.OOBE_SYSTEM) + .withComponentName( + AdditionalUnattendContentComponentName.MICROSOFT_WINDOWS_SHELL_SETUP) + .withSettingName(SettingNames.AUTO_LOGON) + .withContent("zdpsub"))) + .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("https://microsoft.com/a"))))) + .withLinuxConfiguration( + new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withPath("xyntsvqsiqsguyegxdvkmwhwz") + .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("obwiwwsgkdg")) + .withVaultCertificates(Arrays.asList(new VaultCertificate() + .withCertificateUrl("https://microsoft.com/agmunp") + .withCertificateStore("zxrjtvfmltdj"))))) + .withAllowExtensionOperations(true) + .withRequireGuestProvisionSignal(true)) + .withNetworkProfile(new NetworkProfile() + .withNetworkInterfaces(Arrays + .asList(new NetworkInterfaceReference().withId("bmlqsytfgnkwgkibsmsoeh") + .withProperties(new NetworkInterfaceReferenceProperties() + .withPrimary(true) + .withDeleteOption(DeleteOptions.DELETE)))) + .withNetworkApiVersion(NetworkApiVersion.TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE) + .withNetworkInterfaceConfigurations(Arrays + .asList(new VirtualMachineNetworkInterfaceConfiguration().withName("keppldrpxjgckgsmq") + .withProperties(new VirtualMachineNetworkInterfaceConfigurationProperties() + .withPrimary(true) + .withDeleteOption(DeleteOptions.DELETE) + .withEnableAcceleratedNetworking(true) + .withDisableTcpStateTracking(true) + .withEnableFpga(true) + .withEnableIPForwarding(true) + .withNetworkSecurityGroup(new SubResource().withId("obwiwwsgkdg")) + .withDnsSettings(new VirtualMachineNetworkInterfaceDnsSettingsConfiguration() + .withDnsServers(Arrays.asList("pnhvxygytoozxmkt"))) + .withIpConfigurations( + Arrays.asList(new VirtualMachineNetworkInterfaceIPConfiguration() + .withName("nqjufbencyticmohsdxogwiu") + .withProperties( + new VirtualMachineNetworkInterfaceIPConfigurationProperties() + .withSubnet( + new SubResource().withId("djtafmblvomuabwlhlyoxzgdkwkz")) + .withPrimary(true) + .withPublicIPAddressConfiguration( + new VirtualMachinePublicIPAddressConfiguration() + .withName("kgvjhctjspzldadcmtgsojglhmj") + .withProperties( + new VirtualMachinePublicIPAddressConfigurationProperties() + .withIdleTimeoutInMinutes(22) + .withDeleteOption(DeleteOptions.DELETE) + .withDnsSettings( + new VirtualMachinePublicIPAddressDnsSettingsConfiguration() + .withDomainNameLabel("vsvbcpusndz") + .withDomainNameLabelScope( + DomainNameLabelScopeTypes.TENANT_REUSE)) + .withIpTags( + Arrays.asList(new VirtualMachineIpTag() + .withIpTagType( + "hengwhngakjlsmhuegnlbtpmiihf") + .withTag("zlnuzjdbdnwbtep"))) + .withPublicIPPrefix( + new SubResource().withId("obwiwwsgkdg")) + .withPublicIPAddressVersion(IPVersions.IPV4) + .withPublicIPAllocationMethod( + PublicIPAllocationMethod.DYNAMIC)) + .withSku(new PublicIPAddressSku() + .withName(PublicIPAddressSkuName.BASIC) + .withTier(PublicIPAddressSkuTier.REGIONAL)) + .withTags(mapOf())) + .withPrivateIPAddressVersion(IPVersions.IPV4) + .withApplicationSecurityGroups( + Arrays.asList(new SubResource().withId("obwiwwsgkdg"))) + .withApplicationGatewayBackendAddressPools( + Arrays.asList(new SubResource().withId("obwiwwsgkdg"))) + .withLoadBalancerBackendAddressPools( + Arrays.asList(new SubResource().withId("obwiwwsgkdg")))))) + .withDscpConfiguration(new SubResource().withId("ioypuofzltakyfcomjwfkmyz")) + .withAuxiliaryMode(NetworkInterfaceAuxiliaryMode.NONE) + .withAuxiliarySku(NetworkInterfaceAuxiliarySku.NONE)) + .withTags(mapOf())))) + .withSecurityProfile(new SecurityProfile() + .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true)) + .withEncryptionAtHost(true) + .withSecurityType(SecurityTypes.TRUSTED_LAUNCH) + .withEncryptionIdentity(new EncryptionIdentity() + .withUserAssignedIdentityResourceId("wkiykqbrifryaruzokophodpjig")) + .withProxyAgentSettings(new ProxyAgentSettings().withEnabled(true) + .withMode(Mode.AUDIT) + .withKeyIncarnationId(17) + .withWireServer(new HostEndpointSettings().withMode(Modes.AUDIT) + .withInVMAccessControlProfileReferenceId("cubhuucckqkxbifmertj")) + .withImds(new HostEndpointSettings().withMode(Modes.AUDIT) + .withInVMAccessControlProfileReferenceId("cubhuucckqkxbifmertj")) + .withAddProxyAgentExtension(true))) + .withDiagnosticsProfile(new DiagnosticsProfile().withBootDiagnostics( + new BootDiagnostics().withEnabled(true).withStorageUri("https://microsoft.com/a"))) + .withLicenseType("iipnwxwfkfbbouzbwicqxnxicjz") + .withExtensionsTimeBudget("hvrimblcqujozpeurohjcn") + .withScheduledEventsProfile(new ScheduledEventsProfile() + .withTerminateNotificationProfile( + new TerminateNotificationProfile().withNotBeforeTimeout("ypif").withEnable(true)) + .withOsImageNotificationProfile( + new OSImageNotificationProfile().withNotBeforeTimeout("fztbudpjkicyigtvltlbszmivfbmb") + .withEnable(true))) + .withUserData("qcsgczwavs") + .withCapacityReservation(new CapacityReservationProfile() + .withCapacityReservationGroup(new SubResource().withId("obwiwwsgkdg"))) + .withApplicationProfile(new ApplicationProfile() + .withGalleryApplications(Arrays.asList(new VMGalleryApplication().withTags("qgn") + .withOrder(14) + .withPackageReferenceId("soddwzqduyolzz") + .withConfigurationReference("mddsvaruvzvblkafsotscupperzu") + .withTreatFailureAsDeploymentFailure(true) + .withEnableAutomaticUpgrade(true))))) + .withExtensions( + Arrays.asList(new VirtualMachineExtension().withName("gj") + .withProperties(new VirtualMachineExtensionProperties() + .withForceUpdateTag("mistpuvreycjbhahmcvgkjskeiop") + .withPublisher("rzsodcysrfxkrgnrjqlpfqe") + .withType("eyehf") + .withTypeHandlerVersion("wezzz") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings(mapOf()) + .withProtectedSettings(mapOf()) + .withSuppressFailures(true) + .withProtectedSettingsFromKeyVault( + new KeyVaultSecretReference().withSecretUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("ioypuofzltakyfcomjwfkmyz"))) + .withProvisionAfterExtensions(Arrays.asList("jddcihtuzdczkvkryhktzjlf"))))) + .withComputeApiVersion("bccikdfzgrygwpefvmvptutceg")) + .withZoneAllocationPolicy(new ZoneAllocationPolicy() + .withDistributionStrategy(ZoneDistributionStrategy.BEST_EFFORT_SINGLE_ZONE) + .withZonePreferences( + Arrays.asList(new ZonePreference().withZone("voauikerqjpeepaeaokkcybyjd").withRank(46292)))) + .withRetryPolicy(new RetryPolicy().withRetryCount(9).withRetryWindowInMinutes(21))) + .withZones(Arrays.asList("cyriutfcgydtaezeso")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf())) + .withPlan(new Plan().withName("owvrgjbxrkj") + .withPublisher("qhybdqbljmztcjujxal") + .withProduct("rlhap") + .withPromotionCode("fakeTokenPlaceholder") + .withVersion("ghmnlomqg")) + .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; + } +} +``` + +### BulkActions_Delete + +```java +/** + * Samples for BulkActions Delete. + */ +public final class BulkActionsDeleteSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_Delete - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsDeleteGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .delete("rgcomputebulkactions", "eastus2euap", "3ec2ab23-9f13-4328-85c8-21928acbc7b8", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### BulkActions_Get + +```java +/** + * Samples for BulkActions Get. + */ +public final class BulkActionsGetSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_Get_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_Get - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsGetGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .getWithResponse("rgcomputebulkactions", "eastus2euap", "3ec2ab23-9f13-4328-85c8-21928acbc7b8", + com.azure.core.util.Context.NONE); + } +} +``` + +### BulkActions_GetOperationStatus + +```java +/** + * Samples for BulkActions GetOperationStatus. + */ +public final class BulkActionsGetOperationStatusSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_GetOperationStatus_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_GetOperationStatus - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsGetOperationStatusGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .getOperationStatusWithResponse("eastus2euap", "2a3fce8e-874c-45f4-9d27-1a804f3b7a0f", + com.azure.core.util.Context.NONE); + } +} +``` + +### BulkActions_ListByResourceGroup + +```java +/** + * Samples for BulkActions ListByResourceGroup. + */ +public final class BulkActionsListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: BulkActions_ListByResourceGroup - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsListByResourceGroupGeneratedByMinimumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .listByResourceGroup("rgcomputebulkactions", "eastus2euap", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_ListByResourceGroup - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsListByResourceGroupGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .listByResourceGroup("rgcomputebulkactions", "eastus2euap", com.azure.core.util.Context.NONE); + } +} +``` + +### BulkActions_ListBySubscription + +```java +/** + * Samples for BulkActions ListBySubscription. + */ +public final class BulkActionsListBySubscriptionSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_ListBySubscription - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsListBySubscriptionGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions().listBySubscription("eastus2euap", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: BulkActions_ListBySubscription - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsListBySubscriptionGeneratedByMinimumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions().listBySubscription("eastus2euap", com.azure.core.util.Context.NONE); + } +} +``` + +### BulkActions_ListVirtualMachines + +```java +/** + * Samples for BulkActions ListVirtualMachines. + */ +public final class BulkActionsListVirtualMachinesSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_ListVirtualMachines_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_ListVirtualMachines - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsListVirtualMachinesGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .listVirtualMachines("rgcomputebulkactions", "eastus2euap", "50352BBD-59F1-4EE2-BA9C-A6E51B0B1B2B", + "elxwdbimmgosmnb", "nrcv", com.azure.core.util.Context.NONE); + } +} +``` + +### BulkActions_VirtualMachinesCancelOperations + +```java +import com.azure.resourcemanager.computebulkactions.models.CancelOperationsRequest; +import java.util.Arrays; + +/** + * Samples for BulkActions VirtualMachinesCancelOperations. + */ +public final class BulkActionsVirtualMachinesCancelOperationsSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesCancelOperations_MinimumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesCancelOperations_MaximumSet_Gen - generated by [MaximumSet] rule - + * generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void + bulkActionsVirtualMachinesCancelOperationsMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMinimumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesCancelOperationsWithResponse("eastus2euap", + new CancelOperationsRequest().withOperationIds(Arrays.asList("23480d2f-1dca-4610-afb4-dd25eec1f34r")) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesCancelOperations_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesCancelOperations_MaximumSet_Gen - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesCancelOperationsMaximumSetGenGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesCancelOperationsWithResponse("eastus2euap", + new CancelOperationsRequest().withOperationIds(Arrays.asList("2a3fce8e-874c-45f4-9d27-1a804f3b7a0f")) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), + com.azure.core.util.Context.NONE); + } +} +``` + +### BulkActions_VirtualMachinesExecuteCreate + +```java +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.ExecuteCreateRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.computebulkactions.models.ResourceProvisionPayload; +import com.azure.resourcemanager.computebulkactions.models.RetryPolicy; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for BulkActions VirtualMachinesExecuteCreate. + */ +public final class BulkActionsVirtualMachinesExecuteCreateSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesExecuteCreate_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesExecuteCreate_MaximumSet_Gen - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesExecuteCreateMaximumSetGenGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesExecuteCreateWithResponse("eastus2euap", new ExecuteCreateRequest() + .withResourceConfigParameters(new ResourceProvisionPayload().withBaseProfile(mapOf("resourcegroupName", + BinaryData.fromBytes("yourresourcegroup".getBytes(StandardCharsets.UTF_8)), "computeApiVersion", + BinaryData.fromBytes("2023-09-01".getBytes(StandardCharsets.UTF_8)), "properties", + BinaryData.fromBytes( + "{vmExtensions=[{name=Microsoft.Azure.Geneva.GenevaMonitoring, location=eastus2euap, properties={autoUpgradeMinorVersion=true, enableAutomaticUpgrade=true, suppressFailures=true, publisher=Microsoft.Azure.Geneva, type=GenevaMonitoring, typeHandlerVersion=2.0}}], hardwareProfile={vmSize=Standard_D2ads_v5}, storageProfile={imageReference={publisher=MicrosoftWindowsServer, offer=WindowsServer, sku=2022-datacenter-azure-edition, version=latest}, osDisk={osType=Windows, createOption=FromImage, caching=ReadWrite, managedDisk={storageAccountType=Standard_LRS}, deleteOption=Detach, diskSizeGB=127}, diskControllerType=SCSI}, networkProfile={networkInterfaceConfigurations=[{name=vmTest, properties={primary=true, enableIPForwarding=true, ipConfigurations=[{name=vmTest, properties={subnet={id=/subscriptions/264f0c8a-4d5f-496c-80df-b438624ce55f/resourceGroups/yourresourcegroup/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default}, primary=true, applicationGatewayBackendAddressPools=[], loadBalancerBackendAddressPools=[]}}]}}], networkApiVersion=2022-07-01}}" + .getBytes(StandardCharsets.UTF_8)))) + .withResourceOverrides(Arrays.asList(mapOf("name", + BinaryData.fromBytes("testvmtestTwo".getBytes(StandardCharsets.UTF_8)), "location", + BinaryData.fromBytes("eastus2euap".getBytes(StandardCharsets.UTF_8)), "properties", + BinaryData.fromBytes( + "{hardwareProfile={vmSize=Standard_D2ads_v5}, osProfile={computerName=testtestTwo, adminUsername=testUserName, adminPassword=YourStr0ngP@ssword123!, windowsConfiguration={provisionVmAgent=true, enableAutomaticUpdates=true, patchSettings={patchMode=AutomaticByPlatform, assessmentMode=ImageDefault}}}}" + .getBytes(StandardCharsets.UTF_8))))) + .withResourceCount(1)) + .withExecutionParameters(new ExecutionParameters() + .withRetryPolicy(new RetryPolicy().withRetryCount(5).withRetryWindowInMinutes(45))) + .withCorrelationId("7efcfae3-f50d-4323-9aba-1093a33368f8"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesExecuteCreate_MinimumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesExecuteCreate_MinimumSet_Gen - generated by [MinimumSet] rule - generated + * by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void + bulkActionsVirtualMachinesExecuteCreateMinimumSetGenGeneratedByMinimumSetRuleGeneratedByMinimumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesExecuteCreateWithResponse("eastus2euap", + new ExecuteCreateRequest() + .withResourceConfigParameters(new ResourceProvisionPayload().withResourceCount(1)) + .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; + } +} +``` + +### BulkActions_VirtualMachinesExecuteDeallocate + +```java +import com.azure.resourcemanager.computebulkactions.models.ExecuteDeallocateRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.computebulkactions.models.Resources; +import com.azure.resourcemanager.computebulkactions.models.RetryPolicy; +import java.util.Arrays; + +/** + * Samples for BulkActions VirtualMachinesExecuteDeallocate. + */ +public final class BulkActionsVirtualMachinesExecuteDeallocateSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesExecuteDeallocate_MinimumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesExecuteDeallocate_MinimumSet_Gen - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesExecuteDeallocateMinimumSetGenGeneratedByMinimumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesExecuteDeallocateWithResponse("eastus2euap", new ExecuteDeallocateRequest() + .withExecutionParameters(new ExecutionParameters()) + .withResources(new Resources().withIds(Arrays.asList( + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"))) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesExecuteDeallocate_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesExecuteDeallocate_MaximumSet_Gen - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesExecuteDeallocateMaximumSetGenGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesExecuteDeallocateWithResponse("eastus2euap", new ExecuteDeallocateRequest() + .withExecutionParameters(new ExecutionParameters() + .withRetryPolicy(new RetryPolicy().withRetryCount(4).withRetryWindowInMinutes(27))) + .withResources(new Resources().withIds(Arrays.asList( + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"))) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), com.azure.core.util.Context.NONE); + } +} +``` + +### BulkActions_VirtualMachinesExecuteDelete + +```java +import com.azure.resourcemanager.computebulkactions.models.ExecuteDeleteRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.computebulkactions.models.Resources; +import com.azure.resourcemanager.computebulkactions.models.RetryPolicy; +import java.util.Arrays; + +/** + * Samples for BulkActions VirtualMachinesExecuteDelete. + */ +public final class BulkActionsVirtualMachinesExecuteDeleteSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesExecuteDelete_MinimumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesExecuteDelete_MinimumSet_Gen - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesExecuteDeleteMinimumSetGenGeneratedByMinimumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesExecuteDeleteWithResponse("eastus2euap", new ExecuteDeleteRequest() + .withExecutionParameters(new ExecutionParameters()) + .withResources(new Resources().withIds(Arrays.asList( + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4"))) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesExecuteDelete_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesExecuteDelete_MaximumSet_Gen - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesExecuteDeleteMaximumSetGenGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesExecuteDeleteWithResponse("east2us2euap", new ExecuteDeleteRequest() + .withExecutionParameters(new ExecutionParameters() + .withRetryPolicy(new RetryPolicy().withRetryCount(2).withRetryWindowInMinutes(45))) + .withResources(new Resources().withIds(Arrays.asList( + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4"))) + .withCorrelationId("dfe927c5-16a6-40b7-a0f7-8524975ed642") + .withForceDeletion(true), com.azure.core.util.Context.NONE); + } +} +``` + +### BulkActions_VirtualMachinesExecuteHibernate + +```java +import com.azure.resourcemanager.computebulkactions.models.ExecuteHibernateRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.computebulkactions.models.Resources; +import com.azure.resourcemanager.computebulkactions.models.RetryPolicy; +import java.util.Arrays; + +/** + * Samples for BulkActions VirtualMachinesExecuteHibernate. + */ +public final class BulkActionsVirtualMachinesExecuteHibernateSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesExecuteHibernate_MinimumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesExecuteHibernate_MinimumSet_Gen - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesExecuteHibernateMinimumSetGenGeneratedByMinimumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesExecuteHibernateWithResponse("acuh", new ExecuteHibernateRequest() + .withExecutionParameters(new ExecutionParameters()) + .withResources(new Resources().withIds(Arrays.asList( + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"))) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesExecuteHibernate_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesExecuteHibernate_MaximumSet_Gen - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesExecuteHibernateMaximumSetGenGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesExecuteHibernateWithResponse("eastus2euap", new ExecuteHibernateRequest() + .withExecutionParameters(new ExecutionParameters() + .withRetryPolicy(new RetryPolicy().withRetryCount(5).withRetryWindowInMinutes(27))) + .withResources(new Resources().withIds(Arrays.asList( + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"))) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), com.azure.core.util.Context.NONE); + } +} +``` + +### BulkActions_VirtualMachinesExecuteStart + +```java +import com.azure.resourcemanager.computebulkactions.models.ExecuteStartRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.computebulkactions.models.Resources; +import com.azure.resourcemanager.computebulkactions.models.RetryPolicy; +import java.util.Arrays; + +/** + * Samples for BulkActions VirtualMachinesExecuteStart. + */ +public final class BulkActionsVirtualMachinesExecuteStartSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesExecuteStart_MinimumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesExecuteStart_MinimumSet_Gen - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesExecuteStartMinimumSetGenGeneratedByMinimumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesExecuteStartWithResponse("eastus2euap", new ExecuteStartRequest() + .withExecutionParameters(new ExecutionParameters()) + .withResources(new Resources().withIds(Arrays.asList( + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"))) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesExecuteStart_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesExecuteStart_MaximumSet_Gen - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesExecuteStartMaximumSetGenGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesExecuteStartWithResponse("eastus2euap", new ExecuteStartRequest() + .withExecutionParameters(new ExecutionParameters() + .withRetryPolicy(new RetryPolicy().withRetryCount(2).withRetryWindowInMinutes(27))) + .withResources(new Resources().withIds(Arrays.asList( + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"))) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), com.azure.core.util.Context.NONE); + } +} +``` + +### BulkActions_VirtualMachinesGetOperationStatus + +```java +import com.azure.resourcemanager.computebulkactions.models.GetOperationStatusRequest; +import java.util.Arrays; + +/** + * Samples for BulkActions VirtualMachinesGetOperationStatus. + */ +public final class BulkActionsVirtualMachinesGetOperationStatusSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesGetOperationStatus_MinimumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesGetOperationStatus_MinimumSet_Gen - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesGetOperationStatusMinimumSetGenGeneratedByMinimumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesGetOperationStatusWithResponse("eastus2euap", + new GetOperationStatusRequest().withOperationIds(Arrays.asList("23480d2f-1dca-4610-afb4-dd25eec1f34r")) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesGetOperationStatus_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesGetOperationStatus_MaximumSet_Gen - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesGetOperationStatusMaximumSetGenGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesGetOperationStatusWithResponse("eastus2euap", + new GetOperationStatusRequest().withOperationIds(Arrays.asList("2a3fce8e-874c-45f4-9d27-1a804f3b7a0f")) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2026-02-01-preview/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void operationsListGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-02-01-preview/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void operationsListGeneratedByMinimumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/pom.xml b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/pom.xml new file mode 100644 index 000000000000..5cf89bd6b054 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/pom.xml @@ -0,0 +1,74 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-computebulkactions + 1.0.0-beta.1 + 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. Microsoft.ComputeBulkActions Resource Provider management API. Package api-version 2026-02-01-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + + + + com.azure + azure-core + 1.57.1 + + + com.azure + azure-core-management + 1.19.3 + + + com.azure + azure-core-test + 1.27.0-beta.14 + test + + + com.azure + azure-identity + 1.18.2 + test + + + diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/ComputeBulkActionsManager.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/ComputeBulkActionsManager.java new file mode 100644 index 000000000000..3e9d9c568728 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/ComputeBulkActionsManager.java @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.computebulkactions.fluent.ComputeBulkActionsManagementClient; +import com.azure.resourcemanager.computebulkactions.implementation.BulkActionsImpl; +import com.azure.resourcemanager.computebulkactions.implementation.ComputeBulkActionsManagementClientBuilder; +import com.azure.resourcemanager.computebulkactions.implementation.OperationsImpl; +import com.azure.resourcemanager.computebulkactions.models.BulkActions; +import com.azure.resourcemanager.computebulkactions.models.Operations; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to ComputeBulkActionsManager. + * Microsoft.ComputeBulkActions Resource Provider management API. + */ +public final class ComputeBulkActionsManager { + private Operations operations; + + private BulkActions bulkActions; + + private final ComputeBulkActionsManagementClient clientObject; + + private ComputeBulkActionsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new ComputeBulkActionsManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Compute BulkActions service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Compute BulkActions service API instance. + */ + public static ComputeBulkActionsManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of Compute BulkActions service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Compute BulkActions service API instance. + */ + public static ComputeBulkActionsManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ComputeBulkActionsManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create ComputeBulkActionsManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ComputeBulkActionsManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-computebulkactions.properties"); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Compute BulkActions service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Compute BulkActions service API instance. + */ + public ComputeBulkActionsManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.computebulkactions") + .append("/") + .append(clientVersion); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new ComputeBulkActionsManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of BulkActions. It manages LocationBasedLaunchBulkInstancesOperation. + * + * @return Resource collection API of BulkActions. + */ + public BulkActions bulkActions() { + if (this.bulkActions == null) { + this.bulkActions = new BulkActionsImpl(clientObject.getBulkActions(), this); + } + return bulkActions; + } + + /** + * Gets wrapped service client ComputeBulkActionsManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + * + * @return Wrapped service client ComputeBulkActionsManagementClient. + */ + public ComputeBulkActionsManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/BulkActionsClient.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/BulkActionsClient.java new file mode 100644 index 000000000000..71948f51f04d --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/BulkActionsClient.java @@ -0,0 +1,574 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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.computebulkactions.fluent.models.CancelOperationsResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.CreateResourceOperationResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.DeallocateResourceOperationResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.DeleteResourceOperationResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.GetOperationStatusResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.HibernateResourceOperationResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.LocationBasedLaunchBulkInstancesOperationInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.StartResourceOperationResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.computebulkactions.models.CancelOperationsRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecuteCreateRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecuteDeallocateRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecuteDeleteRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecuteHibernateRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecuteStartRequest; +import com.azure.resourcemanager.computebulkactions.models.GetOperationStatusRequest; + +/** + * An instance of this class provides access to all the operations defined in BulkActionsClient. + */ +public interface BulkActionsClient { + /** + * 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 id 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 id, Context context); + + /** + * Get the status of a LaunchBulkInstancesOperation. + * + * @param location The location name. + * @param id 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 id); + + /** + * 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 type. + */ + @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 type. + */ + @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 type. + */ + @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 type. + */ + @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); + + /** + * VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 deallocate request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response virtualMachinesExecuteDeallocateWithResponse(String location, + ExecuteDeallocateRequest requestBody, Context context); + + /** + * VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 deallocate request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeallocateResourceOperationResponseInner virtualMachinesExecuteDeallocate(String location, + ExecuteDeallocateRequest requestBody); + + /** + * VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 Hibernate request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response virtualMachinesExecuteHibernateWithResponse(String location, + ExecuteHibernateRequest requestBody, Context context); + + /** + * VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 Hibernate request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HibernateResourceOperationResponseInner virtualMachinesExecuteHibernate(String location, + ExecuteHibernateRequest requestBody); + + /** + * VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered + * as soon as Computeschedule receives it. + * + * @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 start request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response virtualMachinesExecuteStartWithResponse(String location, + ExecuteStartRequest requestBody, Context context); + + /** + * VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered + * as soon as Computeschedule receives it. + * + * @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 start request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StartResourceOperationResponseInner virtualMachinesExecuteStart(String location, ExecuteStartRequest requestBody); + + /** + * VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 virtualMachinesExecuteCreateWithResponse(String location, + ExecuteCreateRequest requestBody, Context context); + + /** + * VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 virtualMachinesExecuteCreate(String location, + ExecuteCreateRequest requestBody); + + /** + * VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 delete request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response virtualMachinesExecuteDeleteWithResponse(String location, + ExecuteDeleteRequest requestBody, Context context); + + /** + * VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 delete request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeleteResourceOperationResponseInner virtualMachinesExecuteDelete(String location, + ExecuteDeleteRequest requestBody); + + /** + * VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines. + * + * @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 this is the response from a get operations status request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response virtualMachinesGetOperationStatusWithResponse(String location, + GetOperationStatusRequest requestBody, Context context); + + /** + * VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines. + * + * @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 this is the response from a get operations status request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GetOperationStatusResponseInner virtualMachinesGetOperationStatus(String location, + GetOperationStatusRequest requestBody); + + /** + * VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request. + * + * @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 this is the response from a cancel operations request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response virtualMachinesCancelOperationsWithResponse(String location, + CancelOperationsRequest requestBody, Context context); + + /** + * VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request. + * + * @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 this is the response from a cancel operations request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CancelOperationsResponseInner virtualMachinesCancelOperations(String location, CancelOperationsRequest requestBody); +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/ComputeBulkActionsManagementClient.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/ComputeBulkActionsManagementClient.java new file mode 100644 index 000000000000..8783f67cda22 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/ComputeBulkActionsManagementClient.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.computebulkactions.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for ComputeBulkActionsManagementClient class. + */ +public interface ComputeBulkActionsManagementClient { + /** + * Gets Service host. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the BulkActionsClient object to access its operations. + * + * @return the BulkActionsClient object. + */ + BulkActionsClient getBulkActions(); +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/OperationsClient.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/OperationsClient.java new file mode 100644 index 000000000000..a862a4b4b023 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/OperationsClient.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.computebulkactions.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/CancelOperationsResponseInner.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/CancelOperationsResponseInner.java new file mode 100644 index 000000000000..6a6105fc864e --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/CancelOperationsResponseInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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.computebulkactions.models.ResourceOperation; +import java.io.IOException; +import java.util.List; + +/** + * This is the response from a cancel operations request. + */ +@Immutable +public final class CancelOperationsResponseInner implements JsonSerializable { + /* + * An array of resource operations that were successfully cancelled + */ + private List results; + + /** + * Creates an instance of CancelOperationsResponseInner class. + */ + private CancelOperationsResponseInner() { + } + + /** + * Get the results property: An array of resource operations that were successfully cancelled. + * + * @return the results value. + */ + public List results() { + return this.results; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("results", this.results, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CancelOperationsResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CancelOperationsResponseInner 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 CancelOperationsResponseInner. + */ + public static CancelOperationsResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CancelOperationsResponseInner deserializedCancelOperationsResponseInner + = new CancelOperationsResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("results".equals(fieldName)) { + List results = reader.readArray(reader1 -> ResourceOperation.fromJson(reader1)); + deserializedCancelOperationsResponseInner.results = results; + } else { + reader.skipChildren(); + } + } + + return deserializedCancelOperationsResponseInner; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/CreateResourceOperationResponseInner.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/CreateResourceOperationResponseInner.java new file mode 100644 index 000000000000..131c152f31f9 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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.computebulkactions.models.ResourceOperation; +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 request eg virtual machines + */ + private String type; + + /* + * The location of the request eg westus + */ + private String location; + + /* + * The results from the request. + */ + 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 request eg virtual machines. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the location property: The location of the request eg westus. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the results property: The results from the request. + * + * @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 -> ResourceOperation.fromJson(reader1)); + deserializedCreateResourceOperationResponseInner.results = results; + } else { + reader.skipChildren(); + } + } + + return deserializedCreateResourceOperationResponseInner; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/DeallocateResourceOperationResponseInner.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/DeallocateResourceOperationResponseInner.java new file mode 100644 index 000000000000..0bbc4ea20486 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/DeallocateResourceOperationResponseInner.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.computebulkactions.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.computebulkactions.models.ResourceOperation; +import java.io.IOException; +import java.util.List; + +/** + * The response from a deallocate request. + */ +@Immutable +public final class DeallocateResourceOperationResponseInner + implements JsonSerializable { + /* + * The description of the operation response + */ + private String description; + + /* + * The type of resources used in the request eg virtual machines + */ + private String type; + + /* + * The location of the request eg westus + */ + private String location; + + /* + * The results from the request. + */ + private List results; + + /** + * Creates an instance of DeallocateResourceOperationResponseInner class. + */ + private DeallocateResourceOperationResponseInner() { + } + + /** + * 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 request eg virtual machines. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the location property: The location of the request eg westus. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the results property: The results from the request. + * + * @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 DeallocateResourceOperationResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeallocateResourceOperationResponseInner 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 DeallocateResourceOperationResponseInner. + */ + public static DeallocateResourceOperationResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeallocateResourceOperationResponseInner deserializedDeallocateResourceOperationResponseInner + = new DeallocateResourceOperationResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedDeallocateResourceOperationResponseInner.description = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDeallocateResourceOperationResponseInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedDeallocateResourceOperationResponseInner.location = reader.getString(); + } else if ("results".equals(fieldName)) { + List results = reader.readArray(reader1 -> ResourceOperation.fromJson(reader1)); + deserializedDeallocateResourceOperationResponseInner.results = results; + } else { + reader.skipChildren(); + } + } + + return deserializedDeallocateResourceOperationResponseInner; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/DeleteResourceOperationResponseInner.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/DeleteResourceOperationResponseInner.java new file mode 100644 index 000000000000..d074d9cf6fc4 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/DeleteResourceOperationResponseInner.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.computebulkactions.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.computebulkactions.models.ResourceOperation; +import java.io.IOException; +import java.util.List; + +/** + * The response from a delete request. + */ +@Immutable +public final class DeleteResourceOperationResponseInner + implements JsonSerializable { + /* + * The description of the operation response + */ + private String description; + + /* + * The type of resources used in the request eg virtual machines + */ + private String type; + + /* + * The location of the request eg westus + */ + private String location; + + /* + * The results from the request. + */ + private List results; + + /** + * Creates an instance of DeleteResourceOperationResponseInner class. + */ + private DeleteResourceOperationResponseInner() { + } + + /** + * 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 request eg virtual machines. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the location property: The location of the request eg westus. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the results property: The results from the request. + * + * @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 DeleteResourceOperationResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeleteResourceOperationResponseInner 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 DeleteResourceOperationResponseInner. + */ + public static DeleteResourceOperationResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeleteResourceOperationResponseInner deserializedDeleteResourceOperationResponseInner + = new DeleteResourceOperationResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedDeleteResourceOperationResponseInner.description = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDeleteResourceOperationResponseInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedDeleteResourceOperationResponseInner.location = reader.getString(); + } else if ("results".equals(fieldName)) { + List results = reader.readArray(reader1 -> ResourceOperation.fromJson(reader1)); + deserializedDeleteResourceOperationResponseInner.results = results; + } else { + reader.skipChildren(); + } + } + + return deserializedDeleteResourceOperationResponseInner; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/GetOperationStatusResponseInner.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/GetOperationStatusResponseInner.java new file mode 100644 index 000000000000..6d13af88838c --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/GetOperationStatusResponseInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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.computebulkactions.models.ResourceOperation; +import java.io.IOException; +import java.util.List; + +/** + * This is the response from a get operations status request. + */ +@Immutable +public final class GetOperationStatusResponseInner implements JsonSerializable { + /* + * An array of resource operations based on their operation ids + */ + private List results; + + /** + * Creates an instance of GetOperationStatusResponseInner class. + */ + private GetOperationStatusResponseInner() { + } + + /** + * Get the results property: An array of resource operations based on their operation ids. + * + * @return the results value. + */ + public List results() { + return this.results; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("results", this.results, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetOperationStatusResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetOperationStatusResponseInner 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 GetOperationStatusResponseInner. + */ + public static GetOperationStatusResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetOperationStatusResponseInner deserializedGetOperationStatusResponseInner + = new GetOperationStatusResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("results".equals(fieldName)) { + List results = reader.readArray(reader1 -> ResourceOperation.fromJson(reader1)); + deserializedGetOperationStatusResponseInner.results = results; + } else { + reader.skipChildren(); + } + } + + return deserializedGetOperationStatusResponseInner; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/HibernateResourceOperationResponseInner.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/HibernateResourceOperationResponseInner.java new file mode 100644 index 000000000000..ce309cfaa076 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/HibernateResourceOperationResponseInner.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.computebulkactions.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.computebulkactions.models.ResourceOperation; +import java.io.IOException; +import java.util.List; + +/** + * The response from a Hibernate request. + */ +@Immutable +public final class HibernateResourceOperationResponseInner + implements JsonSerializable { + /* + * The description of the operation response + */ + private String description; + + /* + * The type of resources used in the request eg virtual machines + */ + private String type; + + /* + * The location of the request eg westus + */ + private String location; + + /* + * The results from the request. + */ + private List results; + + /** + * Creates an instance of HibernateResourceOperationResponseInner class. + */ + private HibernateResourceOperationResponseInner() { + } + + /** + * 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 request eg virtual machines. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the location property: The location of the request eg westus. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the results property: The results from the request. + * + * @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 HibernateResourceOperationResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HibernateResourceOperationResponseInner 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 HibernateResourceOperationResponseInner. + */ + public static HibernateResourceOperationResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HibernateResourceOperationResponseInner deserializedHibernateResourceOperationResponseInner + = new HibernateResourceOperationResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedHibernateResourceOperationResponseInner.description = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHibernateResourceOperationResponseInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedHibernateResourceOperationResponseInner.location = reader.getString(); + } else if ("results".equals(fieldName)) { + List results = reader.readArray(reader1 -> ResourceOperation.fromJson(reader1)); + deserializedHibernateResourceOperationResponseInner.results = results; + } else { + reader.skipChildren(); + } + } + + return deserializedHibernateResourceOperationResponseInner; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/LocationBasedLaunchBulkInstancesOperationInner.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/LocationBasedLaunchBulkInstancesOperationInner.java new file mode 100644 index 000000000000..e71f9edbfed7 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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.computebulkactions.models.LaunchBulkInstancesOperationProperties; +import com.azure.resourcemanager.computebulkactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.computebulkactions.models.Plan; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Location based type. + */ +@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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/OperationInner.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/OperationInner.java new file mode 100644 index 000000000000..144886359139 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/OperationInner.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.computebulkactions.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.computebulkactions.models.ActionType; +import com.azure.resourcemanager.computebulkactions.models.OperationDisplay; +import com.azure.resourcemanager.computebulkactions.models.Origin; +import java.io.IOException; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Immutable +public final class OperationInner implements JsonSerializable { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + + /** + * Creates an instance of OperationInner class. + */ + private OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner 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 OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/OperationStatusResultInner.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/OperationStatusResultInner.java new file mode 100644 index 000000000000..b2d41fb025ba --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/StartResourceOperationResponseInner.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/StartResourceOperationResponseInner.java new file mode 100644 index 000000000000..3c5b639241da --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/StartResourceOperationResponseInner.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.computebulkactions.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.computebulkactions.models.ResourceOperation; +import java.io.IOException; +import java.util.List; + +/** + * The response from a start request. + */ +@Immutable +public final class StartResourceOperationResponseInner + implements JsonSerializable { + /* + * The description of the operation response + */ + private String description; + + /* + * The type of resources used in the request eg virtual machines + */ + private String type; + + /* + * The location of the request eg westus + */ + private String location; + + /* + * The results from the request. + */ + private List results; + + /** + * Creates an instance of StartResourceOperationResponseInner class. + */ + private StartResourceOperationResponseInner() { + } + + /** + * 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 request eg virtual machines. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the location property: The location of the request eg westus. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the results property: The results from the request. + * + * @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 StartResourceOperationResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StartResourceOperationResponseInner 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 StartResourceOperationResponseInner. + */ + public static StartResourceOperationResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StartResourceOperationResponseInner deserializedStartResourceOperationResponseInner + = new StartResourceOperationResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedStartResourceOperationResponseInner.description = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedStartResourceOperationResponseInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedStartResourceOperationResponseInner.location = reader.getString(); + } else if ("results".equals(fieldName)) { + List results = reader.readArray(reader1 -> ResourceOperation.fromJson(reader1)); + deserializedStartResourceOperationResponseInner.results = results; + } else { + reader.skipChildren(); + } + } + + return deserializedStartResourceOperationResponseInner; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/VirtualMachineInner.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/VirtualMachineInner.java new file mode 100644 index 000000000000..8325bd9652f4 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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.computebulkactions.models.ApiError; +import com.azure.resourcemanager.computebulkactions.models.VMOperationStatus; +import java.io.IOException; + +/** + * An instant Fleet's virtual machine. + */ +@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; + + /* + * This represents the operationStatus of the virtual machine in response to the last operation that was performed + * on it by Azure Fleet resource. + */ + 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: This represents the operationStatus of the virtual machine in response to the + * last operation that was performed on it by Azure Fleet resource. + * + * @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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/package-info.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/package-info.java new file mode 100644 index 000000000000..4c4d8a2c5aae --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the inner data models for ComputeBulkActions. + * Microsoft.ComputeBulkActions Resource Provider management API. + */ +package com.azure.resourcemanager.computebulkactions.fluent.models; diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/package-info.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/package-info.java new file mode 100644 index 000000000000..4d0d1b8b4a96 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the service clients for ComputeBulkActions. + * Microsoft.ComputeBulkActions Resource Provider management API. + */ +package com.azure.resourcemanager.computebulkactions.fluent; diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/BulkActionsClientImpl.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/BulkActionsClientImpl.java new file mode 100644 index 000000000000..74df4dc9a250 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/BulkActionsClientImpl.java @@ -0,0 +1,2269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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.computebulkactions.fluent.BulkActionsClient; +import com.azure.resourcemanager.computebulkactions.fluent.models.CancelOperationsResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.CreateResourceOperationResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.DeallocateResourceOperationResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.DeleteResourceOperationResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.GetOperationStatusResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.HibernateResourceOperationResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.LocationBasedLaunchBulkInstancesOperationInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.StartResourceOperationResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.computebulkactions.implementation.models.LaunchBulkInstancesOperationListResult; +import com.azure.resourcemanager.computebulkactions.implementation.models.VirtualMachineListResult; +import com.azure.resourcemanager.computebulkactions.models.CancelOperationsRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecuteCreateRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecuteDeallocateRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecuteDeleteRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecuteHibernateRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecuteStartRequest; +import com.azure.resourcemanager.computebulkactions.models.GetOperationStatusRequest; +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 BulkActionsClient. + */ +public final class BulkActionsClientImpl implements BulkActionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final BulkActionsService service; + + /** + * The service client containing this operation class. + */ + private final ComputeBulkActionsManagementClientImpl client; + + /** + * Initializes an instance of BulkActionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BulkActionsClientImpl(ComputeBulkActionsManagementClientImpl client) { + this.service + = RestProxy.create(BulkActionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeBulkActionsManagementClientBulkActions to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ComputeBulkActionsManagementClientBulkActions") + public interface BulkActionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeBulkActions/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.ComputeBulkActions/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.ComputeBulkActions/locations/{location}/operations/{id}") + @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("id") String id, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/operations/{id}") + @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("id") String id, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeBulkActions/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.ComputeBulkActions/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.ComputeBulkActions/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.ComputeBulkActions/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.ComputeBulkActions/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.ComputeBulkActions/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.ComputeBulkActions/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.ComputeBulkActions/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.ComputeBulkActions/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.ComputeBulkActions/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.ComputeBulkActions/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.ComputeBulkActions/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); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesExecuteDeallocate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> virtualMachinesExecuteDeallocate( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExecuteDeallocateRequest requestBody, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesExecuteDeallocate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response virtualMachinesExecuteDeallocateSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExecuteDeallocateRequest requestBody, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesExecuteHibernate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> virtualMachinesExecuteHibernate( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExecuteHibernateRequest requestBody, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesExecuteHibernate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response virtualMachinesExecuteHibernateSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExecuteHibernateRequest requestBody, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesExecuteStart") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> virtualMachinesExecuteStart( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExecuteStartRequest requestBody, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesExecuteStart") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response virtualMachinesExecuteStartSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExecuteStartRequest requestBody, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesExecuteCreate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> virtualMachinesExecuteCreate( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExecuteCreateRequest requestBody, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesExecuteCreate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response virtualMachinesExecuteCreateSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExecuteCreateRequest requestBody, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesExecuteDelete") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> virtualMachinesExecuteDelete( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExecuteDeleteRequest requestBody, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesExecuteDelete") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response virtualMachinesExecuteDeleteSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExecuteDeleteRequest requestBody, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesGetOperationStatus") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> virtualMachinesGetOperationStatus( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") GetOperationStatusRequest requestBody, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesGetOperationStatus") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response virtualMachinesGetOperationStatusSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") GetOperationStatusRequest requestBody, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesCancelOperations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> virtualMachinesCancelOperations( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CancelOperationsRequest requestBody, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesCancelOperations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response virtualMachinesCancelOperationsSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CancelOperationsRequest requestBody, 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 id 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 id) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getOperationStatus(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, id, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the status of a LaunchBulkInstancesOperation. + * + * @param location The location name. + * @param id 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 id) { + return getOperationStatusWithResponseAsync(location, id).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the status of a LaunchBulkInstancesOperation. + * + * @param location The location name. + * @param id 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 id, + Context context) { + final String accept = "application/json"; + return service.getOperationStatusSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, id, accept, context); + } + + /** + * Get the status of a LaunchBulkInstancesOperation. + * + * @param location The location name. + * @param id 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 id) { + return getOperationStatusWithResponse(location, id, 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 type 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 type 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 type 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 type. + */ + @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 type. + */ + @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 type. + */ + @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 type 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 type. + */ + @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 type. + */ + @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)); + } + + /** + * VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 deallocate request along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + virtualMachinesExecuteDeallocateWithResponseAsync(String location, ExecuteDeallocateRequest requestBody) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.virtualMachinesExecuteDeallocate(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, contentType, accept, + requestBody, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 deallocate request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono virtualMachinesExecuteDeallocateAsync(String location, + ExecuteDeallocateRequest requestBody) { + return virtualMachinesExecuteDeallocateWithResponseAsync(location, requestBody) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 deallocate request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response virtualMachinesExecuteDeallocateWithResponse( + String location, ExecuteDeallocateRequest requestBody, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.virtualMachinesExecuteDeallocateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, requestBody, context); + } + + /** + * VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 deallocate request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeallocateResourceOperationResponseInner virtualMachinesExecuteDeallocate(String location, + ExecuteDeallocateRequest requestBody) { + return virtualMachinesExecuteDeallocateWithResponse(location, requestBody, Context.NONE).getValue(); + } + + /** + * VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 Hibernate request along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + virtualMachinesExecuteHibernateWithResponseAsync(String location, ExecuteHibernateRequest requestBody) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.virtualMachinesExecuteHibernate(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, contentType, accept, + requestBody, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 Hibernate request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono virtualMachinesExecuteHibernateAsync(String location, + ExecuteHibernateRequest requestBody) { + return virtualMachinesExecuteHibernateWithResponseAsync(location, requestBody) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 Hibernate request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response virtualMachinesExecuteHibernateWithResponse( + String location, ExecuteHibernateRequest requestBody, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.virtualMachinesExecuteHibernateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, requestBody, context); + } + + /** + * VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 Hibernate request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HibernateResourceOperationResponseInner virtualMachinesExecuteHibernate(String location, + ExecuteHibernateRequest requestBody) { + return virtualMachinesExecuteHibernateWithResponse(location, requestBody, Context.NONE).getValue(); + } + + /** + * VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered + * as soon as Computeschedule receives it. + * + * @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 start request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + virtualMachinesExecuteStartWithResponseAsync(String location, ExecuteStartRequest requestBody) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.virtualMachinesExecuteStart(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, requestBody, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered + * as soon as Computeschedule receives it. + * + * @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 start request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono virtualMachinesExecuteStartAsync(String location, + ExecuteStartRequest requestBody) { + return virtualMachinesExecuteStartWithResponseAsync(location, requestBody) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered + * as soon as Computeschedule receives it. + * + * @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 start request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response virtualMachinesExecuteStartWithResponse(String location, + ExecuteStartRequest requestBody, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.virtualMachinesExecuteStartSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, requestBody, context); + } + + /** + * VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered + * as soon as Computeschedule receives it. + * + * @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 start request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StartResourceOperationResponseInner virtualMachinesExecuteStart(String location, + ExecuteStartRequest requestBody) { + return virtualMachinesExecuteStartWithResponse(location, requestBody, Context.NONE).getValue(); + } + + /** + * VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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> + virtualMachinesExecuteCreateWithResponseAsync(String location, ExecuteCreateRequest requestBody) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.virtualMachinesExecuteCreate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, requestBody, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 virtualMachinesExecuteCreateAsync(String location, + ExecuteCreateRequest requestBody) { + return virtualMachinesExecuteCreateWithResponseAsync(location, requestBody) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 virtualMachinesExecuteCreateWithResponse(String location, + ExecuteCreateRequest requestBody, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.virtualMachinesExecuteCreateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, requestBody, context); + } + + /** + * VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 virtualMachinesExecuteCreate(String location, + ExecuteCreateRequest requestBody) { + return virtualMachinesExecuteCreateWithResponse(location, requestBody, Context.NONE).getValue(); + } + + /** + * VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 delete request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + virtualMachinesExecuteDeleteWithResponseAsync(String location, ExecuteDeleteRequest requestBody) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.virtualMachinesExecuteDelete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, requestBody, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 delete request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono virtualMachinesExecuteDeleteAsync(String location, + ExecuteDeleteRequest requestBody) { + return virtualMachinesExecuteDeleteWithResponseAsync(location, requestBody) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 delete request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response virtualMachinesExecuteDeleteWithResponse(String location, + ExecuteDeleteRequest requestBody, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.virtualMachinesExecuteDeleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, requestBody, context); + } + + /** + * VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 delete request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeleteResourceOperationResponseInner virtualMachinesExecuteDelete(String location, + ExecuteDeleteRequest requestBody) { + return virtualMachinesExecuteDeleteWithResponse(location, requestBody, Context.NONE).getValue(); + } + + /** + * VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines. + * + * @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 this is the response from a get operations status request along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + virtualMachinesGetOperationStatusWithResponseAsync(String location, GetOperationStatusRequest requestBody) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.virtualMachinesGetOperationStatus(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, contentType, accept, + requestBody, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines. + * + * @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 this is the response from a get operations status request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono virtualMachinesGetOperationStatusAsync(String location, + GetOperationStatusRequest requestBody) { + return virtualMachinesGetOperationStatusWithResponseAsync(location, requestBody) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines. + * + * @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 this is the response from a get operations status request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response virtualMachinesGetOperationStatusWithResponse(String location, + GetOperationStatusRequest requestBody, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.virtualMachinesGetOperationStatusSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, requestBody, context); + } + + /** + * VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines. + * + * @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 this is the response from a get operations status request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GetOperationStatusResponseInner virtualMachinesGetOperationStatus(String location, + GetOperationStatusRequest requestBody) { + return virtualMachinesGetOperationStatusWithResponse(location, requestBody, Context.NONE).getValue(); + } + + /** + * VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request. + * + * @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 this is the response from a cancel operations request along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + virtualMachinesCancelOperationsWithResponseAsync(String location, CancelOperationsRequest requestBody) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.virtualMachinesCancelOperations(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, contentType, accept, + requestBody, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request. + * + * @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 this is the response from a cancel operations request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono virtualMachinesCancelOperationsAsync(String location, + CancelOperationsRequest requestBody) { + return virtualMachinesCancelOperationsWithResponseAsync(location, requestBody) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request. + * + * @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 this is the response from a cancel operations request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response virtualMachinesCancelOperationsWithResponse(String location, + CancelOperationsRequest requestBody, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.virtualMachinesCancelOperationsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, requestBody, context); + } + + /** + * VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request. + * + * @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 this is the response from a cancel operations request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CancelOperationsResponseInner virtualMachinesCancelOperations(String location, + CancelOperationsRequest requestBody) { + return virtualMachinesCancelOperationsWithResponse(location, requestBody, 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 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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/BulkActionsImpl.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/BulkActionsImpl.java new file mode 100644 index 000000000000..876bcfd8ecd8 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/BulkActionsImpl.java @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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.computebulkactions.fluent.BulkActionsClient; +import com.azure.resourcemanager.computebulkactions.fluent.models.CancelOperationsResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.CreateResourceOperationResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.DeallocateResourceOperationResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.DeleteResourceOperationResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.GetOperationStatusResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.HibernateResourceOperationResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.LocationBasedLaunchBulkInstancesOperationInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.StartResourceOperationResponseInner; +import com.azure.resourcemanager.computebulkactions.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.computebulkactions.models.BulkActions; +import com.azure.resourcemanager.computebulkactions.models.CancelOperationsRequest; +import com.azure.resourcemanager.computebulkactions.models.CancelOperationsResponse; +import com.azure.resourcemanager.computebulkactions.models.CreateResourceOperationResponse; +import com.azure.resourcemanager.computebulkactions.models.DeallocateResourceOperationResponse; +import com.azure.resourcemanager.computebulkactions.models.DeleteResourceOperationResponse; +import com.azure.resourcemanager.computebulkactions.models.ExecuteCreateRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecuteDeallocateRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecuteDeleteRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecuteHibernateRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecuteStartRequest; +import com.azure.resourcemanager.computebulkactions.models.GetOperationStatusRequest; +import com.azure.resourcemanager.computebulkactions.models.GetOperationStatusResponse; +import com.azure.resourcemanager.computebulkactions.models.HibernateResourceOperationResponse; +import com.azure.resourcemanager.computebulkactions.models.LocationBasedLaunchBulkInstancesOperation; +import com.azure.resourcemanager.computebulkactions.models.OperationStatusResult; +import com.azure.resourcemanager.computebulkactions.models.StartResourceOperationResponse; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachine; + +public final class BulkActionsImpl implements BulkActions { + private static final ClientLogger LOGGER = new ClientLogger(BulkActionsImpl.class); + + private final BulkActionsClient innerClient; + + private final com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager serviceManager; + + public BulkActionsImpl(BulkActionsClient innerClient, + com.azure.resourcemanager.computebulkactions.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); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LocationBasedLaunchBulkInstancesOperationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 id, Context context) { + Response inner + = this.serviceClient().getOperationStatusWithResponse(location, id, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OperationStatusResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OperationStatusResult getOperationStatus(String location, String id) { + OperationStatusResultInner inner = this.serviceClient().getOperationStatus(location, id); + 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 Response virtualMachinesExecuteDeallocateWithResponse(String location, + ExecuteDeallocateRequest requestBody, Context context) { + Response inner + = this.serviceClient().virtualMachinesExecuteDeallocateWithResponse(location, requestBody, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DeallocateResourceOperationResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeallocateResourceOperationResponse virtualMachinesExecuteDeallocate(String location, + ExecuteDeallocateRequest requestBody) { + DeallocateResourceOperationResponseInner inner + = this.serviceClient().virtualMachinesExecuteDeallocate(location, requestBody); + if (inner != null) { + return new DeallocateResourceOperationResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response virtualMachinesExecuteHibernateWithResponse(String location, + ExecuteHibernateRequest requestBody, Context context) { + Response inner + = this.serviceClient().virtualMachinesExecuteHibernateWithResponse(location, requestBody, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HibernateResourceOperationResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public HibernateResourceOperationResponse virtualMachinesExecuteHibernate(String location, + ExecuteHibernateRequest requestBody) { + HibernateResourceOperationResponseInner inner + = this.serviceClient().virtualMachinesExecuteHibernate(location, requestBody); + if (inner != null) { + return new HibernateResourceOperationResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response virtualMachinesExecuteStartWithResponse(String location, + ExecuteStartRequest requestBody, Context context) { + Response inner + = this.serviceClient().virtualMachinesExecuteStartWithResponse(location, requestBody, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new StartResourceOperationResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StartResourceOperationResponse virtualMachinesExecuteStart(String location, + ExecuteStartRequest requestBody) { + StartResourceOperationResponseInner inner + = this.serviceClient().virtualMachinesExecuteStart(location, requestBody); + if (inner != null) { + return new StartResourceOperationResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response virtualMachinesExecuteCreateWithResponse(String location, + ExecuteCreateRequest requestBody, Context context) { + Response inner + = this.serviceClient().virtualMachinesExecuteCreateWithResponse(location, requestBody, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CreateResourceOperationResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CreateResourceOperationResponse virtualMachinesExecuteCreate(String location, + ExecuteCreateRequest requestBody) { + CreateResourceOperationResponseInner inner + = this.serviceClient().virtualMachinesExecuteCreate(location, requestBody); + if (inner != null) { + return new CreateResourceOperationResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response virtualMachinesExecuteDeleteWithResponse(String location, + ExecuteDeleteRequest requestBody, Context context) { + Response inner + = this.serviceClient().virtualMachinesExecuteDeleteWithResponse(location, requestBody, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DeleteResourceOperationResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeleteResourceOperationResponse virtualMachinesExecuteDelete(String location, + ExecuteDeleteRequest requestBody) { + DeleteResourceOperationResponseInner inner + = this.serviceClient().virtualMachinesExecuteDelete(location, requestBody); + if (inner != null) { + return new DeleteResourceOperationResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response virtualMachinesGetOperationStatusWithResponse(String location, + GetOperationStatusRequest requestBody, Context context) { + Response inner + = this.serviceClient().virtualMachinesGetOperationStatusWithResponse(location, requestBody, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GetOperationStatusResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GetOperationStatusResponse virtualMachinesGetOperationStatus(String location, + GetOperationStatusRequest requestBody) { + GetOperationStatusResponseInner inner + = this.serviceClient().virtualMachinesGetOperationStatus(location, requestBody); + if (inner != null) { + return new GetOperationStatusResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response virtualMachinesCancelOperationsWithResponse(String location, + CancelOperationsRequest requestBody, Context context) { + Response inner + = this.serviceClient().virtualMachinesCancelOperationsWithResponse(location, requestBody, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CancelOperationsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CancelOperationsResponse virtualMachinesCancelOperations(String location, + CancelOperationsRequest requestBody) { + CancelOperationsResponseInner inner + = this.serviceClient().virtualMachinesCancelOperations(location, requestBody); + if (inner != null) { + return new CancelOperationsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + 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 BulkActionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager() { + return this.serviceManager; + } + + public LocationBasedLaunchBulkInstancesOperationImpl define(String name) { + return new LocationBasedLaunchBulkInstancesOperationImpl(name, this.manager()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/CancelOperationsResponseImpl.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/CancelOperationsResponseImpl.java new file mode 100644 index 000000000000..61ae187d8303 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/CancelOperationsResponseImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.implementation; + +import com.azure.resourcemanager.computebulkactions.fluent.models.CancelOperationsResponseInner; +import com.azure.resourcemanager.computebulkactions.models.CancelOperationsResponse; +import com.azure.resourcemanager.computebulkactions.models.ResourceOperation; +import java.util.Collections; +import java.util.List; + +public final class CancelOperationsResponseImpl implements CancelOperationsResponse { + private CancelOperationsResponseInner innerObject; + + private final com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager serviceManager; + + CancelOperationsResponseImpl(CancelOperationsResponseInner innerObject, + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List results() { + List inner = this.innerModel().results(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CancelOperationsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/ComputeBulkActionsManagementClientBuilder.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/ComputeBulkActionsManagementClientBuilder.java new file mode 100644 index 000000000000..d3ff24af744a --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/ComputeBulkActionsManagementClientBuilder.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.computebulkactions.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the ComputeBulkActionsManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { ComputeBulkActionsManagementClientImpl.class }) +public final class ComputeBulkActionsManagementClientBuilder { + /* + * Service host + */ + private String endpoint; + + /** + * Sets Service host. + * + * @param endpoint the endpoint value. + * @return the ComputeBulkActionsManagementClientBuilder. + */ + public ComputeBulkActionsManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the ComputeBulkActionsManagementClientBuilder. + */ + public ComputeBulkActionsManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the ComputeBulkActionsManagementClientBuilder. + */ + public ComputeBulkActionsManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the ComputeBulkActionsManagementClientBuilder. + */ + public ComputeBulkActionsManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the ComputeBulkActionsManagementClientBuilder. + */ + public ComputeBulkActionsManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the ComputeBulkActionsManagementClientBuilder. + */ + public ComputeBulkActionsManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ComputeBulkActionsManagementClientImpl with the provided parameters. + * + * @return an instance of ComputeBulkActionsManagementClientImpl. + */ + public ComputeBulkActionsManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + ComputeBulkActionsManagementClientImpl client = new ComputeBulkActionsManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); + return client; + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/ComputeBulkActionsManagementClientImpl.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/ComputeBulkActionsManagementClientImpl.java new file mode 100644 index 000000000000..719c2dc04bcd --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/ComputeBulkActionsManagementClientImpl.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient; +import com.azure.resourcemanager.computebulkactions.fluent.ComputeBulkActionsManagementClient; +import com.azure.resourcemanager.computebulkactions.fluent.OperationsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the ComputeBulkActionsManagementClientImpl type. + */ +@ServiceClient(builder = ComputeBulkActionsManagementClientBuilder.class) +public final class ComputeBulkActionsManagementClientImpl implements ComputeBulkActionsManagementClient { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Version parameter. + */ + private final String apiVersion; + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * The BulkActionsClient object to access its operations. + */ + private final BulkActionsClient bulkActions; + + /** + * Gets the BulkActionsClient object to access its operations. + * + * @return the BulkActionsClient object. + */ + public BulkActionsClient getBulkActions() { + return this.bulkActions; + } + + /** + * Initializes an instance of ComputeBulkActionsManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + */ + ComputeBulkActionsManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; + this.subscriptionId = subscriptionId; + this.apiVersion = "2026-02-01-preview"; + this.operations = new OperationsClientImpl(this); + this.bulkActions = new BulkActionsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(s)); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ComputeBulkActionsManagementClientImpl.class); +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/CreateResourceOperationResponseImpl.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/CreateResourceOperationResponseImpl.java new file mode 100644 index 000000000000..9bfc64adff2e --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/CreateResourceOperationResponseImpl.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.computebulkactions.implementation; + +import com.azure.resourcemanager.computebulkactions.fluent.models.CreateResourceOperationResponseInner; +import com.azure.resourcemanager.computebulkactions.models.CreateResourceOperationResponse; +import com.azure.resourcemanager.computebulkactions.models.ResourceOperation; +import java.util.Collections; +import java.util.List; + +public final class CreateResourceOperationResponseImpl implements CreateResourceOperationResponse { + private CreateResourceOperationResponseInner innerObject; + + private final com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager serviceManager; + + CreateResourceOperationResponseImpl(CreateResourceOperationResponseInner innerObject, + com.azure.resourcemanager.computebulkactions.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); + } else { + return Collections.emptyList(); + } + } + + public CreateResourceOperationResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/DeallocateResourceOperationResponseImpl.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/DeallocateResourceOperationResponseImpl.java new file mode 100644 index 000000000000..4deb20cd053a --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/DeallocateResourceOperationResponseImpl.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.computebulkactions.implementation; + +import com.azure.resourcemanager.computebulkactions.fluent.models.DeallocateResourceOperationResponseInner; +import com.azure.resourcemanager.computebulkactions.models.DeallocateResourceOperationResponse; +import com.azure.resourcemanager.computebulkactions.models.ResourceOperation; +import java.util.Collections; +import java.util.List; + +public final class DeallocateResourceOperationResponseImpl implements DeallocateResourceOperationResponse { + private DeallocateResourceOperationResponseInner innerObject; + + private final com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager serviceManager; + + DeallocateResourceOperationResponseImpl(DeallocateResourceOperationResponseInner innerObject, + com.azure.resourcemanager.computebulkactions.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); + } else { + return Collections.emptyList(); + } + } + + public DeallocateResourceOperationResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/DeleteResourceOperationResponseImpl.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/DeleteResourceOperationResponseImpl.java new file mode 100644 index 000000000000..0dbe9d61e387 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/DeleteResourceOperationResponseImpl.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.computebulkactions.implementation; + +import com.azure.resourcemanager.computebulkactions.fluent.models.DeleteResourceOperationResponseInner; +import com.azure.resourcemanager.computebulkactions.models.DeleteResourceOperationResponse; +import com.azure.resourcemanager.computebulkactions.models.ResourceOperation; +import java.util.Collections; +import java.util.List; + +public final class DeleteResourceOperationResponseImpl implements DeleteResourceOperationResponse { + private DeleteResourceOperationResponseInner innerObject; + + private final com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager serviceManager; + + DeleteResourceOperationResponseImpl(DeleteResourceOperationResponseInner innerObject, + com.azure.resourcemanager.computebulkactions.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); + } else { + return Collections.emptyList(); + } + } + + public DeleteResourceOperationResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/GetOperationStatusResponseImpl.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/GetOperationStatusResponseImpl.java new file mode 100644 index 000000000000..ccb6631fd87d --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/GetOperationStatusResponseImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.implementation; + +import com.azure.resourcemanager.computebulkactions.fluent.models.GetOperationStatusResponseInner; +import com.azure.resourcemanager.computebulkactions.models.GetOperationStatusResponse; +import com.azure.resourcemanager.computebulkactions.models.ResourceOperation; +import java.util.Collections; +import java.util.List; + +public final class GetOperationStatusResponseImpl implements GetOperationStatusResponse { + private GetOperationStatusResponseInner innerObject; + + private final com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager serviceManager; + + GetOperationStatusResponseImpl(GetOperationStatusResponseInner innerObject, + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List results() { + List inner = this.innerModel().results(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public GetOperationStatusResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/HibernateResourceOperationResponseImpl.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/HibernateResourceOperationResponseImpl.java new file mode 100644 index 000000000000..9893782eda7a --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/HibernateResourceOperationResponseImpl.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.computebulkactions.implementation; + +import com.azure.resourcemanager.computebulkactions.fluent.models.HibernateResourceOperationResponseInner; +import com.azure.resourcemanager.computebulkactions.models.HibernateResourceOperationResponse; +import com.azure.resourcemanager.computebulkactions.models.ResourceOperation; +import java.util.Collections; +import java.util.List; + +public final class HibernateResourceOperationResponseImpl implements HibernateResourceOperationResponse { + private HibernateResourceOperationResponseInner innerObject; + + private final com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager serviceManager; + + HibernateResourceOperationResponseImpl(HibernateResourceOperationResponseInner innerObject, + com.azure.resourcemanager.computebulkactions.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); + } else { + return Collections.emptyList(); + } + } + + public HibernateResourceOperationResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/LocationBasedLaunchBulkInstancesOperationImpl.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/LocationBasedLaunchBulkInstancesOperationImpl.java new file mode 100644 index 000000000000..7b8167f0a1d8 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.computebulkactions.fluent.models.LocationBasedLaunchBulkInstancesOperationInner; +import com.azure.resourcemanager.computebulkactions.models.LaunchBulkInstancesOperationProperties; +import com.azure.resourcemanager.computebulkactions.models.LocationBasedLaunchBulkInstancesOperation; +import com.azure.resourcemanager.computebulkactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.computebulkactions.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.computebulkactions.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.computebulkactions.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() + .getBulkActions() + .createOrUpdate(resourceGroupName, location, name, this.innerModel(), Context.NONE); + return this; + } + + public LocationBasedLaunchBulkInstancesOperation create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBulkActions() + .createOrUpdate(resourceGroupName, location, name, this.innerModel(), context); + return this; + } + + LocationBasedLaunchBulkInstancesOperationImpl(String name, + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager serviceManager) { + this.innerObject = new LocationBasedLaunchBulkInstancesOperationInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public LocationBasedLaunchBulkInstancesOperationImpl update() { + return this; + } + + public LocationBasedLaunchBulkInstancesOperation apply() { + this.innerObject = serviceManager.serviceClient() + .getBulkActions() + .createOrUpdate(resourceGroupName, location, name, this.innerModel(), Context.NONE); + return this; + } + + public LocationBasedLaunchBulkInstancesOperation apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBulkActions() + .createOrUpdate(resourceGroupName, location, name, this.innerModel(), context); + return this; + } + + LocationBasedLaunchBulkInstancesOperationImpl(LocationBasedLaunchBulkInstancesOperationInner innerObject, + com.azure.resourcemanager.computebulkactions.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() + .getBulkActions() + .getWithResponse(resourceGroupName, location, name, Context.NONE) + .getValue(); + return this; + } + + public LocationBasedLaunchBulkInstancesOperation refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBulkActions() + .getWithResponse(resourceGroupName, location, name, context) + .getValue(); + return this; + } + + public void cancel() { + serviceManager.bulkActions().cancel(resourceGroupName, location, name); + } + + public void cancel(Context context) { + serviceManager.bulkActions().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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/OperationImpl.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/OperationImpl.java new file mode 100644 index 000000000000..55368580945f --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/OperationImpl.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.computebulkactions.implementation; + +import com.azure.resourcemanager.computebulkactions.fluent.models.OperationInner; +import com.azure.resourcemanager.computebulkactions.models.ActionType; +import com.azure.resourcemanager.computebulkactions.models.Operation; +import com.azure.resourcemanager.computebulkactions.models.OperationDisplay; +import com.azure.resourcemanager.computebulkactions.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager serviceManager; + + OperationImpl(OperationInner innerObject, + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/OperationStatusResultImpl.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/OperationStatusResultImpl.java new file mode 100644 index 000000000000..d6cda190c756 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.computebulkactions.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.computebulkactions.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.computebulkactions.ComputeBulkActionsManager serviceManager; + + OperationStatusResultImpl(OperationStatusResultInner innerObject, + com.azure.resourcemanager.computebulkactions.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.computebulkactions.ComputeBulkActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/OperationsClientImpl.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..92a5ba1e6e51 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/OperationsClientImpl.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.computebulkactions.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.computebulkactions.fluent.OperationsClient; +import com.azure.resourcemanager.computebulkactions.fluent.models.OperationInner; +import com.azure.resourcemanager.computebulkactions.implementation.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public final class OperationsClientImpl implements OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OperationsService service; + + /** + * The service client containing this operation class. + */ + private final ComputeBulkActionsManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ComputeBulkActionsManagementClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeBulkActionsManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ComputeBulkActionsManagementClientOperations") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.ComputeBulkActions/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.ComputeBulkActions/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/OperationsImpl.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/OperationsImpl.java new file mode 100644 index 000000000000..ff2755c3e832 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/OperationsImpl.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.computebulkactions.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.computebulkactions.fluent.OperationsClient; +import com.azure.resourcemanager.computebulkactions.fluent.models.OperationInner; +import com.azure.resourcemanager.computebulkactions.models.Operation; +import com.azure.resourcemanager.computebulkactions.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/ResourceManagerUtils.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..e4f0e8dd4651 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/StartResourceOperationResponseImpl.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/StartResourceOperationResponseImpl.java new file mode 100644 index 000000000000..9048bb5afc9d --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/StartResourceOperationResponseImpl.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.computebulkactions.implementation; + +import com.azure.resourcemanager.computebulkactions.fluent.models.StartResourceOperationResponseInner; +import com.azure.resourcemanager.computebulkactions.models.ResourceOperation; +import com.azure.resourcemanager.computebulkactions.models.StartResourceOperationResponse; +import java.util.Collections; +import java.util.List; + +public final class StartResourceOperationResponseImpl implements StartResourceOperationResponse { + private StartResourceOperationResponseInner innerObject; + + private final com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager serviceManager; + + StartResourceOperationResponseImpl(StartResourceOperationResponseInner innerObject, + com.azure.resourcemanager.computebulkactions.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); + } else { + return Collections.emptyList(); + } + } + + public StartResourceOperationResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/VirtualMachineImpl.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/VirtualMachineImpl.java new file mode 100644 index 000000000000..33fc748e5670 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.implementation; + +import com.azure.resourcemanager.computebulkactions.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.computebulkactions.models.ApiError; +import com.azure.resourcemanager.computebulkactions.models.VMOperationStatus; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachine; + +public final class VirtualMachineImpl implements VirtualMachine { + private VirtualMachineInner innerObject; + + private final com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager serviceManager; + + VirtualMachineImpl(VirtualMachineInner innerObject, + com.azure.resourcemanager.computebulkactions.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.computebulkactions.ComputeBulkActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/models/LaunchBulkInstancesOperationListResult.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/models/LaunchBulkInstancesOperationListResult.java new file mode 100644 index 000000000000..28cd60caf70f --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/models/OperationListResult.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/models/OperationListResult.java new file mode 100644 index 000000000000..f1fa41fc90fc --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/models/OperationListResult.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.computebulkactions.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.computebulkactions.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * The Operation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + private OperationListResult() { + } + + /** + * Get the value property: The Operation 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 OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult 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 OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/models/VirtualMachineListResult.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/models/VirtualMachineListResult.java new file mode 100644 index 000000000000..8a55db845cfa --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/package-info.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/package-info.java new file mode 100644 index 000000000000..375c940e3d37 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the implementations for ComputeBulkActions. + * Microsoft.ComputeBulkActions Resource Provider management API. + */ +package com.azure.resourcemanager.computebulkactions.implementation; diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/AcceleratorManufacturer.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/AcceleratorManufacturer.java new file mode 100644 index 000000000000..ef13ef8ee6b1 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/AcceleratorType.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/AcceleratorType.java new file mode 100644 index 000000000000..1267489e5348 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ActionType.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ActionType.java new file mode 100644 index 000000000000..b1883b585e40 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ActionType.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.computebulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Actions are for internal-only APIs. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/AdditionalCapabilities.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/AdditionalCapabilities.java new file mode 100644 index 000000000000..681e46190cb9 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/AdditionalUnattendContent.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/AdditionalUnattendContent.java new file mode 100644 index 000000000000..ee2cdb24a706 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/AdditionalUnattendContentComponentName.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/AdditionalUnattendContentComponentName.java new file mode 100644 index 000000000000..329b26ed9af9 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/AdditionalUnattendContentPassName.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/AdditionalUnattendContentPassName.java new file mode 100644 index 000000000000..0fa4bddb1ede --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/AllInstancesDown.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/AllInstancesDown.java new file mode 100644 index 000000000000..f33dd6d2641f --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/AllInstancesDown.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.computebulkactions.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 automaticallyApprove; + + /** + * Creates an instance of AllInstancesDown class. + */ + public AllInstancesDown() { + } + + /** + * Get the automaticallyApprove property: Specifies if Scheduled Events should be auto-approved when all instances + * are down. Its default value is true. + * + * @return the automaticallyApprove value. + */ + public Boolean automaticallyApprove() { + return this.automaticallyApprove; + } + + /** + * Set the automaticallyApprove property: Specifies if Scheduled Events should be auto-approved when all instances + * are down. Its default value is true. + * + * @param automaticallyApprove the automaticallyApprove value to set. + * @return the AllInstancesDown object itself. + */ + public AllInstancesDown withAutomaticallyApprove(Boolean automaticallyApprove) { + this.automaticallyApprove = automaticallyApprove; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("automaticallyApprove", this.automaticallyApprove); + 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.automaticallyApprove = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAllInstancesDown; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/AllocationStrategy.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/AllocationStrategy.java new file mode 100644 index 000000000000..69e7e5e935e9 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/AllocationStrategy.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.computebulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Allocation strategy types for LaunchBulkInstancesOperation. + */ +public final class AllocationStrategy extends ExpandableStringEnum { + /** + * Default. VM sizes distribution will be determined to optimize for price. Note: Capacity will still be considered + * here but will be given much less weight. + */ + public static final AllocationStrategy LOWEST_PRICE = fromString("LowestPrice"); + + /** + * VM sizes distribution will be determined to optimize for capacity. + */ + public static final AllocationStrategy CAPACITY_OPTIMIZED = fromString("CapacityOptimized"); + + /** + * VM sizes distribution will be determined to optimize for the 'rank' specified for each vm size. + */ + public static final AllocationStrategy PRIORITIZED = fromString("Prioritized"); + + /** + * 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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ApiEntityReference.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ApiEntityReference.java new file mode 100644 index 000000000000..440679b61bef --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ApiError.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ApiError.java new file mode 100644 index 000000000000..c45b18ffc0b2 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ApiErrorBase.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ApiErrorBase.java new file mode 100644 index 000000000000..8d4d01b25b29 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ApplicationProfile.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ApplicationProfile.java new file mode 100644 index 000000000000..2904e551b894 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ArchitectureType.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ArchitectureType.java new file mode 100644 index 000000000000..f13d4be45473 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/BootDiagnostics.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/BootDiagnostics.java new file mode 100644 index 000000000000..ed109c6efabf --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/BulkActions.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/BulkActions.java new file mode 100644 index 000000000000..92534f06cc29 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/BulkActions.java @@ -0,0 +1,447 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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 BulkActions. + */ +public interface BulkActions { + /** + * 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 id 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 id, Context context); + + /** + * Get the status of a LaunchBulkInstancesOperation. + * + * @param location The location name. + * @param id 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 id); + + /** + * 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); + + /** + * VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 deallocate request along with {@link Response}. + */ + Response virtualMachinesExecuteDeallocateWithResponse(String location, + ExecuteDeallocateRequest requestBody, Context context); + + /** + * VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 deallocate request. + */ + DeallocateResourceOperationResponse virtualMachinesExecuteDeallocate(String location, + ExecuteDeallocateRequest requestBody); + + /** + * VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 Hibernate request along with {@link Response}. + */ + Response virtualMachinesExecuteHibernateWithResponse(String location, + ExecuteHibernateRequest requestBody, Context context); + + /** + * VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 Hibernate request. + */ + HibernateResourceOperationResponse virtualMachinesExecuteHibernate(String location, + ExecuteHibernateRequest requestBody); + + /** + * VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered + * as soon as Computeschedule receives it. + * + * @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 start request along with {@link Response}. + */ + Response virtualMachinesExecuteStartWithResponse(String location, + ExecuteStartRequest requestBody, Context context); + + /** + * VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered + * as soon as Computeschedule receives it. + * + * @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 start request. + */ + StartResourceOperationResponse virtualMachinesExecuteStart(String location, ExecuteStartRequest requestBody); + + /** + * VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 virtualMachinesExecuteCreateWithResponse(String location, + ExecuteCreateRequest requestBody, Context context); + + /** + * VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 virtualMachinesExecuteCreate(String location, ExecuteCreateRequest requestBody); + + /** + * VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 delete request along with {@link Response}. + */ + Response virtualMachinesExecuteDeleteWithResponse(String location, + ExecuteDeleteRequest requestBody, Context context); + + /** + * VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is + * triggered as soon as Computeschedule receives it. + * + * @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 delete request. + */ + DeleteResourceOperationResponse virtualMachinesExecuteDelete(String location, ExecuteDeleteRequest requestBody); + + /** + * VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines. + * + * @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 this is the response from a get operations status request along with {@link Response}. + */ + Response virtualMachinesGetOperationStatusWithResponse(String location, + GetOperationStatusRequest requestBody, Context context); + + /** + * VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines. + * + * @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 this is the response from a get operations status request. + */ + GetOperationStatusResponse virtualMachinesGetOperationStatus(String location, + GetOperationStatusRequest requestBody); + + /** + * VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request. + * + * @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 this is the response from a cancel operations request along with {@link Response}. + */ + Response virtualMachinesCancelOperationsWithResponse(String location, + CancelOperationsRequest requestBody, Context context); + + /** + * VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request. + * + * @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 this is the response from a cancel operations request. + */ + CancelOperationsResponse virtualMachinesCancelOperations(String location, CancelOperationsRequest requestBody); + + /** + * 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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/CachingTypes.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/CachingTypes.java new file mode 100644 index 000000000000..6afcb45c4fe3 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/CancelOperationsRequest.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/CancelOperationsRequest.java new file mode 100644 index 000000000000..0f005642b2a9 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/CancelOperationsRequest.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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; + +/** + * This is the request to cancel running operations in bulkactions using the operation ids. + */ +@Fluent +public final class CancelOperationsRequest implements JsonSerializable { + /* + * The list of operation ids to cancel operations on + */ + private List operationIds; + + /* + * CorrelationId item + */ + private String correlationId; + + /** + * Creates an instance of CancelOperationsRequest class. + */ + public CancelOperationsRequest() { + } + + /** + * Get the operationIds property: The list of operation ids to cancel operations on. + * + * @return the operationIds value. + */ + public List operationIds() { + return this.operationIds; + } + + /** + * Set the operationIds property: The list of operation ids to cancel operations on. + * + * @param operationIds the operationIds value to set. + * @return the CancelOperationsRequest object itself. + */ + public CancelOperationsRequest withOperationIds(List operationIds) { + this.operationIds = operationIds; + return this; + } + + /** + * Get the correlationId property: CorrelationId item. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set the correlationId property: CorrelationId item. + * + * @param correlationId the correlationId value to set. + * @return the CancelOperationsRequest object itself. + */ + public CancelOperationsRequest withCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("operationIds", this.operationIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("correlationid", this.correlationId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CancelOperationsRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CancelOperationsRequest 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 CancelOperationsRequest. + */ + public static CancelOperationsRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CancelOperationsRequest deserializedCancelOperationsRequest = new CancelOperationsRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationIds".equals(fieldName)) { + List operationIds = reader.readArray(reader1 -> reader1.getString()); + deserializedCancelOperationsRequest.operationIds = operationIds; + } else if ("correlationid".equals(fieldName)) { + deserializedCancelOperationsRequest.correlationId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCancelOperationsRequest; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/CancelOperationsResponse.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/CancelOperationsResponse.java new file mode 100644 index 000000000000..73ca645c145a --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/CancelOperationsResponse.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.computebulkactions.models; + +import com.azure.resourcemanager.computebulkactions.fluent.models.CancelOperationsResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of CancelOperationsResponse. + */ +public interface CancelOperationsResponse { + /** + * Gets the results property: An array of resource operations that were successfully cancelled. + * + * @return the results value. + */ + List results(); + + /** + * Gets the inner com.azure.resourcemanager.computebulkactions.fluent.models.CancelOperationsResponseInner object. + * + * @return the inner object. + */ + CancelOperationsResponseInner innerModel(); +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/CapacityReservationProfile.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/CapacityReservationProfile.java new file mode 100644 index 000000000000..467228056e34 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/CapacityType.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/CapacityType.java new file mode 100644 index 000000000000..92b210e66ad2 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ComputeProfile.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ComputeProfile.java new file mode 100644 index 000000000000..a0fee7c4b9f1 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ComputeProfile.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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 VirtualMachineProfile 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 VirtualMachineProfile 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(VirtualMachineProfile 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 = VirtualMachineProfile.fromJson(reader); + } else if ("extensions".equals(fieldName)) { + List extensions + = reader.readArray(reader1 -> VirtualMachineExtension.fromJson(reader1)); + deserializedComputeProfile.extensions = extensions; + } else if ("computeApiVersion".equals(fieldName)) { + deserializedComputeProfile.computeApiVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeProfile; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/CpuManufacturer.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/CpuManufacturer.java new file mode 100644 index 000000000000..1078fcbcf437 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/CreateResourceOperationResponse.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/CreateResourceOperationResponse.java new file mode 100644 index 000000000000..ac29ac866912 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.models; + +import com.azure.resourcemanager.computebulkactions.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 request eg virtual machines. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The location of the request eg westus. + * + * @return the location value. + */ + String location(); + + /** + * Gets the results property: The results from the request. + * + * @return the results value. + */ + List results(); + + /** + * Gets the inner com.azure.resourcemanager.computebulkactions.fluent.models.CreateResourceOperationResponseInner + * object. + * + * @return the inner object. + */ + CreateResourceOperationResponseInner innerModel(); +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DataDisk.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DataDisk.java new file mode 100644 index 000000000000..24a72077d217 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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 ManagedDiskParameters 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 ManagedDiskParameters managedDisk() { + return this.managedDisk; + } + + /** + * Set the managedDisk property: The managed disk parameters. + * + * @param managedDisk the managedDisk value to set. + * @return the DataDisk object itself. + */ + public DataDisk withManagedDisk(ManagedDiskParameters managedDisk) { + this.managedDisk = managedDisk; + return this; + } + + /** + * Get the 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 = ManagedDiskParameters.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DeadlineType.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DeadlineType.java new file mode 100644 index 000000000000..dff9bbba4d8b --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DeadlineType.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.computebulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The types of deadlines supported by Bulkactions. + */ +public final class DeadlineType extends ExpandableStringEnum { + /** + * Default value of Unknown. + */ + public static final DeadlineType UNKNOWN = fromString("Unknown"); + + /** + * Initiate the operation at the given deadline. + */ + public static final DeadlineType INITIATE_AT = fromString("InitiateAt"); + + /** + * Complete the operation by the given deadline. + */ + public static final DeadlineType COMPLETE_BY = fromString("CompleteBy"); + + /** + * Creates a new instance of DeadlineType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeadlineType() { + } + + /** + * Creates or finds a DeadlineType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeadlineType. + */ + public static DeadlineType fromString(String name) { + return fromString(name, DeadlineType.class); + } + + /** + * Gets known DeadlineType values. + * + * @return known DeadlineType values. + */ + public static Collection values() { + return values(DeadlineType.class); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DeallocateResourceOperationResponse.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DeallocateResourceOperationResponse.java new file mode 100644 index 000000000000..7eca6147f1d1 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DeallocateResourceOperationResponse.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.computebulkactions.models; + +import com.azure.resourcemanager.computebulkactions.fluent.models.DeallocateResourceOperationResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of DeallocateResourceOperationResponse. + */ +public interface DeallocateResourceOperationResponse { + /** + * 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 request eg virtual machines. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The location of the request eg westus. + * + * @return the location value. + */ + String location(); + + /** + * Gets the results property: The results from the request. + * + * @return the results value. + */ + List results(); + + /** + * Gets the inner + * com.azure.resourcemanager.computebulkactions.fluent.models.DeallocateResourceOperationResponseInner object. + * + * @return the inner object. + */ + DeallocateResourceOperationResponseInner innerModel(); +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DeleteOptions.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DeleteOptions.java new file mode 100644 index 000000000000..41d6c96d5ea6 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DeleteResourceOperationResponse.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DeleteResourceOperationResponse.java new file mode 100644 index 000000000000..6e80ecd39fe8 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DeleteResourceOperationResponse.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.computebulkactions.models; + +import com.azure.resourcemanager.computebulkactions.fluent.models.DeleteResourceOperationResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of DeleteResourceOperationResponse. + */ +public interface DeleteResourceOperationResponse { + /** + * 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 request eg virtual machines. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The location of the request eg westus. + * + * @return the location value. + */ + String location(); + + /** + * Gets the results property: The results from the request. + * + * @return the results value. + */ + List results(); + + /** + * Gets the inner com.azure.resourcemanager.computebulkactions.fluent.models.DeleteResourceOperationResponseInner + * object. + * + * @return the inner object. + */ + DeleteResourceOperationResponseInner innerModel(); +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiagnosticsProfile.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiagnosticsProfile.java new file mode 100644 index 000000000000..7abec87e4b0a --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiffDiskOptions.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiffDiskOptions.java new file mode 100644 index 000000000000..e77670889a33 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiffDiskPlacement.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiffDiskPlacement.java new file mode 100644 index 000000000000..a6cfb90f24b7 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiffDiskSettings.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiffDiskSettings.java new file mode 100644 index 000000000000..966c9b01113b --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiskControllerTypes.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiskControllerTypes.java new file mode 100644 index 000000000000..5a9c47d377ee --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiskCreateOptionTypes.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiskCreateOptionTypes.java new file mode 100644 index 000000000000..36943f1f3b79 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiskDeleteOptionTypes.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiskDeleteOptionTypes.java new file mode 100644 index 000000000000..922cae7f4292 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiskDetachOptionTypes.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiskDetachOptionTypes.java new file mode 100644 index 000000000000..1516015d75e2 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiskEncryptionSetParameters.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiskEncryptionSetParameters.java new file mode 100644 index 000000000000..1544c962ce06 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiskEncryptionSetParameters.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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 DiskEncryptionSetParameters extends SubResource { + /** + * Creates an instance of DiskEncryptionSetParameters class. + */ + public DiskEncryptionSetParameters() { + } + + /** + * {@inheritDoc} + */ + @Override + public DiskEncryptionSetParameters 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 DiskEncryptionSetParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiskEncryptionSetParameters 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 DiskEncryptionSetParameters. + */ + public static DiskEncryptionSetParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiskEncryptionSetParameters deserializedDiskEncryptionSetParameters = new DiskEncryptionSetParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDiskEncryptionSetParameters.withId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDiskEncryptionSetParameters; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiskEncryptionSettings.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DiskEncryptionSettings.java new file mode 100644 index 000000000000..7e9522daba52 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DomainNameLabelScopeTypes.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/DomainNameLabelScopeTypes.java new file mode 100644 index 000000000000..409c5f08beb9 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/EncryptionIdentity.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/EncryptionIdentity.java new file mode 100644 index 000000000000..75614869c232 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/EventGridAndResourceGraph.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/EventGridAndResourceGraph.java new file mode 100644 index 000000000000..fe095b261c9a --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/EvictionPolicy.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/EvictionPolicy.java new file mode 100644 index 000000000000..a05f57e5507b --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecuteCreateRequest.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecuteCreateRequest.java new file mode 100644 index 000000000000..a5e75babed7b --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecuteCreateRequest.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.computebulkactions.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 ExecuteCreateRequest implements JsonSerializable { + /* + * resource creation payload + */ + private ResourceProvisionPayload resourceConfigParameters; + + /* + * The execution parameters for the request + */ + private ExecutionParameters executionParameters; + + /* + * CorrelationId item + */ + private String correlationId; + + /** + * Creates an instance of ExecuteCreateRequest class. + */ + public ExecuteCreateRequest() { + } + + /** + * 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 ExecuteCreateRequest object itself. + */ + public ExecuteCreateRequest 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 ExecuteCreateRequest object itself. + */ + public ExecuteCreateRequest withExecutionParameters(ExecutionParameters executionParameters) { + this.executionParameters = executionParameters; + return this; + } + + /** + * Get the correlationId property: CorrelationId item. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set the correlationId property: CorrelationId item. + * + * @param correlationId the correlationId value to set. + * @return the ExecuteCreateRequest object itself. + */ + public ExecuteCreateRequest withCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("resourceConfigParameters", this.resourceConfigParameters); + jsonWriter.writeJsonField("executionParameters", this.executionParameters); + jsonWriter.writeStringField("correlationid", this.correlationId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecuteCreateRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecuteCreateRequest 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 ExecuteCreateRequest. + */ + public static ExecuteCreateRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecuteCreateRequest deserializedExecuteCreateRequest = new ExecuteCreateRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceConfigParameters".equals(fieldName)) { + deserializedExecuteCreateRequest.resourceConfigParameters + = ResourceProvisionPayload.fromJson(reader); + } else if ("executionParameters".equals(fieldName)) { + deserializedExecuteCreateRequest.executionParameters = ExecutionParameters.fromJson(reader); + } else if ("correlationid".equals(fieldName)) { + deserializedExecuteCreateRequest.correlationId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExecuteCreateRequest; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecuteDeallocateRequest.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecuteDeallocateRequest.java new file mode 100644 index 000000000000..53eea7f3f25d --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecuteDeallocateRequest.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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 ExecuteDeallocateRequest request for executeDeallocate operations. + */ +@Fluent +public final class ExecuteDeallocateRequest implements JsonSerializable { + /* + * The execution parameters for the request + */ + private ExecutionParameters executionParameters; + + /* + * The resources for the request + */ + private Resources resources; + + /* + * CorrelationId item + */ + private String correlationId; + + /** + * Creates an instance of ExecuteDeallocateRequest class. + */ + public ExecuteDeallocateRequest() { + } + + /** + * 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 ExecuteDeallocateRequest object itself. + */ + public ExecuteDeallocateRequest 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 ExecuteDeallocateRequest object itself. + */ + public ExecuteDeallocateRequest withResources(Resources resources) { + this.resources = resources; + return this; + } + + /** + * Get the correlationId property: CorrelationId item. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set the correlationId property: CorrelationId item. + * + * @param correlationId the correlationId value to set. + * @return the ExecuteDeallocateRequest object itself. + */ + public ExecuteDeallocateRequest withCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("executionParameters", this.executionParameters); + jsonWriter.writeStringField("correlationid", this.correlationId); + jsonWriter.writeJsonField("resources", this.resources); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecuteDeallocateRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecuteDeallocateRequest 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 ExecuteDeallocateRequest. + */ + public static ExecuteDeallocateRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecuteDeallocateRequest deserializedExecuteDeallocateRequest = new ExecuteDeallocateRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("executionParameters".equals(fieldName)) { + deserializedExecuteDeallocateRequest.executionParameters = ExecutionParameters.fromJson(reader); + } else if ("correlationid".equals(fieldName)) { + deserializedExecuteDeallocateRequest.correlationId = reader.getString(); + } else if ("resources".equals(fieldName)) { + deserializedExecuteDeallocateRequest.resources = Resources.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExecuteDeallocateRequest; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecuteDeleteRequest.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecuteDeleteRequest.java new file mode 100644 index 000000000000..ad095c084499 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecuteDeleteRequest.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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 ExecuteDeleteRequest for delete VM operation. + */ +@Fluent +public final class ExecuteDeleteRequest implements JsonSerializable { + /* + * The execution parameters for the request + */ + private ExecutionParameters executionParameters; + + /* + * The resources for the request + */ + private Resources resources; + + /* + * CorrelationId item + */ + private String correlationId; + + /* + * Forced delete resource item + */ + private Boolean forceDeletion; + + /** + * Creates an instance of ExecuteDeleteRequest class. + */ + public ExecuteDeleteRequest() { + } + + /** + * 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 ExecuteDeleteRequest object itself. + */ + public ExecuteDeleteRequest 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 ExecuteDeleteRequest object itself. + */ + public ExecuteDeleteRequest withResources(Resources resources) { + this.resources = resources; + return this; + } + + /** + * Get the correlationId property: CorrelationId item. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set the correlationId property: CorrelationId item. + * + * @param correlationId the correlationId value to set. + * @return the ExecuteDeleteRequest object itself. + */ + public ExecuteDeleteRequest withCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * Get the forceDeletion property: Forced delete resource item. + * + * @return the forceDeletion value. + */ + public Boolean forceDeletion() { + return this.forceDeletion; + } + + /** + * Set the forceDeletion property: Forced delete resource item. + * + * @param forceDeletion the forceDeletion value to set. + * @return the ExecuteDeleteRequest object itself. + */ + public ExecuteDeleteRequest withForceDeletion(Boolean forceDeletion) { + this.forceDeletion = forceDeletion; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("executionParameters", this.executionParameters); + jsonWriter.writeStringField("correlationid", this.correlationId); + jsonWriter.writeJsonField("resources", this.resources); + jsonWriter.writeBooleanField("forceDeletion", this.forceDeletion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecuteDeleteRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecuteDeleteRequest 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 ExecuteDeleteRequest. + */ + public static ExecuteDeleteRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecuteDeleteRequest deserializedExecuteDeleteRequest = new ExecuteDeleteRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("executionParameters".equals(fieldName)) { + deserializedExecuteDeleteRequest.executionParameters = ExecutionParameters.fromJson(reader); + } else if ("correlationid".equals(fieldName)) { + deserializedExecuteDeleteRequest.correlationId = reader.getString(); + } else if ("resources".equals(fieldName)) { + deserializedExecuteDeleteRequest.resources = Resources.fromJson(reader); + } else if ("forceDeletion".equals(fieldName)) { + deserializedExecuteDeleteRequest.forceDeletion = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedExecuteDeleteRequest; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecuteHibernateRequest.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecuteHibernateRequest.java new file mode 100644 index 000000000000..4032d43f0e8a --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecuteHibernateRequest.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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 ExecuteHibernateRequest request for executeHibernate operations. + */ +@Fluent +public final class ExecuteHibernateRequest implements JsonSerializable { + /* + * The execution parameters for the request + */ + private ExecutionParameters executionParameters; + + /* + * The resources for the request + */ + private Resources resources; + + /* + * CorrelationId item + */ + private String correlationId; + + /** + * Creates an instance of ExecuteHibernateRequest class. + */ + public ExecuteHibernateRequest() { + } + + /** + * 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 ExecuteHibernateRequest object itself. + */ + public ExecuteHibernateRequest 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 ExecuteHibernateRequest object itself. + */ + public ExecuteHibernateRequest withResources(Resources resources) { + this.resources = resources; + return this; + } + + /** + * Get the correlationId property: CorrelationId item. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set the correlationId property: CorrelationId item. + * + * @param correlationId the correlationId value to set. + * @return the ExecuteHibernateRequest object itself. + */ + public ExecuteHibernateRequest withCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("executionParameters", this.executionParameters); + jsonWriter.writeStringField("correlationid", this.correlationId); + jsonWriter.writeJsonField("resources", this.resources); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecuteHibernateRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecuteHibernateRequest 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 ExecuteHibernateRequest. + */ + public static ExecuteHibernateRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecuteHibernateRequest deserializedExecuteHibernateRequest = new ExecuteHibernateRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("executionParameters".equals(fieldName)) { + deserializedExecuteHibernateRequest.executionParameters = ExecutionParameters.fromJson(reader); + } else if ("correlationid".equals(fieldName)) { + deserializedExecuteHibernateRequest.correlationId = reader.getString(); + } else if ("resources".equals(fieldName)) { + deserializedExecuteHibernateRequest.resources = Resources.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExecuteHibernateRequest; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecuteStartRequest.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecuteStartRequest.java new file mode 100644 index 000000000000..6f1a0fe7f935 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecuteStartRequest.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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 ExecuteStartRequest request for executeStart operations. + */ +@Fluent +public final class ExecuteStartRequest implements JsonSerializable { + /* + * The execution parameters for the request + */ + private ExecutionParameters executionParameters; + + /* + * The resources for the request + */ + private Resources resources; + + /* + * CorrelationId item + */ + private String correlationId; + + /** + * Creates an instance of ExecuteStartRequest class. + */ + public ExecuteStartRequest() { + } + + /** + * 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 ExecuteStartRequest object itself. + */ + public ExecuteStartRequest 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 ExecuteStartRequest object itself. + */ + public ExecuteStartRequest withResources(Resources resources) { + this.resources = resources; + return this; + } + + /** + * Get the correlationId property: CorrelationId item. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set the correlationId property: CorrelationId item. + * + * @param correlationId the correlationId value to set. + * @return the ExecuteStartRequest object itself. + */ + public ExecuteStartRequest withCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("executionParameters", this.executionParameters); + jsonWriter.writeStringField("correlationid", this.correlationId); + jsonWriter.writeJsonField("resources", this.resources); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecuteStartRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecuteStartRequest 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 ExecuteStartRequest. + */ + public static ExecuteStartRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecuteStartRequest deserializedExecuteStartRequest = new ExecuteStartRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("executionParameters".equals(fieldName)) { + deserializedExecuteStartRequest.executionParameters = ExecutionParameters.fromJson(reader); + } else if ("correlationid".equals(fieldName)) { + deserializedExecuteStartRequest.correlationId = reader.getString(); + } else if ("resources".equals(fieldName)) { + deserializedExecuteStartRequest.resources = Resources.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExecuteStartRequest; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecutionParameters.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecutionParameters.java new file mode 100644 index 000000000000..40cd9bb21ce1 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecutionParameters.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.computebulkactions.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; + +/** + * Extra details needed to run the user's request. + */ +@Fluent +public final class ExecutionParameters implements JsonSerializable { + /* + * Details that could optimize the user's request + */ + private OptimizationPreference optimizationPreference; + + /* + * Retry policy the user can pass + */ + private RetryPolicy retryPolicy; + + /** + * Creates an instance of ExecutionParameters class. + */ + public ExecutionParameters() { + } + + /** + * Get the optimizationPreference property: Details that could optimize the user's request. + * + * @return the optimizationPreference value. + */ + public OptimizationPreference optimizationPreference() { + return this.optimizationPreference; + } + + /** + * Set the optimizationPreference property: Details that could optimize the user's request. + * + * @param optimizationPreference the optimizationPreference value to set. + * @return the ExecutionParameters object itself. + */ + public ExecutionParameters withOptimizationPreference(OptimizationPreference optimizationPreference) { + this.optimizationPreference = optimizationPreference; + 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 ExecutionParameters object itself. + */ + public ExecutionParameters withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("optimizationPreference", + this.optimizationPreference == null ? null : this.optimizationPreference.toString()); + jsonWriter.writeJsonField("retryPolicy", this.retryPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecutionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecutionParameters 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 ExecutionParameters. + */ + public static ExecutionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecutionParameters deserializedExecutionParameters = new ExecutionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("optimizationPreference".equals(fieldName)) { + deserializedExecutionParameters.optimizationPreference + = OptimizationPreference.fromString(reader.getString()); + } else if ("retryPolicy".equals(fieldName)) { + deserializedExecutionParameters.retryPolicy = RetryPolicy.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExecutionParameters; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/GetOperationStatusRequest.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/GetOperationStatusRequest.java new file mode 100644 index 000000000000..c42e8f794924 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/GetOperationStatusRequest.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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; + +/** + * This is the request to get operation status using operationids. + */ +@Fluent +public final class GetOperationStatusRequest implements JsonSerializable { + /* + * The list of operation ids to get the status of + */ + private List operationIds; + + /* + * CorrelationId item + */ + private String correlationId; + + /** + * Creates an instance of GetOperationStatusRequest class. + */ + public GetOperationStatusRequest() { + } + + /** + * Get the operationIds property: The list of operation ids to get the status of. + * + * @return the operationIds value. + */ + public List operationIds() { + return this.operationIds; + } + + /** + * Set the operationIds property: The list of operation ids to get the status of. + * + * @param operationIds the operationIds value to set. + * @return the GetOperationStatusRequest object itself. + */ + public GetOperationStatusRequest withOperationIds(List operationIds) { + this.operationIds = operationIds; + return this; + } + + /** + * Get the correlationId property: CorrelationId item. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set the correlationId property: CorrelationId item. + * + * @param correlationId the correlationId value to set. + * @return the GetOperationStatusRequest object itself. + */ + public GetOperationStatusRequest withCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("operationIds", this.operationIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("correlationid", this.correlationId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetOperationStatusRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetOperationStatusRequest 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 GetOperationStatusRequest. + */ + public static GetOperationStatusRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetOperationStatusRequest deserializedGetOperationStatusRequest = new GetOperationStatusRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationIds".equals(fieldName)) { + List operationIds = reader.readArray(reader1 -> reader1.getString()); + deserializedGetOperationStatusRequest.operationIds = operationIds; + } else if ("correlationid".equals(fieldName)) { + deserializedGetOperationStatusRequest.correlationId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGetOperationStatusRequest; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/GetOperationStatusResponse.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/GetOperationStatusResponse.java new file mode 100644 index 000000000000..03017c2192ff --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/GetOperationStatusResponse.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.computebulkactions.models; + +import com.azure.resourcemanager.computebulkactions.fluent.models.GetOperationStatusResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of GetOperationStatusResponse. + */ +public interface GetOperationStatusResponse { + /** + * Gets the results property: An array of resource operations based on their operation ids. + * + * @return the results value. + */ + List results(); + + /** + * Gets the inner com.azure.resourcemanager.computebulkactions.fluent.models.GetOperationStatusResponseInner object. + * + * @return the inner object. + */ + GetOperationStatusResponseInner innerModel(); +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/HibernateResourceOperationResponse.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/HibernateResourceOperationResponse.java new file mode 100644 index 000000000000..76a0ce5a86d0 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/HibernateResourceOperationResponse.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.computebulkactions.models; + +import com.azure.resourcemanager.computebulkactions.fluent.models.HibernateResourceOperationResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of HibernateResourceOperationResponse. + */ +public interface HibernateResourceOperationResponse { + /** + * 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 request eg virtual machines. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The location of the request eg westus. + * + * @return the location value. + */ + String location(); + + /** + * Gets the results property: The results from the request. + * + * @return the results value. + */ + List results(); + + /** + * Gets the inner com.azure.resourcemanager.computebulkactions.fluent.models.HibernateResourceOperationResponseInner + * object. + * + * @return the inner object. + */ + HibernateResourceOperationResponseInner innerModel(); +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/HostEndpointSettings.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/HostEndpointSettings.java new file mode 100644 index 000000000000..74d743117f57 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/HyperVGeneration.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/HyperVGeneration.java new file mode 100644 index 000000000000..4c93aa572d33 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/IPVersions.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/IPVersions.java new file mode 100644 index 000000000000..ed3f1424239d --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ImageReference.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ImageReference.java new file mode 100644 index 000000000000..cad3f388f992 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/InnerError.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/InnerError.java new file mode 100644 index 000000000000..2cdc4817a963 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/KeyVaultKeyReference.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/KeyVaultKeyReference.java new file mode 100644 index 000000000000..2e928e640a20 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/KeyVaultSecretReference.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/KeyVaultSecretReference.java new file mode 100644 index 000000000000..26d5ef14885d --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/LaunchBulkInstancesOperationProperties.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/LaunchBulkInstancesOperationProperties.java new file mode 100644 index 000000000000..b949b557bb93 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/LaunchBulkInstancesOperationProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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; + +/** + * Details of the LaunchBulkInstancesOperation. + */ +@Fluent +public final class LaunchBulkInstancesOperationProperties + implements JsonSerializable { + /* + * 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 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 ("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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/LinuxConfiguration.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/LinuxConfiguration.java new file mode 100644 index 000000000000..b855767f89d4 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/LinuxPatchAssessmentMode.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/LinuxPatchAssessmentMode.java new file mode 100644 index 000000000000..e49d8fc1b5ca --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/LinuxPatchSettings.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/LinuxPatchSettings.java new file mode 100644 index 000000000000..ec108be47982 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/LinuxVMGuestPatchAutomaticByPlatformRebootSetting.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/LinuxVMGuestPatchAutomaticByPlatformRebootSetting.java new file mode 100644 index 000000000000..8ded3331a4a4 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/LinuxVMGuestPatchAutomaticByPlatformSettings.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/LinuxVMGuestPatchAutomaticByPlatformSettings.java new file mode 100644 index 000000000000..47c5059c905e --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/LinuxVMGuestPatchMode.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/LinuxVMGuestPatchMode.java new file mode 100644 index 000000000000..f43d8b5afcd9 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/LocalStorageDiskType.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/LocalStorageDiskType.java new file mode 100644 index 000000000000..003ab25bdcb1 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/LocationBasedLaunchBulkInstancesOperation.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/LocationBasedLaunchBulkInstancesOperation.java new file mode 100644 index 000000000000..868308f839de --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/LocationBasedLaunchBulkInstancesOperation.java @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.computebulkactions.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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ManagedDiskParameters.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ManagedDiskParameters.java new file mode 100644 index 000000000000..1201e0c96a34 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ManagedDiskParameters.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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 ManagedDiskParameters extends SubResource { + /* + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it + * cannot be used with OS Disk. + */ + private StorageAccountTypes storageAccountType; + + /* + * Specifies the customer managed disk encryption set resource id for the managed disk. + */ + private DiskEncryptionSetParameters diskEncryptionSet; + + /* + * Specifies the security profile for the managed disk. + */ + private VMDiskSecurityProfile securityProfile; + + /** + * Creates an instance of ManagedDiskParameters class. + */ + public ManagedDiskParameters() { + } + + /** + * Get the storageAccountType property: Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. + * + * @return the storageAccountType value. + */ + public StorageAccountTypes storageAccountType() { + return this.storageAccountType; + } + + /** + * Set the storageAccountType property: Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. + * + * @param storageAccountType the storageAccountType value to set. + * @return the ManagedDiskParameters object itself. + */ + public ManagedDiskParameters withStorageAccountType(StorageAccountTypes storageAccountType) { + this.storageAccountType = storageAccountType; + return this; + } + + /** + * Get the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the + * managed disk. + * + * @return the diskEncryptionSet value. + */ + public DiskEncryptionSetParameters diskEncryptionSet() { + return this.diskEncryptionSet; + } + + /** + * Set the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the + * managed disk. + * + * @param diskEncryptionSet the diskEncryptionSet value to set. + * @return the ManagedDiskParameters object itself. + */ + public ManagedDiskParameters withDiskEncryptionSet(DiskEncryptionSetParameters diskEncryptionSet) { + this.diskEncryptionSet = diskEncryptionSet; + return this; + } + + /** + * Get the securityProfile property: Specifies the security profile for the managed disk. + * + * @return the securityProfile value. + */ + public VMDiskSecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: Specifies the security profile for the managed disk. + * + * @param securityProfile the securityProfile value to set. + * @return the ManagedDiskParameters object itself. + */ + public ManagedDiskParameters withSecurityProfile(VMDiskSecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedDiskParameters withId(String id) { + super.withId(id); + return this; + } + + /** + * {@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 ManagedDiskParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedDiskParameters 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 ManagedDiskParameters. + */ + public static ManagedDiskParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedDiskParameters deserializedManagedDiskParameters = new ManagedDiskParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedManagedDiskParameters.withId(reader.getString()); + } else if ("storageAccountType".equals(fieldName)) { + deserializedManagedDiskParameters.storageAccountType + = StorageAccountTypes.fromString(reader.getString()); + } else if ("diskEncryptionSet".equals(fieldName)) { + deserializedManagedDiskParameters.diskEncryptionSet = DiskEncryptionSetParameters.fromJson(reader); + } else if ("securityProfile".equals(fieldName)) { + deserializedManagedDiskParameters.securityProfile = VMDiskSecurityProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedDiskParameters; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ManagedServiceIdentity.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..a234aa7f8e31 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ManagedServiceIdentityType.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..9078c356c0a7 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/Mode.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/Mode.java new file mode 100644 index 000000000000..8c17dc73f109 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/Modes.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/Modes.java new file mode 100644 index 000000000000..0e404e804a8f --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/NetworkApiVersion.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/NetworkApiVersion.java new file mode 100644 index 000000000000..e47dda6146ab --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/NetworkInterfaceAuxiliaryMode.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/NetworkInterfaceAuxiliaryMode.java new file mode 100644 index 000000000000..1ddf85c7f778 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/NetworkInterfaceAuxiliarySku.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/NetworkInterfaceAuxiliarySku.java new file mode 100644 index 000000000000..5e2163a09151 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/NetworkInterfaceReference.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/NetworkInterfaceReference.java new file mode 100644 index 000000000000..7d9377eba975 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/NetworkInterfaceReferenceProperties.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/NetworkInterfaceReferenceProperties.java new file mode 100644 index 000000000000..cba90d61b16a --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/NetworkProfile.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/NetworkProfile.java new file mode 100644 index 000000000000..3783472747fc --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/OSDisk.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/OSDisk.java new file mode 100644 index 000000000000..d27704f20eb0 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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 ManagedDiskParameters 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 ManagedDiskParameters managedDisk() { + return this.managedDisk; + } + + /** + * Set the managedDisk property: The managed disk parameters. + * + * @param managedDisk the managedDisk value to set. + * @return the OSDisk object itself. + */ + public OSDisk withManagedDisk(ManagedDiskParameters managedDisk) { + this.managedDisk = managedDisk; + return this; + } + + /** + * Get the deleteOption property: Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible + * values are: Delete, 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 = ManagedDiskParameters.fromJson(reader); + } else if ("deleteOption".equals(fieldName)) { + deserializedOSDisk.deleteOption = DiskDeleteOptionTypes.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOSDisk; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/OSImageNotificationProfile.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/OSImageNotificationProfile.java new file mode 100644 index 000000000000..a8763b48f8e4 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/OSProfile.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/OSProfile.java new file mode 100644 index 000000000000..330e20792f96 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/OperatingSystemTypes.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/OperatingSystemTypes.java new file mode 100644 index 000000000000..8f408911971b --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/Operation.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/Operation.java new file mode 100644 index 000000000000..3ac88a91dd29 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/Operation.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.computebulkactions.models; + +import com.azure.resourcemanager.computebulkactions.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.computebulkactions.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/OperationDisplay.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/OperationDisplay.java new file mode 100644 index 000000000000..463622913d46 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/OperationDisplay.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.computebulkactions.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; + +/** + * Localized display information for an operation. + */ +@Immutable +public final class OperationDisplay implements JsonSerializable { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". + */ + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". + */ + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + */ + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + private OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay 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 OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/OperationState.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/OperationState.java new file mode 100644 index 000000000000..1b0e9f8b8581 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/OperationState.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.computebulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Values that define the states of operations in BulkActions. + */ +public final class OperationState extends ExpandableStringEnum { + /** + * The default value for the operation state enum. + */ + public static final OperationState UNKNOWN = fromString("Unknown"); + + /** + * Operations that are pending scheduling. + */ + public static final OperationState PENDING_SCHEDULING = fromString("PendingScheduling"); + + /** + * Operations that have been scheduled. + */ + public static final OperationState SCHEDULED = fromString("Scheduled"); + + /** + * Operations that are waiting to be executed. + */ + public static final OperationState PENDING_EXECUTION = fromString("PendingExecution"); + + /** + * Operations that are in the process of being executed. + */ + public static final OperationState EXECUTING = fromString("Executing"); + + /** + * Operations that succeeded. + */ + public static final OperationState SUCCEEDED = fromString("Succeeded"); + + /** + * Operations that have failed. + */ + public static final OperationState FAILED = fromString("Failed"); + + /** + * Operations that have been Cancelled by the user. + */ + public static final OperationState CANCELLED = fromString("Cancelled"); + + /** + * Operations that are blocked. + */ + public static final OperationState BLOCKED = fromString("Blocked"); + + /** + * Creates a new instance of OperationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OperationState() { + } + + /** + * Creates or finds a OperationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationState. + */ + public static OperationState fromString(String name) { + return fromString(name, OperationState.class); + } + + /** + * Gets known OperationState values. + * + * @return known OperationState values. + */ + public static Collection values() { + return values(OperationState.class); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/OperationStatusResult.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/OperationStatusResult.java new file mode 100644 index 000000000000..6e55fc30ce83 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.computebulkactions.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.computebulkactions.fluent.models.OperationStatusResultInner object. + * + * @return the inner object. + */ + OperationStatusResultInner innerModel(); +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/Operations.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/Operations.java new file mode 100644 index 000000000000..a55a06481eee --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/Operations.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.computebulkactions.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Operations. + */ +public interface Operations { + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/OptimizationPreference.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/OptimizationPreference.java new file mode 100644 index 000000000000..17f963422a4a --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/OptimizationPreference.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.computebulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The preferences customers can select to optimize their requests to Bulkactions. + */ +public final class OptimizationPreference extends ExpandableStringEnum { + /** + * Optimize while considering cost savings. + */ + public static final OptimizationPreference COST = fromString("Cost"); + + /** + * Optimize while considering availability of resources. + */ + public static final OptimizationPreference AVAILABILITY = fromString("Availability"); + + /** + * Optimize while considering a balance of cost and availability. + */ + public static final OptimizationPreference COST_AVAILABILITY_BALANCED = fromString("CostAvailabilityBalanced"); + + /** + * Creates a new instance of OptimizationPreference value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OptimizationPreference() { + } + + /** + * Creates or finds a OptimizationPreference from its string representation. + * + * @param name a name to look for. + * @return the corresponding OptimizationPreference. + */ + public static OptimizationPreference fromString(String name) { + return fromString(name, OptimizationPreference.class); + } + + /** + * Gets known OptimizationPreference values. + * + * @return known OptimizationPreference values. + */ + public static Collection values() { + return values(OptimizationPreference.class); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/Origin.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/Origin.java new file mode 100644 index 000000000000..6ddeb309fe25 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/Origin.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.computebulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Indicates the operation is initiated by a user. + */ + public static final Origin USER = fromString("user"); + + /** + * Indicates the operation is initiated by a system. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Indicates the operation is initiated by a user or system. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/PatchSettings.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/PatchSettings.java new file mode 100644 index 000000000000..93327849c7b1 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/Plan.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/Plan.java new file mode 100644 index 000000000000..66f38314805b --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/PriorityProfile.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/PriorityProfile.java new file mode 100644 index 000000000000..4cdd152d7424 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/PriorityProfile.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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 properties that are applicable to both Spot and Regular. + */ +@Fluent +public final class PriorityProfile implements JsonSerializable { + /* + * Specifies the type of Virtual Machine. + */ + private VirtualMachineType type; + + /* + * Price per hour of each Spot VM will never exceed this. + */ + private Double maxPricePerVM; + + /* + * Eviction Policy to follow when evicting Spot VMs. + */ + private EvictionPolicy evictionPolicy; + + /* + * Allocation strategy to follow when determining the VM sizes distribution. + */ + private AllocationStrategy allocationStrategy; + + /** + * Creates an instance of PriorityProfile class. + */ + public PriorityProfile() { + } + + /** + * Get the type property: Specifies the type of Virtual Machine. + * + * @return the type value. + */ + public VirtualMachineType type() { + return this.type; + } + + /** + * Set the type property: Specifies the type of Virtual Machine. + * + * @param type the type value to set. + * @return the PriorityProfile object itself. + */ + public PriorityProfile withType(VirtualMachineType type) { + this.type = type; + return this; + } + + /** + * Get the maxPricePerVM property: Price per hour of each Spot VM will never exceed this. + * + * @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. + * + * @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. + * + * @return the evictionPolicy value. + */ + public EvictionPolicy evictionPolicy() { + return this.evictionPolicy; + } + + /** + * Set the evictionPolicy property: Eviction Policy to follow when evicting Spot VMs. + * + * @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: Allocation strategy to follow when determining the VM sizes distribution. + * + * @return the allocationStrategy value. + */ + public AllocationStrategy allocationStrategy() { + return this.allocationStrategy; + } + + /** + * Set the allocationStrategy property: Allocation strategy to follow when determining the VM sizes distribution. + * + * @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 = VirtualMachineType.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ProtocolTypes.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ProtocolTypes.java new file mode 100644 index 000000000000..953dd852ba8c --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ProvisioningState.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ProvisioningState.java new file mode 100644 index 000000000000..13fce7be9b1d --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ProxyAgentSettings.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ProxyAgentSettings.java new file mode 100644 index 000000000000..6962df85466d --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/PublicIPAddressSku.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/PublicIPAddressSku.java new file mode 100644 index 000000000000..6f4b8a7ae80b --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/PublicIPAddressSkuName.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/PublicIPAddressSkuName.java new file mode 100644 index 000000000000..f90163ced348 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/PublicIPAddressSkuTier.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/PublicIPAddressSkuTier.java new file mode 100644 index 000000000000..603a942aecb4 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/PublicIPAllocationMethod.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/PublicIPAllocationMethod.java new file mode 100644 index 000000000000..ffae45312092 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ResourceOperation.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ResourceOperation.java new file mode 100644 index 000000000000..edea73f1a9ca --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ResourceOperation.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.computebulkactions.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; + +/** + * Top level response from an operation on a resource. + */ +@Immutable +public final class ResourceOperation implements JsonSerializable { + /* + * Unique identifier for the resource involved in the operation, eg Azure Resource Manager 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() { + } + + /** + * Get the resourceId property: Unique identifier for the resource involved in the operation, eg Azure Resource + * Manager 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; + } + + /** + * {@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); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceOperation from the JsonReader. + * + * @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. + */ + 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; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ResourceOperationDetails.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ResourceOperationDetails.java new file mode 100644 index 000000000000..a780c5c63a21 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ResourceOperationDetails.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.models; + +import com.azure.core.annotation.Immutable; +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; + +/** + * The details of a response from an operation on a resource. + */ +@Immutable +public final class ResourceOperationDetails implements JsonSerializable { + /* + * Operation identifier for the unique operation + */ + private String operationId; + + /* + * Unique identifier for the resource involved in the operation, eg Azure Resource Manager ID + */ + private String resourceId; + + /* + * Type of operation performed on the resources + */ + private ResourceOperationType opType; + + /* + * Subscription id attached to the request + */ + private String subscriptionId; + + /* + * Deadline for the operation + */ + private OffsetDateTime deadline; + + /* + * Type of deadline of the operation + */ + private DeadlineType deadlineType; + + /* + * Current state of the operation + */ + private OperationState state; + + /* + * Timezone for the operation + */ + private String timezone; + + /* + * Operation level errors if they exist + */ + private ResourceOperationError resourceOperationError; + + /* + * Time the operation was complete if errors are null + */ + private OffsetDateTime completedAt; + + /* + * Retry policy the user can pass + */ + private RetryPolicy retryPolicy; + + /** + * Creates an instance of ResourceOperationDetails class. + */ + private ResourceOperationDetails() { + } + + /** + * Get the operationId property: Operation identifier for the unique operation. + * + * @return the operationId value. + */ + public String operationId() { + return this.operationId; + } + + /** + * Get the resourceId property: Unique identifier for the resource involved in the operation, eg Azure Resource + * Manager ID. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the opType property: Type of operation performed on the resources. + * + * @return the opType value. + */ + public ResourceOperationType opType() { + return this.opType; + } + + /** + * Get the subscriptionId property: Subscription id attached to the request. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Get the deadline property: Deadline for the operation. + * + * @return the deadline value. + */ + public OffsetDateTime deadline() { + return this.deadline; + } + + /** + * Get the deadlineType property: Type of deadline of the operation. + * + * @return the deadlineType value. + */ + public DeadlineType deadlineType() { + return this.deadlineType; + } + + /** + * Get the state property: Current state of the operation. + * + * @return the state value. + */ + public OperationState state() { + return this.state; + } + + /** + * Get the timezone property: Timezone for the operation. + * + * @return the timezone value. + */ + public String timezone() { + return this.timezone; + } + + /** + * Get the resourceOperationError property: Operation level errors if they exist. + * + * @return the resourceOperationError value. + */ + public ResourceOperationError resourceOperationError() { + return this.resourceOperationError; + } + + /** + * Get the completedAt property: Time the operation was complete if errors are null. + * + * @return the completedAt value. + */ + public OffsetDateTime completedAt() { + return this.completedAt; + } + + /** + * Get the retryPolicy property: Retry policy the user can pass. + * + * @return the retryPolicy value. + */ + public RetryPolicy retryPolicy() { + return this.retryPolicy; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operationId", this.operationId); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("opType", this.opType == null ? null : this.opType.toString()); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + jsonWriter.writeStringField("deadline", + this.deadline == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.deadline)); + jsonWriter.writeStringField("deadlineType", this.deadlineType == null ? null : this.deadlineType.toString()); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeStringField("timezone", this.timezone); + jsonWriter.writeJsonField("resourceOperationError", this.resourceOperationError); + jsonWriter.writeStringField("completedAt", + this.completedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.completedAt)); + jsonWriter.writeJsonField("retryPolicy", this.retryPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceOperationDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceOperationDetails 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 ResourceOperationDetails. + */ + public static ResourceOperationDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceOperationDetails deserializedResourceOperationDetails = new ResourceOperationDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationId".equals(fieldName)) { + deserializedResourceOperationDetails.operationId = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedResourceOperationDetails.resourceId = reader.getString(); + } else if ("opType".equals(fieldName)) { + deserializedResourceOperationDetails.opType = ResourceOperationType.fromString(reader.getString()); + } else if ("subscriptionId".equals(fieldName)) { + deserializedResourceOperationDetails.subscriptionId = reader.getString(); + } else if ("deadline".equals(fieldName)) { + deserializedResourceOperationDetails.deadline = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("deadlineType".equals(fieldName)) { + deserializedResourceOperationDetails.deadlineType = DeadlineType.fromString(reader.getString()); + } else if ("state".equals(fieldName)) { + deserializedResourceOperationDetails.state = OperationState.fromString(reader.getString()); + } else if ("timezone".equals(fieldName)) { + deserializedResourceOperationDetails.timezone = reader.getString(); + } else if ("resourceOperationError".equals(fieldName)) { + deserializedResourceOperationDetails.resourceOperationError + = ResourceOperationError.fromJson(reader); + } else if ("completedAt".equals(fieldName)) { + deserializedResourceOperationDetails.completedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("retryPolicy".equals(fieldName)) { + deserializedResourceOperationDetails.retryPolicy = RetryPolicy.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceOperationDetails; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ResourceOperationError.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ResourceOperationError.java new file mode 100644 index 000000000000..8da53a4e88c1 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ResourceOperationError.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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; + +/** + * These describe errors that occur at the resource level. + */ +@Immutable +public final class ResourceOperationError implements JsonSerializable { + /* + * Code for the error eg 404, 500 + */ + private String errorCode; + + /* + * Detailed message about the error + */ + private String errorDetails; + + /** + * Creates an instance of ResourceOperationError class. + */ + private ResourceOperationError() { + } + + /** + * Get the errorCode property: Code for the error eg 404, 500. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Get the errorDetails property: Detailed message about the error. + * + * @return the errorDetails value. + */ + public String errorDetails() { + return this.errorDetails; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("errorCode", this.errorCode); + jsonWriter.writeStringField("errorDetails", this.errorDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceOperationError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceOperationError 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 ResourceOperationError. + */ + public static ResourceOperationError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceOperationError deserializedResourceOperationError = new ResourceOperationError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errorCode".equals(fieldName)) { + deserializedResourceOperationError.errorCode = reader.getString(); + } else if ("errorDetails".equals(fieldName)) { + deserializedResourceOperationError.errorDetails = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceOperationError; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ResourceOperationType.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ResourceOperationType.java new file mode 100644 index 000000000000..29e998951bd4 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ResourceOperationType.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of operation types that can be performed on resources eg Virtual Machines, using BulkActions. + */ +public final class ResourceOperationType extends ExpandableStringEnum { + /** + * The default value for this enum type. + */ + public static final ResourceOperationType UNKNOWN = fromString("Unknown"); + + /** + * Start operations on the resources. + */ + public static final ResourceOperationType START = fromString("Start"); + + /** + * Deallocate operations on the resources. + */ + public static final ResourceOperationType DEALLOCATE = fromString("Deallocate"); + + /** + * Hibernate operations on the resources. + */ + public static final ResourceOperationType HIBERNATE = fromString("Hibernate"); + + /** + * Create operations on the resources. + */ + public static final ResourceOperationType CREATE = fromString("Create"); + + /** + * Delete operations on the resources. + */ + public static final ResourceOperationType DELETE = fromString("Delete"); + + /** + * Creates a new instance of ResourceOperationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceOperationType() { + } + + /** + * Creates or finds a ResourceOperationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceOperationType. + */ + public static ResourceOperationType fromString(String name) { + return fromString(name, ResourceOperationType.class); + } + + /** + * Gets known ResourceOperationType values. + * + * @return known ResourceOperationType values. + */ + public static Collection values() { + return values(ResourceOperationType.class); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ResourceProvisionPayload.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ResourceProvisionPayload.java new file mode 100644 index 000000000000..1aa5920fb45a --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ResourceProvisionPayload.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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. + */ +@Fluent +public final class ResourceProvisionPayload implements JsonSerializable { + /* + * JSON object that contains VM properties that are common across all VMs in this batch (if you want to create 100 + * VMs in this request, and they all have same vmSize, then include vmSize in baseProfile) + */ + private Map baseProfile; + + /* + * JSON array, that contains VM properties that should to be overridden for each VM in the batch (if you want to + * create 100 VMs, they all need a distinct computerName property, you pass computerNames for each VM in batch in + * this array), service will merge baseProfile with VM specific overrides and create a merged VMProfile. + */ + private List> resourceOverrides; + + /* + * Number of VMs to be created + */ + private int resourceCount; + + /* + * if resourceOverrides doesn't contain "name", service will create name based of prefix and ResourceCount e.g. + * resourceprefix-0,resourceprefix-1.. + */ + private String resourcePrefix; + + /** + * Creates an instance of ResourceProvisionPayload class. + */ + public ResourceProvisionPayload() { + } + + /** + * Get the baseProfile property: JSON object that contains VM properties that are common across all VMs in this + * batch (if you want to create 100 VMs in this request, and they all have same vmSize, then include vmSize in + * baseProfile). + * + * @return the baseProfile value. + */ + public Map baseProfile() { + return this.baseProfile; + } + + /** + * Set the baseProfile property: JSON object that contains VM properties that are common across all VMs in this + * batch (if you want to create 100 VMs in this request, and they all have same vmSize, then include vmSize in + * baseProfile). + * + * @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: JSON array, that contains VM properties that should to be overridden for each + * VM in the batch (if you want to create 100 VMs, they all need a distinct computerName property, you pass + * computerNames for each VM in batch in this array), service will merge baseProfile with VM specific overrides and + * create a merged VMProfile. + * + * @return the resourceOverrides value. + */ + public List> resourceOverrides() { + return this.resourceOverrides; + } + + /** + * Set the resourceOverrides property: JSON array, that contains VM properties that should to be overridden for each + * VM in the batch (if you want to create 100 VMs, they all need a distinct computerName property, you pass + * computerNames for each VM in batch in this array), service will merge baseProfile with VM specific overrides and + * create a merged VMProfile. + * + * @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", service will create name based of + * 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", service will create name based of + * 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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/Resources.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/Resources.java new file mode 100644 index 000000000000..820c8592d9a0 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/Resources.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.computebulkactions.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. + */ +@Fluent +public final class Resources implements JsonSerializable { + /* + * The resource ids used for the request + */ + private List ids; + + /** + * Creates an instance of Resources class. + */ + public Resources() { + } + + /** + * Get the ids property: The resource ids used for the request. + * + * @return the ids value. + */ + public List ids() { + return this.ids; + } + + /** + * Set the ids property: The resource ids used for the request. + * + * @param ids the ids value to set. + * @return the Resources object itself. + */ + public Resources withIds(List ids) { + this.ids = ids; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ids", this.ids, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Resources from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Resources 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 Resources. + */ + public static Resources fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Resources deserializedResources = new Resources(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ids".equals(fieldName)) { + List ids = reader.readArray(reader1 -> reader1.getString()); + deserializedResources.ids = ids; + } else { + reader.skipChildren(); + } + } + + return deserializedResources; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/RetryPolicy.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/RetryPolicy.java new file mode 100644 index 000000000000..2ce3c98c1f3e --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/RetryPolicy.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.computebulkactions.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 retry policy for the user request. + */ +@Fluent +public final class RetryPolicy implements JsonSerializable { + /* + * Retry count for user request + */ + private Integer retryCount; + + /* + * Retry window in minutes for user request + */ + private Integer retryWindowInMinutes; + + /** + * Creates an instance of RetryPolicy class. + */ + public RetryPolicy() { + } + + /** + * Get the retryCount property: Retry count for user request. + * + * @return the retryCount value. + */ + public Integer retryCount() { + return this.retryCount; + } + + /** + * Set the retryCount property: Retry count for user request. + * + * @param retryCount the retryCount value to set. + * @return the RetryPolicy object itself. + */ + public RetryPolicy withRetryCount(Integer retryCount) { + this.retryCount = retryCount; + return this; + } + + /** + * Get the retryWindowInMinutes property: Retry window in minutes for user request. + * + * @return the retryWindowInMinutes value. + */ + public Integer retryWindowInMinutes() { + return this.retryWindowInMinutes; + } + + /** + * Set the retryWindowInMinutes property: Retry window in minutes for user request. + * + * @param retryWindowInMinutes the retryWindowInMinutes value to set. + * @return the RetryPolicy object itself. + */ + public RetryPolicy withRetryWindowInMinutes(Integer retryWindowInMinutes) { + this.retryWindowInMinutes = retryWindowInMinutes; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("retryCount", this.retryCount); + jsonWriter.writeNumberField("retryWindowInMinutes", this.retryWindowInMinutes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RetryPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RetryPolicy 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 RetryPolicy. + */ + public static RetryPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RetryPolicy deserializedRetryPolicy = new RetryPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("retryCount".equals(fieldName)) { + deserializedRetryPolicy.retryCount = reader.getNullable(JsonReader::getInt); + } else if ("retryWindowInMinutes".equals(fieldName)) { + deserializedRetryPolicy.retryWindowInMinutes = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedRetryPolicy; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ScheduledEventsAdditionalPublishingTargets.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ScheduledEventsAdditionalPublishingTargets.java new file mode 100644 index 000000000000..d29d4e8fd293 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ScheduledEventsPolicy.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ScheduledEventsPolicy.java new file mode 100644 index 000000000000..1ce7e74442f3 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ScheduledEventsProfile.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ScheduledEventsProfile.java new file mode 100644 index 000000000000..18e02a23dd29 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/SecurityEncryptionTypes.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/SecurityEncryptionTypes.java new file mode 100644 index 000000000000..0327144a060d --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/SecurityProfile.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/SecurityProfile.java new file mode 100644 index 000000000000..f781a9600d8f --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/SecurityTypes.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/SecurityTypes.java new file mode 100644 index 000000000000..280b29197414 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/SettingNames.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/SettingNames.java new file mode 100644 index 000000000000..17573dffae0c --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/SshConfiguration.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/SshConfiguration.java new file mode 100644 index 000000000000..7a0e952a6c31 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/SshPublicKey.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/SshPublicKey.java new file mode 100644 index 000000000000..32280410488b --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/StartResourceOperationResponse.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/StartResourceOperationResponse.java new file mode 100644 index 000000000000..ce14c3b0d74e --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/StartResourceOperationResponse.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.computebulkactions.models; + +import com.azure.resourcemanager.computebulkactions.fluent.models.StartResourceOperationResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of StartResourceOperationResponse. + */ +public interface StartResourceOperationResponse { + /** + * 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 request eg virtual machines. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The location of the request eg westus. + * + * @return the location value. + */ + String location(); + + /** + * Gets the results property: The results from the request. + * + * @return the results value. + */ + List results(); + + /** + * Gets the inner com.azure.resourcemanager.computebulkactions.fluent.models.StartResourceOperationResponseInner + * object. + * + * @return the inner object. + */ + StartResourceOperationResponseInner innerModel(); +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/StorageAccountTypes.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/StorageAccountTypes.java new file mode 100644 index 000000000000..d4b904b26672 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/StorageProfile.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/StorageProfile.java new file mode 100644 index 000000000000..e6962ec3c7e8 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/TerminateNotificationProfile.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/TerminateNotificationProfile.java new file mode 100644 index 000000000000..7017875f504b --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/UefiSettings.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/UefiSettings.java new file mode 100644 index 000000000000..da9fac5e0443 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/UserAssignedIdentity.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..9493a48a7800 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/UserInitiatedReboot.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/UserInitiatedReboot.java new file mode 100644 index 000000000000..2750a49fb3b1 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/UserInitiatedReboot.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.computebulkactions.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 automaticallyApprove; + + /** + * Creates an instance of UserInitiatedReboot class. + */ + public UserInitiatedReboot() { + } + + /** + * Get the automaticallyApprove property: Specifies Reboot Scheduled Event related configurations. + * + * @return the automaticallyApprove value. + */ + public Boolean automaticallyApprove() { + return this.automaticallyApprove; + } + + /** + * Set the automaticallyApprove property: Specifies Reboot Scheduled Event related configurations. + * + * @param automaticallyApprove the automaticallyApprove value to set. + * @return the UserInitiatedReboot object itself. + */ + public UserInitiatedReboot withAutomaticallyApprove(Boolean automaticallyApprove) { + this.automaticallyApprove = automaticallyApprove; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("automaticallyApprove", this.automaticallyApprove); + 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.automaticallyApprove = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedUserInitiatedReboot; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/UserInitiatedRedeploy.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/UserInitiatedRedeploy.java new file mode 100644 index 000000000000..cae371e9133a --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/UserInitiatedRedeploy.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.computebulkactions.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 automaticallyApprove; + + /** + * Creates an instance of UserInitiatedRedeploy class. + */ + public UserInitiatedRedeploy() { + } + + /** + * Get the automaticallyApprove property: Specifies Redeploy Scheduled Event related configurations. + * + * @return the automaticallyApprove value. + */ + public Boolean automaticallyApprove() { + return this.automaticallyApprove; + } + + /** + * Set the automaticallyApprove property: Specifies Redeploy Scheduled Event related configurations. + * + * @param automaticallyApprove the automaticallyApprove value to set. + * @return the UserInitiatedRedeploy object itself. + */ + public UserInitiatedRedeploy withAutomaticallyApprove(Boolean automaticallyApprove) { + this.automaticallyApprove = automaticallyApprove; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("automaticallyApprove", this.automaticallyApprove); + 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.automaticallyApprove = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedUserInitiatedRedeploy; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMAttributeMinMaxDouble.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMAttributeMinMaxDouble.java new file mode 100644 index 000000000000..4c68fb2f40c9 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMAttributeMinMaxInteger.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMAttributeMinMaxInteger.java new file mode 100644 index 000000000000..f37c6716342c --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMAttributeSupport.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMAttributeSupport.java new file mode 100644 index 000000000000..38bce89304c5 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMAttributes.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMAttributes.java new file mode 100644 index 000000000000..fd64663fbb4d --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMAttributes.java @@ -0,0 +1,789 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMCategory.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMCategory.java new file mode 100644 index 000000000000..712db453e194 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMCategory.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.computebulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * VMCategories defined for Azure VMs. + * See: + * https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/overview?tabs=breakdownseries%2Cgeneralsizelist%2Ccomputesizelist%2Cmemorysizelist%2Cstoragesizelist%2Cgpusizelist%2Cfpgasizelist%2Chpcsizelist#general-purpose. + */ +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. + * Examples include Cassandra, MongoDB, Cloudera, and Redis. + */ + public static final VMCategory STORAGE_OPTIMIZED = fromString("StorageOptimized"); + + /** + * GPU optimized VM sizes are specialized virtual machines available with single, multiple, or fractional GPUs. + * These sizes are designed for compute-intensive, graphics-intensive, and visualization workloads. + */ + public static final VMCategory GPU_ACCELERATED = fromString("GpuAccelerated"); + + /** + * FPGA optimized VM sizes are specialized virtual machines available with single or multiple FPGA. + * These sizes are designed for compute-intensive workloads. This article provides information about the number and + * type of FPGA, vCPUs, data disks, and NICs. + * Storage throughput and network bandwidth are also included for each size in this grouping. + */ + public static final VMCategory FPGA_ACCELERATED = fromString("FpgaAccelerated"); + + /** + * Azure High Performance Compute VMs are optimized for various HPC workloads such as computational fluid dynamics, + * finite element analysis, frontend and backend EDA, + * rendering, molecular dynamics, computational geo science, 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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMDiskSecurityProfile.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMDiskSecurityProfile.java new file mode 100644 index 000000000000..822ef3f373ce --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMDiskSecurityProfile.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.computebulkactions.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 DiskEncryptionSetParameters diskEncryptionSet; + + /** + * Creates an instance of VMDiskSecurityProfile class. + */ + public VMDiskSecurityProfile() { + } + + /** + * Get the securityEncryptionType property: Specifies the EncryptionType of the managed disk. It is set to + * DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob, 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 DiskEncryptionSetParameters diskEncryptionSet() { + return this.diskEncryptionSet; + } + + /** + * Set the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the + * managed disk that is used for Customer Managed Key encrypted ConfidentialVM OS Disk and VMGuest blob. + * + * @param diskEncryptionSet the diskEncryptionSet value to set. + * @return the VMDiskSecurityProfile object itself. + */ + public VMDiskSecurityProfile withDiskEncryptionSet(DiskEncryptionSetParameters diskEncryptionSet) { + this.diskEncryptionSet = diskEncryptionSet; + return this; + } + + /** + * {@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 = DiskEncryptionSetParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVMDiskSecurityProfile; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMGalleryApplication.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMGalleryApplication.java new file mode 100644 index 000000000000..6c42dea3b4db --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMOperationStatus.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMOperationStatus.java new file mode 100644 index 000000000000..74f9b6853c6d --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VaultCertificate.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VaultCertificate.java new file mode 100644 index 000000000000..3fbe5b36414c --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VaultSecretGroup.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VaultSecretGroup.java new file mode 100644 index 000000000000..71656c532fb7 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualHardDisk.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualHardDisk.java new file mode 100644 index 000000000000..df10ca921899 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachine.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachine.java new file mode 100644 index 000000000000..ef7c196d921a --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.models; + +import com.azure.resourcemanager.computebulkactions.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: This represents the operationStatus of the virtual machine in response to the + * last operation that was performed on it by Azure Fleet resource. + * + * @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.computebulkactions.fluent.models.VirtualMachineInner object. + * + * @return the inner object. + */ + VirtualMachineInner innerModel(); +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineExtension.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineExtension.java new file mode 100644 index 000000000000..b3dae48f0bff --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineExtension.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.computebulkactions.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 VirtualMachineExtension implements JsonSerializable { + /* + * The name of the virtual machine extension. + */ + private String name; + + /* + * Properties of the virtual machine extension. + */ + private VirtualMachineExtensionProperties properties; + + /** + * Creates an instance of VirtualMachineExtension class. + */ + public VirtualMachineExtension() { + } + + /** + * 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 VirtualMachineExtension object itself. + */ + public VirtualMachineExtension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties property: Properties of the virtual machine extension. + * + * @return the properties value. + */ + public VirtualMachineExtensionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the virtual machine extension. + * + * @param properties the properties value to set. + * @return the VirtualMachineExtension object itself. + */ + public VirtualMachineExtension withProperties(VirtualMachineExtensionProperties 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 VirtualMachineExtension from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineExtension 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 VirtualMachineExtension. + */ + public static VirtualMachineExtension fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineExtension deserializedVirtualMachineExtension = new VirtualMachineExtension(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVirtualMachineExtension.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedVirtualMachineExtension.properties = VirtualMachineExtensionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineExtension; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineExtensionProperties.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineExtensionProperties.java new file mode 100644 index 000000000000..10f1350b17b2 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineExtensionProperties.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.computebulkactions.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 VirtualMachineExtensionProperties 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 VirtualMachineExtensionProperties class. + */ + public VirtualMachineExtensionProperties() { + } + + /** + * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is 'CustomScriptExtension'. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Specifies the type of the extension; an example is 'CustomScriptExtension'. + * + * @param type the type value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withType(String type) { + this.type = type; + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + + /** + * Get the settings property: JSON formatted public settings for the extension. + * + * @return the settings value. + */ + public 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 VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties 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 VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties 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 VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withSuppressFailures(Boolean suppressFailures) { + this.suppressFailures = suppressFailures; + return this; + } + + /** + * Get the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @return the protectedSettingsFromKeyVault value. + */ + public KeyVaultSecretReference protectedSettingsFromKeyVault() { + return this.protectedSettingsFromKeyVault; + } + + /** + * Set the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @param protectedSettingsFromKeyVault the protectedSettingsFromKeyVault value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties + withProtectedSettingsFromKeyVault(KeyVaultSecretReference protectedSettingsFromKeyVault) { + this.protectedSettingsFromKeyVault = protectedSettingsFromKeyVault; + return this; + } + + /** + * Get the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @return the provisionAfterExtensions value. + */ + public List provisionAfterExtensions() { + return this.provisionAfterExtensions; + } + + /** + * Set the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @param provisionAfterExtensions the provisionAfterExtensions value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withProvisionAfterExtensions(List provisionAfterExtensions) { + this.provisionAfterExtensions = provisionAfterExtensions; + return this; + } + + /** + * {@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 VirtualMachineExtensionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineExtensionProperties 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 VirtualMachineExtensionProperties. + */ + public static VirtualMachineExtensionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineExtensionProperties deserializedVirtualMachineExtensionProperties + = new VirtualMachineExtensionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("forceUpdateTag".equals(fieldName)) { + deserializedVirtualMachineExtensionProperties.forceUpdateTag = reader.getString(); + } else if ("publisher".equals(fieldName)) { + deserializedVirtualMachineExtensionProperties.publisher = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVirtualMachineExtensionProperties.type = reader.getString(); + } else if ("typeHandlerVersion".equals(fieldName)) { + deserializedVirtualMachineExtensionProperties.typeHandlerVersion = reader.getString(); + } else if ("autoUpgradeMinorVersion".equals(fieldName)) { + deserializedVirtualMachineExtensionProperties.autoUpgradeMinorVersion + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableAutomaticUpgrade".equals(fieldName)) { + deserializedVirtualMachineExtensionProperties.enableAutomaticUpgrade + = reader.getNullable(JsonReader::getBoolean); + } else if ("settings".equals(fieldName)) { + Map settings = reader.readMap(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + deserializedVirtualMachineExtensionProperties.settings = settings; + } else if ("protectedSettings".equals(fieldName)) { + Map protectedSettings = reader.readMap(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + deserializedVirtualMachineExtensionProperties.protectedSettings = protectedSettings; + } else if ("suppressFailures".equals(fieldName)) { + deserializedVirtualMachineExtensionProperties.suppressFailures + = reader.getNullable(JsonReader::getBoolean); + } else if ("protectedSettingsFromKeyVault".equals(fieldName)) { + deserializedVirtualMachineExtensionProperties.protectedSettingsFromKeyVault + = KeyVaultSecretReference.fromJson(reader); + } else if ("provisionAfterExtensions".equals(fieldName)) { + List provisionAfterExtensions = reader.readArray(reader1 -> reader1.getString()); + deserializedVirtualMachineExtensionProperties.provisionAfterExtensions = provisionAfterExtensions; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineExtensionProperties; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineIpTag.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineIpTag.java new file mode 100644 index 000000000000..0b6b20019d1d --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineNetworkInterfaceConfiguration.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineNetworkInterfaceConfiguration.java new file mode 100644 index 000000000000..9c45b17093d6 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineNetworkInterfaceConfigurationProperties.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineNetworkInterfaceConfigurationProperties.java new file mode 100644 index 000000000000..d0f2d14d4782 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineNetworkInterfaceDnsSettingsConfiguration.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineNetworkInterfaceDnsSettingsConfiguration.java new file mode 100644 index 000000000000..d3cb2911b0ba --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineNetworkInterfaceIPConfiguration.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineNetworkInterfaceIPConfiguration.java new file mode 100644 index 000000000000..4352c1ac06cd --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineNetworkInterfaceIPConfigurationProperties.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineNetworkInterfaceIPConfigurationProperties.java new file mode 100644 index 000000000000..0e78124f9bbe --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineProfile.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineProfile.java new file mode 100644 index 000000000000..69395b50795c --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineProfile.java @@ -0,0 +1,466 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.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 properties of a Virtual Machine. + */ +@Fluent +public final class VirtualMachineProfile 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 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; + + /** + * Creates an instance of VirtualMachineProfile class. + */ + public VirtualMachineProfile() { + } + + /** + * 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 VirtualMachineProfile object itself. + */ + public VirtualMachineProfile 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 VirtualMachineProfile object itself. + */ + public VirtualMachineProfile withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual + * machine. + * + * @return the additionalCapabilities value. + */ + public AdditionalCapabilities additionalCapabilities() { + return this.additionalCapabilities; + } + + /** + * Set the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual + * machine. + * + * @param additionalCapabilities the additionalCapabilities value to set. + * @return the VirtualMachineProfile object itself. + */ + public VirtualMachineProfile 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 VirtualMachineProfile object itself. + */ + public VirtualMachineProfile 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 VirtualMachineProfile object itself. + */ + public VirtualMachineProfile 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 VirtualMachineProfile object itself. + */ + public VirtualMachineProfile 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 VirtualMachineProfile object itself. + */ + public VirtualMachineProfile 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 VirtualMachineProfile object itself. + */ + public VirtualMachineProfile 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 VirtualMachineProfile object itself. + */ + public VirtualMachineProfile 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 VirtualMachineProfile object itself. + */ + public VirtualMachineProfile 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 VirtualMachineProfile object itself. + */ + public VirtualMachineProfile 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 VirtualMachineProfile object itself. + */ + public VirtualMachineProfile 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 VirtualMachineProfile object itself. + */ + public VirtualMachineProfile withApplicationProfile(ApplicationProfile applicationProfile) { + this.applicationProfile = applicationProfile; + 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("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); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineProfile 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 VirtualMachineProfile. + */ + public static VirtualMachineProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineProfile deserializedVirtualMachineProfile = new VirtualMachineProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scheduledEventsPolicy".equals(fieldName)) { + deserializedVirtualMachineProfile.scheduledEventsPolicy = ScheduledEventsPolicy.fromJson(reader); + } else if ("storageProfile".equals(fieldName)) { + deserializedVirtualMachineProfile.storageProfile = StorageProfile.fromJson(reader); + } else if ("additionalCapabilities".equals(fieldName)) { + deserializedVirtualMachineProfile.additionalCapabilities = AdditionalCapabilities.fromJson(reader); + } else if ("osProfile".equals(fieldName)) { + deserializedVirtualMachineProfile.osProfile = OSProfile.fromJson(reader); + } else if ("networkProfile".equals(fieldName)) { + deserializedVirtualMachineProfile.networkProfile = NetworkProfile.fromJson(reader); + } else if ("securityProfile".equals(fieldName)) { + deserializedVirtualMachineProfile.securityProfile = SecurityProfile.fromJson(reader); + } else if ("diagnosticsProfile".equals(fieldName)) { + deserializedVirtualMachineProfile.diagnosticsProfile = DiagnosticsProfile.fromJson(reader); + } else if ("licenseType".equals(fieldName)) { + deserializedVirtualMachineProfile.licenseType = reader.getString(); + } else if ("extensionsTimeBudget".equals(fieldName)) { + deserializedVirtualMachineProfile.extensionsTimeBudget = reader.getString(); + } else if ("scheduledEventsProfile".equals(fieldName)) { + deserializedVirtualMachineProfile.scheduledEventsProfile = ScheduledEventsProfile.fromJson(reader); + } else if ("userData".equals(fieldName)) { + deserializedVirtualMachineProfile.userData = reader.getString(); + } else if ("capacityReservation".equals(fieldName)) { + deserializedVirtualMachineProfile.capacityReservation = CapacityReservationProfile.fromJson(reader); + } else if ("applicationProfile".equals(fieldName)) { + deserializedVirtualMachineProfile.applicationProfile = ApplicationProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineProfile; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachinePublicIPAddressConfiguration.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachinePublicIPAddressConfiguration.java new file mode 100644 index 000000000000..71db662b56c2 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachinePublicIPAddressConfigurationProperties.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachinePublicIPAddressConfigurationProperties.java new file mode 100644 index 000000000000..a4aae0536e30 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachinePublicIPAddressDnsSettingsConfiguration.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachinePublicIPAddressDnsSettingsConfiguration.java new file mode 100644 index 000000000000..3649ed9cf98b --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineType.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineType.java new file mode 100644 index 000000000000..32678ef3a2fe --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineType.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.computebulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the priority type of virtual machines to launch. + */ +public final class VirtualMachineType extends ExpandableStringEnum { + /** + * Default. Regular/On-demand VMs will be launched. + */ + public static final VirtualMachineType REGULAR = fromString("Regular"); + + /** + * Spot VMs will be launched. + */ + public static final VirtualMachineType SPOT = fromString("Spot"); + + /** + * Creates a new instance of VirtualMachineType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualMachineType() { + } + + /** + * Creates or finds a VirtualMachineType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachineType. + */ + public static VirtualMachineType fromString(String name) { + return fromString(name, VirtualMachineType.class); + } + + /** + * Gets known VirtualMachineType values. + * + * @return known VirtualMachineType values. + */ + public static Collection values() { + return values(VirtualMachineType.class); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VmSizeProfile.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VmSizeProfile.java new file mode 100644 index 000000000000..90c322ff2b78 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VmSizeProfile.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.computebulkactions.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; + +/** + * Specifications about a VM Size. This will also contain the corresponding rank and weight in future. + */ +@Fluent +public final class VmSizeProfile implements JsonSerializable { + /* + * The Sku name (e.g. 'Standard_DS1_v2') + */ + private String name; + + /* + * The rank of the VM size. This is used with 'AllocationStrategy.Prioritized' + * The lower the number, the higher the priority. Starting with 0. + */ + private Integer rank; + + /** + * Creates an instance of VmSizeProfile class. + */ + public VmSizeProfile() { + } + + /** + * Get the name property: The Sku name (e.g. 'Standard_DS1_v2'). + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The Sku name (e.g. 'Standard_DS1_v2'). + * + * @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 the VM size. This is used with 'AllocationStrategy.Prioritized' + * The lower the number, the higher the priority. Starting with 0. + * + * @return the rank value. + */ + public Integer rank() { + return this.rank; + } + + /** + * Set the rank property: The rank of the VM size. This is used with 'AllocationStrategy.Prioritized' + * The lower the number, the higher the priority. Starting with 0. + * + * @param rank the rank value to set. + * @return the VmSizeProfile object itself. + */ + public VmSizeProfile withRank(Integer rank) { + this.rank = rank; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("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.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedVmSizeProfile; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/WinRMConfiguration.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/WinRMConfiguration.java new file mode 100644 index 000000000000..185a5a37f2b9 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/WinRMListener.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/WinRMListener.java new file mode 100644 index 000000000000..5c629385e5e7 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/WindowsConfiguration.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/WindowsConfiguration.java new file mode 100644 index 000000000000..cf042d80ad0a --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/WindowsPatchAssessmentMode.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/WindowsPatchAssessmentMode.java new file mode 100644 index 000000000000..fa2851dfb365 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/WindowsVMGuestPatchAutomaticByPlatformRebootSetting.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/WindowsVMGuestPatchAutomaticByPlatformRebootSetting.java new file mode 100644 index 000000000000..3ec801ca7d58 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java new file mode 100644 index 000000000000..0b03090561f6 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/WindowsVMGuestPatchMode.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/WindowsVMGuestPatchMode.java new file mode 100644 index 000000000000..6431e5982455 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZoneAllocationPolicy.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZoneAllocationPolicy.java new file mode 100644 index 000000000000..478baa8acfc2 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZoneAllocationPolicy.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.computebulkactions.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; + +/** + * ZoneAllocationPolicy for LaunchBulkInstancesOperation. + */ +@Fluent +public final class ZoneAllocationPolicy implements JsonSerializable { + /* + * Distribution strategy used for zone allocation policy. + */ + private ZoneDistributionStrategy distributionStrategy; + + /* + * Zone preferences, required when zone distribution strategy is Prioritized. + */ + private List zonePreferences; + + /** + * Creates an instance of ZoneAllocationPolicy class. + */ + public ZoneAllocationPolicy() { + } + + /** + * Get the distributionStrategy property: Distribution strategy used for zone allocation policy. + * + * @return the distributionStrategy value. + */ + public ZoneDistributionStrategy distributionStrategy() { + return this.distributionStrategy; + } + + /** + * Set the distributionStrategy property: Distribution strategy used for zone allocation policy. + * + * @param distributionStrategy the distributionStrategy value to set. + * @return the ZoneAllocationPolicy object itself. + */ + public ZoneAllocationPolicy withDistributionStrategy(ZoneDistributionStrategy distributionStrategy) { + this.distributionStrategy = distributionStrategy; + return this; + } + + /** + * Get the zonePreferences property: Zone preferences, required when zone distribution strategy is Prioritized. + * + * @return the zonePreferences value. + */ + public List zonePreferences() { + return this.zonePreferences; + } + + /** + * Set the zonePreferences property: Zone preferences, required when zone distribution strategy is Prioritized. + * + * @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 IllegalStateException If the deserialized JSON object was missing any required properties. + * @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 + = ZoneDistributionStrategy.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/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZoneDistributionStrategy.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZoneDistributionStrategy.java new file mode 100644 index 000000000000..4c866d47a0a7 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZoneDistributionStrategy.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Distribution strategies for LaunchBulkInstancesOperation zone allocation policy. + */ +public final class ZoneDistributionStrategy extends ExpandableStringEnum { + /** + * Default. Launch instances in a single zone based on best effort. + * If capacity is not available, LaunchBulkInstancesOperation can allocate capacity in different zones. + */ + public static final ZoneDistributionStrategy BEST_EFFORT_SINGLE_ZONE = fromString("BestEffortSingleZone"); + + /** + * Launch instances based on zone preferences. + * Higher priority zones are filled first before allocating to lower priority zones. + */ + public static final ZoneDistributionStrategy PRIORITIZED = fromString("Prioritized"); + + /** + * Balance launching instances across zones specified based on best effort. + * If capacity is not available, LaunchBulkInstancesOperation can deviate balancing across all zones. + */ + public static final ZoneDistributionStrategy BEST_EFFORT_BALANCED = fromString("BestEffortBalanced"); + + /** + * Launch instances across all provided zones, ensuring the difference between any two zones is no more than one + * instance. + */ + public static final ZoneDistributionStrategy STRICT_BALANCED = fromString("StrictBalanced"); + + /** + * Creates a new instance of ZoneDistributionStrategy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ZoneDistributionStrategy() { + } + + /** + * Creates or finds a ZoneDistributionStrategy from its string representation. + * + * @param name a name to look for. + * @return the corresponding ZoneDistributionStrategy. + */ + public static ZoneDistributionStrategy fromString(String name) { + return fromString(name, ZoneDistributionStrategy.class); + } + + /** + * Gets known ZoneDistributionStrategy values. + * + * @return known ZoneDistributionStrategy values. + */ + public static Collection values() { + return values(ZoneDistributionStrategy.class); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZonePreference.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZonePreference.java new file mode 100644 index 000000000000..a80bddcce40a --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZonePreference.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.computebulkactions.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; + +/** + * Zone preferences for LaunchBulkInstancesOperation zone allocation policy. + */ +@Fluent +public final class ZonePreference implements JsonSerializable { + /* + * Name of the zone. + */ + private String zone; + + /* + * The rank of the zone. This is used with 'Prioritized' ZoneDistributionStrategy. + * The lower the number, the higher the priority, starting with 0. + * 0 is the highest rank. If not specified, defaults to lowest rank. + */ + private Integer rank; + + /** + * Creates an instance of ZonePreference class. + */ + public ZonePreference() { + } + + /** + * Get the zone property: Name of the zone. + * + * @return the zone value. + */ + public String zone() { + return this.zone; + } + + /** + * Set the zone property: Name of the zone. + * + * @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 the zone. This is used with 'Prioritized' ZoneDistributionStrategy. + * The lower the number, the higher the priority, starting with 0. + * 0 is the highest rank. If not specified, defaults to lowest rank. + * + * @return the rank value. + */ + public Integer rank() { + return this.rank; + } + + /** + * Set the rank property: The rank of the zone. This is used with 'Prioritized' ZoneDistributionStrategy. + * The lower the number, the higher the priority, starting with 0. + * 0 is the highest rank. If not specified, defaults to lowest rank. + * + * @param rank the rank value to set. + * @return the ZonePreference object itself. + */ + public ZonePreference withRank(Integer rank) { + this.rank = rank; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("zone", this.zone); + jsonWriter.writeNumberField("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.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedZonePreference; + }); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/package-info.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/package-info.java new file mode 100644 index 000000000000..a7de7e8911e3 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the data models for ComputeBulkActions. + * Microsoft.ComputeBulkActions Resource Provider management API. + */ +package com.azure.resourcemanager.computebulkactions.models; diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/package-info.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/package-info.java new file mode 100644 index 000000000000..1e52afc1116f --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the classes for ComputeBulkActions. + * Microsoft.ComputeBulkActions Resource Provider management API. + */ +package com.azure.resourcemanager.computebulkactions; diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/module-info.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/module-info.java new file mode 100644 index 000000000000..a399e30eb5d2 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/module-info.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +module com.azure.resourcemanager.computebulkactions { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.computebulkactions; + exports com.azure.resourcemanager.computebulkactions.fluent; + exports com.azure.resourcemanager.computebulkactions.fluent.models; + exports com.azure.resourcemanager.computebulkactions.models; + + opens com.azure.resourcemanager.computebulkactions.fluent.models to com.azure.core; + opens com.azure.resourcemanager.computebulkactions.models to com.azure.core; + opens com.azure.resourcemanager.computebulkactions.implementation.models to com.azure.core; +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/resources/META-INF/azure-resourcemanager-computebulkactions_apiview_properties.json b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/resources/META-INF/azure-resourcemanager-computebulkactions_apiview_properties.json new file mode 100644 index 000000000000..0fd07f4ad0c7 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/resources/META-INF/azure-resourcemanager-computebulkactions_apiview_properties.json @@ -0,0 +1,198 @@ +{ + "flavor": "azure", + "CrossLanguageDefinitionId": { + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient": "Microsoft.ComputeBulkActions.BulkActions", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.beginCancel": "Microsoft.ComputeBulkActions.BulkActions.cancel", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.beginCreateOrUpdate": "Microsoft.ComputeBulkActions.BulkActions.createOrUpdate", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.beginDelete": "Microsoft.ComputeBulkActions.BulkActions.delete", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.cancel": "Microsoft.ComputeBulkActions.BulkActions.cancel", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.createOrUpdate": "Microsoft.ComputeBulkActions.BulkActions.createOrUpdate", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.delete": "Microsoft.ComputeBulkActions.BulkActions.delete", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.get": "Microsoft.ComputeBulkActions.BulkActions.get", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.getOperationStatus": "Microsoft.ComputeBulkActions.BulkActions.getOperationStatus", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.getOperationStatusWithResponse": "Microsoft.ComputeBulkActions.BulkActions.getOperationStatus", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.getWithResponse": "Microsoft.ComputeBulkActions.BulkActions.get", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.listByResourceGroup": "Microsoft.ComputeBulkActions.BulkActions.listByResourceGroup", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.listBySubscription": "Microsoft.ComputeBulkActions.BulkActions.listBySubscription", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.listVirtualMachines": "Microsoft.ComputeBulkActions.BulkActions.listVirtualMachines", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesCancelOperations": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesCancelOperations", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesCancelOperationsWithResponse": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesCancelOperations", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesExecuteCreate": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteCreate", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesExecuteCreateWithResponse": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteCreate", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesExecuteDeallocate": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteDeallocate", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesExecuteDeallocateWithResponse": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteDeallocate", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesExecuteDelete": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteDelete", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesExecuteDeleteWithResponse": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteDelete", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesExecuteHibernate": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteHibernate", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesExecuteHibernateWithResponse": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteHibernate", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesExecuteStart": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteStart", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesExecuteStartWithResponse": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteStart", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesGetOperationStatus": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesGetOperationStatus", + "com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesGetOperationStatusWithResponse": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesGetOperationStatus", + "com.azure.resourcemanager.computebulkactions.fluent.ComputeBulkActionsManagementClient": "Microsoft.ComputeBulkActions", + "com.azure.resourcemanager.computebulkactions.fluent.OperationsClient": "Microsoft.ComputeBulkActions.Operations", + "com.azure.resourcemanager.computebulkactions.fluent.OperationsClient.list": "Azure.ResourceManager.Operations.list", + "com.azure.resourcemanager.computebulkactions.fluent.models.CancelOperationsResponseInner": "Microsoft.ComputeBulkActions.CancelOperationsResponse", + "com.azure.resourcemanager.computebulkactions.fluent.models.CreateResourceOperationResponseInner": "Microsoft.ComputeBulkActions.CreateResourceOperationResponse", + "com.azure.resourcemanager.computebulkactions.fluent.models.DeallocateResourceOperationResponseInner": "Microsoft.ComputeBulkActions.DeallocateResourceOperationResponse", + "com.azure.resourcemanager.computebulkactions.fluent.models.DeleteResourceOperationResponseInner": "Microsoft.ComputeBulkActions.DeleteResourceOperationResponse", + "com.azure.resourcemanager.computebulkactions.fluent.models.GetOperationStatusResponseInner": "Microsoft.ComputeBulkActions.GetOperationStatusResponse", + "com.azure.resourcemanager.computebulkactions.fluent.models.HibernateResourceOperationResponseInner": "Microsoft.ComputeBulkActions.HibernateResourceOperationResponse", + "com.azure.resourcemanager.computebulkactions.fluent.models.LocationBasedLaunchBulkInstancesOperationInner": "Microsoft.ComputeBulkActions.LocationBasedLaunchBulkInstancesOperation", + "com.azure.resourcemanager.computebulkactions.fluent.models.OperationInner": "Azure.ResourceManager.CommonTypes.Operation", + "com.azure.resourcemanager.computebulkactions.fluent.models.OperationStatusResultInner": "Azure.ResourceManager.CommonTypes.OperationStatusResult", + "com.azure.resourcemanager.computebulkactions.fluent.models.StartResourceOperationResponseInner": "Microsoft.ComputeBulkActions.StartResourceOperationResponse", + "com.azure.resourcemanager.computebulkactions.fluent.models.VirtualMachineInner": "Microsoft.ComputeBulkActions.VirtualMachine", + "com.azure.resourcemanager.computebulkactions.implementation.ComputeBulkActionsManagementClientBuilder": "Microsoft.ComputeBulkActions", + "com.azure.resourcemanager.computebulkactions.implementation.models.LaunchBulkInstancesOperationListResult": "Microsoft.ComputeBulkActions.LaunchBulkInstancesOperationListResult", + "com.azure.resourcemanager.computebulkactions.implementation.models.OperationListResult": "Azure.ResourceManager.CommonTypes.OperationListResult", + "com.azure.resourcemanager.computebulkactions.implementation.models.VirtualMachineListResult": "Microsoft.ComputeBulkActions.VirtualMachineListResult", + "com.azure.resourcemanager.computebulkactions.models.AcceleratorManufacturer": "Microsoft.ComputeBulkActions.AcceleratorManufacturer", + "com.azure.resourcemanager.computebulkactions.models.AcceleratorType": "Microsoft.ComputeBulkActions.AcceleratorType", + "com.azure.resourcemanager.computebulkactions.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", + "com.azure.resourcemanager.computebulkactions.models.AdditionalCapabilities": "Microsoft.ComputeBulkActions.AdditionalCapabilities", + "com.azure.resourcemanager.computebulkactions.models.AdditionalUnattendContent": "Microsoft.ComputeBulkActions.AdditionalUnattendContent", + "com.azure.resourcemanager.computebulkactions.models.AdditionalUnattendContentComponentName": null, + "com.azure.resourcemanager.computebulkactions.models.AdditionalUnattendContentPassName": null, + "com.azure.resourcemanager.computebulkactions.models.AllInstancesDown": "Microsoft.ComputeBulkActions.AllInstancesDown", + "com.azure.resourcemanager.computebulkactions.models.AllocationStrategy": "Microsoft.ComputeBulkActions.AllocationStrategy", + "com.azure.resourcemanager.computebulkactions.models.ApiEntityReference": "Microsoft.ComputeBulkActions.ApiEntityReference", + "com.azure.resourcemanager.computebulkactions.models.ApiError": "Microsoft.ComputeBulkActions.ApiError", + "com.azure.resourcemanager.computebulkactions.models.ApiErrorBase": "Microsoft.ComputeBulkActions.ApiErrorBase", + "com.azure.resourcemanager.computebulkactions.models.ApplicationProfile": "Microsoft.ComputeBulkActions.ApplicationProfile", + "com.azure.resourcemanager.computebulkactions.models.ArchitectureType": "Microsoft.ComputeBulkActions.ArchitectureType", + "com.azure.resourcemanager.computebulkactions.models.BootDiagnostics": "Microsoft.ComputeBulkActions.BootDiagnostics", + "com.azure.resourcemanager.computebulkactions.models.CachingTypes": "Microsoft.ComputeBulkActions.CachingTypes", + "com.azure.resourcemanager.computebulkactions.models.CancelOperationsRequest": "Microsoft.ComputeBulkActions.CancelOperationsRequest", + "com.azure.resourcemanager.computebulkactions.models.CapacityReservationProfile": "Microsoft.ComputeBulkActions.CapacityReservationProfile", + "com.azure.resourcemanager.computebulkactions.models.CapacityType": "Microsoft.ComputeBulkActions.CapacityType", + "com.azure.resourcemanager.computebulkactions.models.ComputeProfile": "Microsoft.ComputeBulkActions.ComputeProfile", + "com.azure.resourcemanager.computebulkactions.models.CpuManufacturer": "Microsoft.ComputeBulkActions.CpuManufacturer", + "com.azure.resourcemanager.computebulkactions.models.DataDisk": "Microsoft.ComputeBulkActions.DataDisk", + "com.azure.resourcemanager.computebulkactions.models.DeadlineType": "Microsoft.ComputeBulkActions.DeadlineType", + "com.azure.resourcemanager.computebulkactions.models.DeleteOptions": "Microsoft.ComputeBulkActions.DeleteOptions", + "com.azure.resourcemanager.computebulkactions.models.DiagnosticsProfile": "Microsoft.ComputeBulkActions.DiagnosticsProfile", + "com.azure.resourcemanager.computebulkactions.models.DiffDiskOptions": "Microsoft.ComputeBulkActions.DiffDiskOptions", + "com.azure.resourcemanager.computebulkactions.models.DiffDiskPlacement": "Microsoft.ComputeBulkActions.DiffDiskPlacement", + "com.azure.resourcemanager.computebulkactions.models.DiffDiskSettings": "Microsoft.ComputeBulkActions.DiffDiskSettings", + "com.azure.resourcemanager.computebulkactions.models.DiskControllerTypes": "Microsoft.ComputeBulkActions.DiskControllerTypes", + "com.azure.resourcemanager.computebulkactions.models.DiskCreateOptionTypes": "Microsoft.ComputeBulkActions.DiskCreateOptionTypes", + "com.azure.resourcemanager.computebulkactions.models.DiskDeleteOptionTypes": "Microsoft.ComputeBulkActions.DiskDeleteOptionTypes", + "com.azure.resourcemanager.computebulkactions.models.DiskDetachOptionTypes": "Microsoft.ComputeBulkActions.DiskDetachOptionTypes", + "com.azure.resourcemanager.computebulkactions.models.DiskEncryptionSetParameters": "Microsoft.ComputeBulkActions.DiskEncryptionSetParameters", + "com.azure.resourcemanager.computebulkactions.models.DiskEncryptionSettings": "Microsoft.ComputeBulkActions.DiskEncryptionSettings", + "com.azure.resourcemanager.computebulkactions.models.DomainNameLabelScopeTypes": "Microsoft.ComputeBulkActions.DomainNameLabelScopeTypes", + "com.azure.resourcemanager.computebulkactions.models.EncryptionIdentity": "Microsoft.ComputeBulkActions.EncryptionIdentity", + "com.azure.resourcemanager.computebulkactions.models.EventGridAndResourceGraph": "Microsoft.ComputeBulkActions.EventGridAndResourceGraph", + "com.azure.resourcemanager.computebulkactions.models.EvictionPolicy": "Microsoft.ComputeBulkActions.EvictionPolicy", + "com.azure.resourcemanager.computebulkactions.models.ExecuteCreateRequest": "Microsoft.ComputeBulkActions.ExecuteCreateRequest", + "com.azure.resourcemanager.computebulkactions.models.ExecuteDeallocateRequest": "Microsoft.ComputeBulkActions.ExecuteDeallocateRequest", + "com.azure.resourcemanager.computebulkactions.models.ExecuteDeleteRequest": "Microsoft.ComputeBulkActions.ExecuteDeleteRequest", + "com.azure.resourcemanager.computebulkactions.models.ExecuteHibernateRequest": "Microsoft.ComputeBulkActions.ExecuteHibernateRequest", + "com.azure.resourcemanager.computebulkactions.models.ExecuteStartRequest": "Microsoft.ComputeBulkActions.ExecuteStartRequest", + "com.azure.resourcemanager.computebulkactions.models.ExecutionParameters": "Microsoft.ComputeBulkActions.ExecutionParameters", + "com.azure.resourcemanager.computebulkactions.models.GetOperationStatusRequest": "Microsoft.ComputeBulkActions.GetOperationStatusRequest", + "com.azure.resourcemanager.computebulkactions.models.HostEndpointSettings": "Microsoft.ComputeBulkActions.HostEndpointSettings", + "com.azure.resourcemanager.computebulkactions.models.HyperVGeneration": "Microsoft.ComputeBulkActions.HyperVGeneration", + "com.azure.resourcemanager.computebulkactions.models.IPVersions": "Microsoft.ComputeBulkActions.IPVersions", + "com.azure.resourcemanager.computebulkactions.models.ImageReference": "Microsoft.ComputeBulkActions.ImageReference", + "com.azure.resourcemanager.computebulkactions.models.InnerError": "Microsoft.ComputeBulkActions.InnerError", + "com.azure.resourcemanager.computebulkactions.models.KeyVaultKeyReference": "Microsoft.ComputeBulkActions.KeyVaultKeyReference", + "com.azure.resourcemanager.computebulkactions.models.KeyVaultSecretReference": "Microsoft.ComputeBulkActions.KeyVaultSecretReference", + "com.azure.resourcemanager.computebulkactions.models.LaunchBulkInstancesOperationProperties": "Microsoft.ComputeBulkActions.LaunchBulkInstancesOperationProperties", + "com.azure.resourcemanager.computebulkactions.models.LinuxConfiguration": "Microsoft.ComputeBulkActions.LinuxConfiguration", + "com.azure.resourcemanager.computebulkactions.models.LinuxPatchAssessmentMode": "Microsoft.ComputeBulkActions.LinuxPatchAssessmentMode", + "com.azure.resourcemanager.computebulkactions.models.LinuxPatchSettings": "Microsoft.ComputeBulkActions.LinuxPatchSettings", + "com.azure.resourcemanager.computebulkactions.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting": "Microsoft.ComputeBulkActions.LinuxVMGuestPatchAutomaticByPlatformRebootSetting", + "com.azure.resourcemanager.computebulkactions.models.LinuxVMGuestPatchAutomaticByPlatformSettings": "Microsoft.ComputeBulkActions.LinuxVMGuestPatchAutomaticByPlatformSettings", + "com.azure.resourcemanager.computebulkactions.models.LinuxVMGuestPatchMode": "Microsoft.ComputeBulkActions.LinuxVMGuestPatchMode", + "com.azure.resourcemanager.computebulkactions.models.LocalStorageDiskType": "Microsoft.ComputeBulkActions.LocalStorageDiskType", + "com.azure.resourcemanager.computebulkactions.models.ManagedDiskParameters": "Microsoft.ComputeBulkActions.ManagedDiskParameters", + "com.azure.resourcemanager.computebulkactions.models.ManagedServiceIdentity": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", + "com.azure.resourcemanager.computebulkactions.models.ManagedServiceIdentityType": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", + "com.azure.resourcemanager.computebulkactions.models.Mode": "Microsoft.ComputeBulkActions.Mode", + "com.azure.resourcemanager.computebulkactions.models.Modes": "Microsoft.ComputeBulkActions.Modes", + "com.azure.resourcemanager.computebulkactions.models.NetworkApiVersion": "Microsoft.ComputeBulkActions.NetworkApiVersion", + "com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceAuxiliaryMode": "Microsoft.ComputeBulkActions.NetworkInterfaceAuxiliaryMode", + "com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceAuxiliarySku": "Microsoft.ComputeBulkActions.NetworkInterfaceAuxiliarySku", + "com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceReference": "Microsoft.ComputeBulkActions.NetworkInterfaceReference", + "com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceReferenceProperties": "Microsoft.ComputeBulkActions.NetworkInterfaceReferenceProperties", + "com.azure.resourcemanager.computebulkactions.models.NetworkProfile": "Microsoft.ComputeBulkActions.NetworkProfile", + "com.azure.resourcemanager.computebulkactions.models.OSDisk": "Microsoft.ComputeBulkActions.OSDisk", + "com.azure.resourcemanager.computebulkactions.models.OSImageNotificationProfile": "Microsoft.ComputeBulkActions.OSImageNotificationProfile", + "com.azure.resourcemanager.computebulkactions.models.OSProfile": "Microsoft.ComputeBulkActions.OSProfile", + "com.azure.resourcemanager.computebulkactions.models.OperatingSystemTypes": "Microsoft.ComputeBulkActions.OperatingSystemTypes", + "com.azure.resourcemanager.computebulkactions.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "com.azure.resourcemanager.computebulkactions.models.OperationState": "Microsoft.ComputeBulkActions.OperationState", + "com.azure.resourcemanager.computebulkactions.models.OptimizationPreference": "Microsoft.ComputeBulkActions.OptimizationPreference", + "com.azure.resourcemanager.computebulkactions.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", + "com.azure.resourcemanager.computebulkactions.models.PatchSettings": "Microsoft.ComputeBulkActions.PatchSettings", + "com.azure.resourcemanager.computebulkactions.models.Plan": "Azure.ResourceManager.CommonTypes.Plan", + "com.azure.resourcemanager.computebulkactions.models.PriorityProfile": "Microsoft.ComputeBulkActions.PriorityProfile", + "com.azure.resourcemanager.computebulkactions.models.ProtocolTypes": "Microsoft.ComputeBulkActions.ProtocolTypes", + "com.azure.resourcemanager.computebulkactions.models.ProvisioningState": "Microsoft.ComputeBulkActions.ProvisioningState", + "com.azure.resourcemanager.computebulkactions.models.ProxyAgentSettings": "Microsoft.ComputeBulkActions.ProxyAgentSettings", + "com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSku": "Microsoft.ComputeBulkActions.PublicIPAddressSku", + "com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSkuName": "Microsoft.ComputeBulkActions.PublicIPAddressSkuName", + "com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSkuTier": "Microsoft.ComputeBulkActions.PublicIPAddressSkuTier", + "com.azure.resourcemanager.computebulkactions.models.PublicIPAllocationMethod": "Microsoft.ComputeBulkActions.PublicIPAllocationMethod", + "com.azure.resourcemanager.computebulkactions.models.ResourceOperation": "Microsoft.ComputeBulkActions.ResourceOperation", + "com.azure.resourcemanager.computebulkactions.models.ResourceOperationDetails": "Microsoft.ComputeBulkActions.ResourceOperationDetails", + "com.azure.resourcemanager.computebulkactions.models.ResourceOperationError": "Microsoft.ComputeBulkActions.ResourceOperationError", + "com.azure.resourcemanager.computebulkactions.models.ResourceOperationType": "Microsoft.ComputeBulkActions.ResourceOperationType", + "com.azure.resourcemanager.computebulkactions.models.ResourceProvisionPayload": "Microsoft.ComputeBulkActions.ResourceProvisionPayload", + "com.azure.resourcemanager.computebulkactions.models.Resources": "Microsoft.ComputeBulkActions.Resources", + "com.azure.resourcemanager.computebulkactions.models.RetryPolicy": "Microsoft.ComputeBulkActions.RetryPolicy", + "com.azure.resourcemanager.computebulkactions.models.ScheduledEventsAdditionalPublishingTargets": "Microsoft.ComputeBulkActions.ScheduledEventsAdditionalPublishingTargets", + "com.azure.resourcemanager.computebulkactions.models.ScheduledEventsPolicy": "Microsoft.ComputeBulkActions.ScheduledEventsPolicy", + "com.azure.resourcemanager.computebulkactions.models.ScheduledEventsProfile": "Microsoft.ComputeBulkActions.ScheduledEventsProfile", + "com.azure.resourcemanager.computebulkactions.models.SecurityEncryptionTypes": "Microsoft.ComputeBulkActions.SecurityEncryptionTypes", + "com.azure.resourcemanager.computebulkactions.models.SecurityProfile": "Microsoft.ComputeBulkActions.SecurityProfile", + "com.azure.resourcemanager.computebulkactions.models.SecurityTypes": "Microsoft.ComputeBulkActions.SecurityTypes", + "com.azure.resourcemanager.computebulkactions.models.SettingNames": "Microsoft.ComputeBulkActions.SettingNames", + "com.azure.resourcemanager.computebulkactions.models.SshConfiguration": "Microsoft.ComputeBulkActions.SshConfiguration", + "com.azure.resourcemanager.computebulkactions.models.SshPublicKey": "Microsoft.ComputeBulkActions.SshPublicKey", + "com.azure.resourcemanager.computebulkactions.models.StorageAccountTypes": "Microsoft.ComputeBulkActions.StorageAccountTypes", + "com.azure.resourcemanager.computebulkactions.models.StorageProfile": "Microsoft.ComputeBulkActions.StorageProfile", + "com.azure.resourcemanager.computebulkactions.models.TerminateNotificationProfile": "Microsoft.ComputeBulkActions.TerminateNotificationProfile", + "com.azure.resourcemanager.computebulkactions.models.UefiSettings": "Microsoft.ComputeBulkActions.UefiSettings", + "com.azure.resourcemanager.computebulkactions.models.UserAssignedIdentity": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", + "com.azure.resourcemanager.computebulkactions.models.UserInitiatedReboot": "Microsoft.ComputeBulkActions.UserInitiatedReboot", + "com.azure.resourcemanager.computebulkactions.models.UserInitiatedRedeploy": "Microsoft.ComputeBulkActions.UserInitiatedRedeploy", + "com.azure.resourcemanager.computebulkactions.models.VMAttributeMinMaxDouble": "Microsoft.ComputeBulkActions.VMAttributeMinMaxDouble", + "com.azure.resourcemanager.computebulkactions.models.VMAttributeMinMaxInteger": "Microsoft.ComputeBulkActions.VMAttributeMinMaxInteger", + "com.azure.resourcemanager.computebulkactions.models.VMAttributeSupport": "Microsoft.ComputeBulkActions.VMAttributeSupport", + "com.azure.resourcemanager.computebulkactions.models.VMAttributes": "Microsoft.ComputeBulkActions.VMAttributes", + "com.azure.resourcemanager.computebulkactions.models.VMCategory": "Microsoft.ComputeBulkActions.VMCategory", + "com.azure.resourcemanager.computebulkactions.models.VMDiskSecurityProfile": "Microsoft.ComputeBulkActions.VMDiskSecurityProfile", + "com.azure.resourcemanager.computebulkactions.models.VMGalleryApplication": "Microsoft.ComputeBulkActions.VMGalleryApplication", + "com.azure.resourcemanager.computebulkactions.models.VMOperationStatus": "Microsoft.ComputeBulkActions.VMOperationStatus", + "com.azure.resourcemanager.computebulkactions.models.VaultCertificate": "Microsoft.ComputeBulkActions.VaultCertificate", + "com.azure.resourcemanager.computebulkactions.models.VaultSecretGroup": "Microsoft.ComputeBulkActions.VaultSecretGroup", + "com.azure.resourcemanager.computebulkactions.models.VirtualHardDisk": "Microsoft.ComputeBulkActions.VirtualHardDisk", + "com.azure.resourcemanager.computebulkactions.models.VirtualMachineExtension": "Microsoft.ComputeBulkActions.VirtualMachineExtension", + "com.azure.resourcemanager.computebulkactions.models.VirtualMachineExtensionProperties": "Microsoft.ComputeBulkActions.VirtualMachineExtensionProperties", + "com.azure.resourcemanager.computebulkactions.models.VirtualMachineIpTag": "Microsoft.ComputeBulkActions.VirtualMachineIpTag", + "com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceConfiguration": "Microsoft.ComputeBulkActions.VirtualMachineNetworkInterfaceConfiguration", + "com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceConfigurationProperties": "Microsoft.ComputeBulkActions.VirtualMachineNetworkInterfaceConfigurationProperties", + "com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceDnsSettingsConfiguration": "Microsoft.ComputeBulkActions.VirtualMachineNetworkInterfaceDnsSettingsConfiguration", + "com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceIPConfiguration": "Microsoft.ComputeBulkActions.VirtualMachineNetworkInterfaceIPConfiguration", + "com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceIPConfigurationProperties": "Microsoft.ComputeBulkActions.VirtualMachineNetworkInterfaceIPConfigurationProperties", + "com.azure.resourcemanager.computebulkactions.models.VirtualMachineProfile": "Microsoft.ComputeBulkActions.VirtualMachineProfile", + "com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressConfiguration": "Microsoft.ComputeBulkActions.VirtualMachinePublicIPAddressConfiguration", + "com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressConfigurationProperties": "Microsoft.ComputeBulkActions.VirtualMachinePublicIPAddressConfigurationProperties", + "com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressDnsSettingsConfiguration": "Microsoft.ComputeBulkActions.VirtualMachinePublicIPAddressDnsSettingsConfiguration", + "com.azure.resourcemanager.computebulkactions.models.VirtualMachineType": "Microsoft.ComputeBulkActions.VirtualMachineType", + "com.azure.resourcemanager.computebulkactions.models.VmSizeProfile": "Microsoft.ComputeBulkActions.VmSizeProfile", + "com.azure.resourcemanager.computebulkactions.models.WinRMConfiguration": "Microsoft.ComputeBulkActions.WinRMConfiguration", + "com.azure.resourcemanager.computebulkactions.models.WinRMListener": "Microsoft.ComputeBulkActions.WinRMListener", + "com.azure.resourcemanager.computebulkactions.models.WindowsConfiguration": "Microsoft.ComputeBulkActions.WindowsConfiguration", + "com.azure.resourcemanager.computebulkactions.models.WindowsPatchAssessmentMode": "Microsoft.ComputeBulkActions.WindowsPatchAssessmentMode", + "com.azure.resourcemanager.computebulkactions.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting": "Microsoft.ComputeBulkActions.WindowsVMGuestPatchAutomaticByPlatformRebootSetting", + "com.azure.resourcemanager.computebulkactions.models.WindowsVMGuestPatchAutomaticByPlatformSettings": "Microsoft.ComputeBulkActions.WindowsVMGuestPatchAutomaticByPlatformSettings", + "com.azure.resourcemanager.computebulkactions.models.WindowsVMGuestPatchMode": "Microsoft.ComputeBulkActions.WindowsVMGuestPatchMode", + "com.azure.resourcemanager.computebulkactions.models.ZoneAllocationPolicy": "Microsoft.ComputeBulkActions.ZoneAllocationPolicy", + "com.azure.resourcemanager.computebulkactions.models.ZoneDistributionStrategy": "Microsoft.ComputeBulkActions.ZoneDistributionStrategy", + "com.azure.resourcemanager.computebulkactions.models.ZonePreference": "Microsoft.ComputeBulkActions.ZonePreference" + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/resources/META-INF/azure-resourcemanager-computebulkactions_metadata.json b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/resources/META-INF/azure-resourcemanager-computebulkactions_metadata.json new file mode 100644 index 000000000000..2113d595cb39 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/resources/META-INF/azure-resourcemanager-computebulkactions_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersion":"2026-02-01-preview","crossLanguageDefinitions":{"com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient":"Microsoft.ComputeBulkActions.BulkActions","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.beginCancel":"Microsoft.ComputeBulkActions.BulkActions.cancel","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.beginCreateOrUpdate":"Microsoft.ComputeBulkActions.BulkActions.createOrUpdate","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.beginDelete":"Microsoft.ComputeBulkActions.BulkActions.delete","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.cancel":"Microsoft.ComputeBulkActions.BulkActions.cancel","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.createOrUpdate":"Microsoft.ComputeBulkActions.BulkActions.createOrUpdate","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.delete":"Microsoft.ComputeBulkActions.BulkActions.delete","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.get":"Microsoft.ComputeBulkActions.BulkActions.get","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.getOperationStatus":"Microsoft.ComputeBulkActions.BulkActions.getOperationStatus","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.getOperationStatusWithResponse":"Microsoft.ComputeBulkActions.BulkActions.getOperationStatus","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.getWithResponse":"Microsoft.ComputeBulkActions.BulkActions.get","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.listByResourceGroup":"Microsoft.ComputeBulkActions.BulkActions.listByResourceGroup","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.listBySubscription":"Microsoft.ComputeBulkActions.BulkActions.listBySubscription","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.listVirtualMachines":"Microsoft.ComputeBulkActions.BulkActions.listVirtualMachines","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesCancelOperations":"Microsoft.ComputeBulkActions.BulkActions.virtualMachinesCancelOperations","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesCancelOperationsWithResponse":"Microsoft.ComputeBulkActions.BulkActions.virtualMachinesCancelOperations","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesExecuteCreate":"Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteCreate","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesExecuteCreateWithResponse":"Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteCreate","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesExecuteDeallocate":"Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteDeallocate","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesExecuteDeallocateWithResponse":"Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteDeallocate","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesExecuteDelete":"Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteDelete","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesExecuteDeleteWithResponse":"Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteDelete","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesExecuteHibernate":"Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteHibernate","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesExecuteHibernateWithResponse":"Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteHibernate","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesExecuteStart":"Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteStart","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesExecuteStartWithResponse":"Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteStart","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesGetOperationStatus":"Microsoft.ComputeBulkActions.BulkActions.virtualMachinesGetOperationStatus","com.azure.resourcemanager.computebulkactions.fluent.BulkActionsClient.virtualMachinesGetOperationStatusWithResponse":"Microsoft.ComputeBulkActions.BulkActions.virtualMachinesGetOperationStatus","com.azure.resourcemanager.computebulkactions.fluent.ComputeBulkActionsManagementClient":"Microsoft.ComputeBulkActions","com.azure.resourcemanager.computebulkactions.fluent.OperationsClient":"Microsoft.ComputeBulkActions.Operations","com.azure.resourcemanager.computebulkactions.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.computebulkactions.fluent.models.CancelOperationsResponseInner":"Microsoft.ComputeBulkActions.CancelOperationsResponse","com.azure.resourcemanager.computebulkactions.fluent.models.CreateResourceOperationResponseInner":"Microsoft.ComputeBulkActions.CreateResourceOperationResponse","com.azure.resourcemanager.computebulkactions.fluent.models.DeallocateResourceOperationResponseInner":"Microsoft.ComputeBulkActions.DeallocateResourceOperationResponse","com.azure.resourcemanager.computebulkactions.fluent.models.DeleteResourceOperationResponseInner":"Microsoft.ComputeBulkActions.DeleteResourceOperationResponse","com.azure.resourcemanager.computebulkactions.fluent.models.GetOperationStatusResponseInner":"Microsoft.ComputeBulkActions.GetOperationStatusResponse","com.azure.resourcemanager.computebulkactions.fluent.models.HibernateResourceOperationResponseInner":"Microsoft.ComputeBulkActions.HibernateResourceOperationResponse","com.azure.resourcemanager.computebulkactions.fluent.models.LocationBasedLaunchBulkInstancesOperationInner":"Microsoft.ComputeBulkActions.LocationBasedLaunchBulkInstancesOperation","com.azure.resourcemanager.computebulkactions.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.computebulkactions.fluent.models.OperationStatusResultInner":"Azure.ResourceManager.CommonTypes.OperationStatusResult","com.azure.resourcemanager.computebulkactions.fluent.models.StartResourceOperationResponseInner":"Microsoft.ComputeBulkActions.StartResourceOperationResponse","com.azure.resourcemanager.computebulkactions.fluent.models.VirtualMachineInner":"Microsoft.ComputeBulkActions.VirtualMachine","com.azure.resourcemanager.computebulkactions.implementation.ComputeBulkActionsManagementClientBuilder":"Microsoft.ComputeBulkActions","com.azure.resourcemanager.computebulkactions.implementation.models.LaunchBulkInstancesOperationListResult":"Microsoft.ComputeBulkActions.LaunchBulkInstancesOperationListResult","com.azure.resourcemanager.computebulkactions.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.computebulkactions.implementation.models.VirtualMachineListResult":"Microsoft.ComputeBulkActions.VirtualMachineListResult","com.azure.resourcemanager.computebulkactions.models.AcceleratorManufacturer":"Microsoft.ComputeBulkActions.AcceleratorManufacturer","com.azure.resourcemanager.computebulkactions.models.AcceleratorType":"Microsoft.ComputeBulkActions.AcceleratorType","com.azure.resourcemanager.computebulkactions.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.computebulkactions.models.AdditionalCapabilities":"Microsoft.ComputeBulkActions.AdditionalCapabilities","com.azure.resourcemanager.computebulkactions.models.AdditionalUnattendContent":"Microsoft.ComputeBulkActions.AdditionalUnattendContent","com.azure.resourcemanager.computebulkactions.models.AdditionalUnattendContentComponentName":null,"com.azure.resourcemanager.computebulkactions.models.AdditionalUnattendContentPassName":null,"com.azure.resourcemanager.computebulkactions.models.AllInstancesDown":"Microsoft.ComputeBulkActions.AllInstancesDown","com.azure.resourcemanager.computebulkactions.models.AllocationStrategy":"Microsoft.ComputeBulkActions.AllocationStrategy","com.azure.resourcemanager.computebulkactions.models.ApiEntityReference":"Microsoft.ComputeBulkActions.ApiEntityReference","com.azure.resourcemanager.computebulkactions.models.ApiError":"Microsoft.ComputeBulkActions.ApiError","com.azure.resourcemanager.computebulkactions.models.ApiErrorBase":"Microsoft.ComputeBulkActions.ApiErrorBase","com.azure.resourcemanager.computebulkactions.models.ApplicationProfile":"Microsoft.ComputeBulkActions.ApplicationProfile","com.azure.resourcemanager.computebulkactions.models.ArchitectureType":"Microsoft.ComputeBulkActions.ArchitectureType","com.azure.resourcemanager.computebulkactions.models.BootDiagnostics":"Microsoft.ComputeBulkActions.BootDiagnostics","com.azure.resourcemanager.computebulkactions.models.CachingTypes":"Microsoft.ComputeBulkActions.CachingTypes","com.azure.resourcemanager.computebulkactions.models.CancelOperationsRequest":"Microsoft.ComputeBulkActions.CancelOperationsRequest","com.azure.resourcemanager.computebulkactions.models.CapacityReservationProfile":"Microsoft.ComputeBulkActions.CapacityReservationProfile","com.azure.resourcemanager.computebulkactions.models.CapacityType":"Microsoft.ComputeBulkActions.CapacityType","com.azure.resourcemanager.computebulkactions.models.ComputeProfile":"Microsoft.ComputeBulkActions.ComputeProfile","com.azure.resourcemanager.computebulkactions.models.CpuManufacturer":"Microsoft.ComputeBulkActions.CpuManufacturer","com.azure.resourcemanager.computebulkactions.models.DataDisk":"Microsoft.ComputeBulkActions.DataDisk","com.azure.resourcemanager.computebulkactions.models.DeadlineType":"Microsoft.ComputeBulkActions.DeadlineType","com.azure.resourcemanager.computebulkactions.models.DeleteOptions":"Microsoft.ComputeBulkActions.DeleteOptions","com.azure.resourcemanager.computebulkactions.models.DiagnosticsProfile":"Microsoft.ComputeBulkActions.DiagnosticsProfile","com.azure.resourcemanager.computebulkactions.models.DiffDiskOptions":"Microsoft.ComputeBulkActions.DiffDiskOptions","com.azure.resourcemanager.computebulkactions.models.DiffDiskPlacement":"Microsoft.ComputeBulkActions.DiffDiskPlacement","com.azure.resourcemanager.computebulkactions.models.DiffDiskSettings":"Microsoft.ComputeBulkActions.DiffDiskSettings","com.azure.resourcemanager.computebulkactions.models.DiskControllerTypes":"Microsoft.ComputeBulkActions.DiskControllerTypes","com.azure.resourcemanager.computebulkactions.models.DiskCreateOptionTypes":"Microsoft.ComputeBulkActions.DiskCreateOptionTypes","com.azure.resourcemanager.computebulkactions.models.DiskDeleteOptionTypes":"Microsoft.ComputeBulkActions.DiskDeleteOptionTypes","com.azure.resourcemanager.computebulkactions.models.DiskDetachOptionTypes":"Microsoft.ComputeBulkActions.DiskDetachOptionTypes","com.azure.resourcemanager.computebulkactions.models.DiskEncryptionSetParameters":"Microsoft.ComputeBulkActions.DiskEncryptionSetParameters","com.azure.resourcemanager.computebulkactions.models.DiskEncryptionSettings":"Microsoft.ComputeBulkActions.DiskEncryptionSettings","com.azure.resourcemanager.computebulkactions.models.DomainNameLabelScopeTypes":"Microsoft.ComputeBulkActions.DomainNameLabelScopeTypes","com.azure.resourcemanager.computebulkactions.models.EncryptionIdentity":"Microsoft.ComputeBulkActions.EncryptionIdentity","com.azure.resourcemanager.computebulkactions.models.EventGridAndResourceGraph":"Microsoft.ComputeBulkActions.EventGridAndResourceGraph","com.azure.resourcemanager.computebulkactions.models.EvictionPolicy":"Microsoft.ComputeBulkActions.EvictionPolicy","com.azure.resourcemanager.computebulkactions.models.ExecuteCreateRequest":"Microsoft.ComputeBulkActions.ExecuteCreateRequest","com.azure.resourcemanager.computebulkactions.models.ExecuteDeallocateRequest":"Microsoft.ComputeBulkActions.ExecuteDeallocateRequest","com.azure.resourcemanager.computebulkactions.models.ExecuteDeleteRequest":"Microsoft.ComputeBulkActions.ExecuteDeleteRequest","com.azure.resourcemanager.computebulkactions.models.ExecuteHibernateRequest":"Microsoft.ComputeBulkActions.ExecuteHibernateRequest","com.azure.resourcemanager.computebulkactions.models.ExecuteStartRequest":"Microsoft.ComputeBulkActions.ExecuteStartRequest","com.azure.resourcemanager.computebulkactions.models.ExecutionParameters":"Microsoft.ComputeBulkActions.ExecutionParameters","com.azure.resourcemanager.computebulkactions.models.GetOperationStatusRequest":"Microsoft.ComputeBulkActions.GetOperationStatusRequest","com.azure.resourcemanager.computebulkactions.models.HostEndpointSettings":"Microsoft.ComputeBulkActions.HostEndpointSettings","com.azure.resourcemanager.computebulkactions.models.HyperVGeneration":"Microsoft.ComputeBulkActions.HyperVGeneration","com.azure.resourcemanager.computebulkactions.models.IPVersions":"Microsoft.ComputeBulkActions.IPVersions","com.azure.resourcemanager.computebulkactions.models.ImageReference":"Microsoft.ComputeBulkActions.ImageReference","com.azure.resourcemanager.computebulkactions.models.InnerError":"Microsoft.ComputeBulkActions.InnerError","com.azure.resourcemanager.computebulkactions.models.KeyVaultKeyReference":"Microsoft.ComputeBulkActions.KeyVaultKeyReference","com.azure.resourcemanager.computebulkactions.models.KeyVaultSecretReference":"Microsoft.ComputeBulkActions.KeyVaultSecretReference","com.azure.resourcemanager.computebulkactions.models.LaunchBulkInstancesOperationProperties":"Microsoft.ComputeBulkActions.LaunchBulkInstancesOperationProperties","com.azure.resourcemanager.computebulkactions.models.LinuxConfiguration":"Microsoft.ComputeBulkActions.LinuxConfiguration","com.azure.resourcemanager.computebulkactions.models.LinuxPatchAssessmentMode":"Microsoft.ComputeBulkActions.LinuxPatchAssessmentMode","com.azure.resourcemanager.computebulkactions.models.LinuxPatchSettings":"Microsoft.ComputeBulkActions.LinuxPatchSettings","com.azure.resourcemanager.computebulkactions.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting":"Microsoft.ComputeBulkActions.LinuxVMGuestPatchAutomaticByPlatformRebootSetting","com.azure.resourcemanager.computebulkactions.models.LinuxVMGuestPatchAutomaticByPlatformSettings":"Microsoft.ComputeBulkActions.LinuxVMGuestPatchAutomaticByPlatformSettings","com.azure.resourcemanager.computebulkactions.models.LinuxVMGuestPatchMode":"Microsoft.ComputeBulkActions.LinuxVMGuestPatchMode","com.azure.resourcemanager.computebulkactions.models.LocalStorageDiskType":"Microsoft.ComputeBulkActions.LocalStorageDiskType","com.azure.resourcemanager.computebulkactions.models.ManagedDiskParameters":"Microsoft.ComputeBulkActions.ManagedDiskParameters","com.azure.resourcemanager.computebulkactions.models.ManagedServiceIdentity":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentity","com.azure.resourcemanager.computebulkactions.models.ManagedServiceIdentityType":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType","com.azure.resourcemanager.computebulkactions.models.Mode":"Microsoft.ComputeBulkActions.Mode","com.azure.resourcemanager.computebulkactions.models.Modes":"Microsoft.ComputeBulkActions.Modes","com.azure.resourcemanager.computebulkactions.models.NetworkApiVersion":"Microsoft.ComputeBulkActions.NetworkApiVersion","com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceAuxiliaryMode":"Microsoft.ComputeBulkActions.NetworkInterfaceAuxiliaryMode","com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceAuxiliarySku":"Microsoft.ComputeBulkActions.NetworkInterfaceAuxiliarySku","com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceReference":"Microsoft.ComputeBulkActions.NetworkInterfaceReference","com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceReferenceProperties":"Microsoft.ComputeBulkActions.NetworkInterfaceReferenceProperties","com.azure.resourcemanager.computebulkactions.models.NetworkProfile":"Microsoft.ComputeBulkActions.NetworkProfile","com.azure.resourcemanager.computebulkactions.models.OSDisk":"Microsoft.ComputeBulkActions.OSDisk","com.azure.resourcemanager.computebulkactions.models.OSImageNotificationProfile":"Microsoft.ComputeBulkActions.OSImageNotificationProfile","com.azure.resourcemanager.computebulkactions.models.OSProfile":"Microsoft.ComputeBulkActions.OSProfile","com.azure.resourcemanager.computebulkactions.models.OperatingSystemTypes":"Microsoft.ComputeBulkActions.OperatingSystemTypes","com.azure.resourcemanager.computebulkactions.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.computebulkactions.models.OperationState":"Microsoft.ComputeBulkActions.OperationState","com.azure.resourcemanager.computebulkactions.models.OptimizationPreference":"Microsoft.ComputeBulkActions.OptimizationPreference","com.azure.resourcemanager.computebulkactions.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.computebulkactions.models.PatchSettings":"Microsoft.ComputeBulkActions.PatchSettings","com.azure.resourcemanager.computebulkactions.models.Plan":"Azure.ResourceManager.CommonTypes.Plan","com.azure.resourcemanager.computebulkactions.models.PriorityProfile":"Microsoft.ComputeBulkActions.PriorityProfile","com.azure.resourcemanager.computebulkactions.models.ProtocolTypes":"Microsoft.ComputeBulkActions.ProtocolTypes","com.azure.resourcemanager.computebulkactions.models.ProvisioningState":"Microsoft.ComputeBulkActions.ProvisioningState","com.azure.resourcemanager.computebulkactions.models.ProxyAgentSettings":"Microsoft.ComputeBulkActions.ProxyAgentSettings","com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSku":"Microsoft.ComputeBulkActions.PublicIPAddressSku","com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSkuName":"Microsoft.ComputeBulkActions.PublicIPAddressSkuName","com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSkuTier":"Microsoft.ComputeBulkActions.PublicIPAddressSkuTier","com.azure.resourcemanager.computebulkactions.models.PublicIPAllocationMethod":"Microsoft.ComputeBulkActions.PublicIPAllocationMethod","com.azure.resourcemanager.computebulkactions.models.ResourceOperation":"Microsoft.ComputeBulkActions.ResourceOperation","com.azure.resourcemanager.computebulkactions.models.ResourceOperationDetails":"Microsoft.ComputeBulkActions.ResourceOperationDetails","com.azure.resourcemanager.computebulkactions.models.ResourceOperationError":"Microsoft.ComputeBulkActions.ResourceOperationError","com.azure.resourcemanager.computebulkactions.models.ResourceOperationType":"Microsoft.ComputeBulkActions.ResourceOperationType","com.azure.resourcemanager.computebulkactions.models.ResourceProvisionPayload":"Microsoft.ComputeBulkActions.ResourceProvisionPayload","com.azure.resourcemanager.computebulkactions.models.Resources":"Microsoft.ComputeBulkActions.Resources","com.azure.resourcemanager.computebulkactions.models.RetryPolicy":"Microsoft.ComputeBulkActions.RetryPolicy","com.azure.resourcemanager.computebulkactions.models.ScheduledEventsAdditionalPublishingTargets":"Microsoft.ComputeBulkActions.ScheduledEventsAdditionalPublishingTargets","com.azure.resourcemanager.computebulkactions.models.ScheduledEventsPolicy":"Microsoft.ComputeBulkActions.ScheduledEventsPolicy","com.azure.resourcemanager.computebulkactions.models.ScheduledEventsProfile":"Microsoft.ComputeBulkActions.ScheduledEventsProfile","com.azure.resourcemanager.computebulkactions.models.SecurityEncryptionTypes":"Microsoft.ComputeBulkActions.SecurityEncryptionTypes","com.azure.resourcemanager.computebulkactions.models.SecurityProfile":"Microsoft.ComputeBulkActions.SecurityProfile","com.azure.resourcemanager.computebulkactions.models.SecurityTypes":"Microsoft.ComputeBulkActions.SecurityTypes","com.azure.resourcemanager.computebulkactions.models.SettingNames":"Microsoft.ComputeBulkActions.SettingNames","com.azure.resourcemanager.computebulkactions.models.SshConfiguration":"Microsoft.ComputeBulkActions.SshConfiguration","com.azure.resourcemanager.computebulkactions.models.SshPublicKey":"Microsoft.ComputeBulkActions.SshPublicKey","com.azure.resourcemanager.computebulkactions.models.StorageAccountTypes":"Microsoft.ComputeBulkActions.StorageAccountTypes","com.azure.resourcemanager.computebulkactions.models.StorageProfile":"Microsoft.ComputeBulkActions.StorageProfile","com.azure.resourcemanager.computebulkactions.models.TerminateNotificationProfile":"Microsoft.ComputeBulkActions.TerminateNotificationProfile","com.azure.resourcemanager.computebulkactions.models.UefiSettings":"Microsoft.ComputeBulkActions.UefiSettings","com.azure.resourcemanager.computebulkactions.models.UserAssignedIdentity":"Azure.ResourceManager.CommonTypes.UserAssignedIdentity","com.azure.resourcemanager.computebulkactions.models.UserInitiatedReboot":"Microsoft.ComputeBulkActions.UserInitiatedReboot","com.azure.resourcemanager.computebulkactions.models.UserInitiatedRedeploy":"Microsoft.ComputeBulkActions.UserInitiatedRedeploy","com.azure.resourcemanager.computebulkactions.models.VMAttributeMinMaxDouble":"Microsoft.ComputeBulkActions.VMAttributeMinMaxDouble","com.azure.resourcemanager.computebulkactions.models.VMAttributeMinMaxInteger":"Microsoft.ComputeBulkActions.VMAttributeMinMaxInteger","com.azure.resourcemanager.computebulkactions.models.VMAttributeSupport":"Microsoft.ComputeBulkActions.VMAttributeSupport","com.azure.resourcemanager.computebulkactions.models.VMAttributes":"Microsoft.ComputeBulkActions.VMAttributes","com.azure.resourcemanager.computebulkactions.models.VMCategory":"Microsoft.ComputeBulkActions.VMCategory","com.azure.resourcemanager.computebulkactions.models.VMDiskSecurityProfile":"Microsoft.ComputeBulkActions.VMDiskSecurityProfile","com.azure.resourcemanager.computebulkactions.models.VMGalleryApplication":"Microsoft.ComputeBulkActions.VMGalleryApplication","com.azure.resourcemanager.computebulkactions.models.VMOperationStatus":"Microsoft.ComputeBulkActions.VMOperationStatus","com.azure.resourcemanager.computebulkactions.models.VaultCertificate":"Microsoft.ComputeBulkActions.VaultCertificate","com.azure.resourcemanager.computebulkactions.models.VaultSecretGroup":"Microsoft.ComputeBulkActions.VaultSecretGroup","com.azure.resourcemanager.computebulkactions.models.VirtualHardDisk":"Microsoft.ComputeBulkActions.VirtualHardDisk","com.azure.resourcemanager.computebulkactions.models.VirtualMachineExtension":"Microsoft.ComputeBulkActions.VirtualMachineExtension","com.azure.resourcemanager.computebulkactions.models.VirtualMachineExtensionProperties":"Microsoft.ComputeBulkActions.VirtualMachineExtensionProperties","com.azure.resourcemanager.computebulkactions.models.VirtualMachineIpTag":"Microsoft.ComputeBulkActions.VirtualMachineIpTag","com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceConfiguration":"Microsoft.ComputeBulkActions.VirtualMachineNetworkInterfaceConfiguration","com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceConfigurationProperties":"Microsoft.ComputeBulkActions.VirtualMachineNetworkInterfaceConfigurationProperties","com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceDnsSettingsConfiguration":"Microsoft.ComputeBulkActions.VirtualMachineNetworkInterfaceDnsSettingsConfiguration","com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceIPConfiguration":"Microsoft.ComputeBulkActions.VirtualMachineNetworkInterfaceIPConfiguration","com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceIPConfigurationProperties":"Microsoft.ComputeBulkActions.VirtualMachineNetworkInterfaceIPConfigurationProperties","com.azure.resourcemanager.computebulkactions.models.VirtualMachineProfile":"Microsoft.ComputeBulkActions.VirtualMachineProfile","com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressConfiguration":"Microsoft.ComputeBulkActions.VirtualMachinePublicIPAddressConfiguration","com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressConfigurationProperties":"Microsoft.ComputeBulkActions.VirtualMachinePublicIPAddressConfigurationProperties","com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressDnsSettingsConfiguration":"Microsoft.ComputeBulkActions.VirtualMachinePublicIPAddressDnsSettingsConfiguration","com.azure.resourcemanager.computebulkactions.models.VirtualMachineType":"Microsoft.ComputeBulkActions.VirtualMachineType","com.azure.resourcemanager.computebulkactions.models.VmSizeProfile":"Microsoft.ComputeBulkActions.VmSizeProfile","com.azure.resourcemanager.computebulkactions.models.WinRMConfiguration":"Microsoft.ComputeBulkActions.WinRMConfiguration","com.azure.resourcemanager.computebulkactions.models.WinRMListener":"Microsoft.ComputeBulkActions.WinRMListener","com.azure.resourcemanager.computebulkactions.models.WindowsConfiguration":"Microsoft.ComputeBulkActions.WindowsConfiguration","com.azure.resourcemanager.computebulkactions.models.WindowsPatchAssessmentMode":"Microsoft.ComputeBulkActions.WindowsPatchAssessmentMode","com.azure.resourcemanager.computebulkactions.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting":"Microsoft.ComputeBulkActions.WindowsVMGuestPatchAutomaticByPlatformRebootSetting","com.azure.resourcemanager.computebulkactions.models.WindowsVMGuestPatchAutomaticByPlatformSettings":"Microsoft.ComputeBulkActions.WindowsVMGuestPatchAutomaticByPlatformSettings","com.azure.resourcemanager.computebulkactions.models.WindowsVMGuestPatchMode":"Microsoft.ComputeBulkActions.WindowsVMGuestPatchMode","com.azure.resourcemanager.computebulkactions.models.ZoneAllocationPolicy":"Microsoft.ComputeBulkActions.ZoneAllocationPolicy","com.azure.resourcemanager.computebulkactions.models.ZoneDistributionStrategy":"Microsoft.ComputeBulkActions.ZoneDistributionStrategy","com.azure.resourcemanager.computebulkactions.models.ZonePreference":"Microsoft.ComputeBulkActions.ZonePreference"},"generatedFiles":["src/main/java/com/azure/resourcemanager/computebulkactions/ComputeBulkActionsManager.java","src/main/java/com/azure/resourcemanager/computebulkactions/fluent/BulkActionsClient.java","src/main/java/com/azure/resourcemanager/computebulkactions/fluent/ComputeBulkActionsManagementClient.java","src/main/java/com/azure/resourcemanager/computebulkactions/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/CancelOperationsResponseInner.java","src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/CreateResourceOperationResponseInner.java","src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/DeallocateResourceOperationResponseInner.java","src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/DeleteResourceOperationResponseInner.java","src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/GetOperationStatusResponseInner.java","src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/HibernateResourceOperationResponseInner.java","src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/LocationBasedLaunchBulkInstancesOperationInner.java","src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/OperationStatusResultInner.java","src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/StartResourceOperationResponseInner.java","src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/VirtualMachineInner.java","src/main/java/com/azure/resourcemanager/computebulkactions/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/computebulkactions/fluent/package-info.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/BulkActionsClientImpl.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/BulkActionsImpl.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/CancelOperationsResponseImpl.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/ComputeBulkActionsManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/ComputeBulkActionsManagementClientImpl.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/CreateResourceOperationResponseImpl.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/DeallocateResourceOperationResponseImpl.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/DeleteResourceOperationResponseImpl.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/GetOperationStatusResponseImpl.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/HibernateResourceOperationResponseImpl.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/LocationBasedLaunchBulkInstancesOperationImpl.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/OperationStatusResultImpl.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/StartResourceOperationResponseImpl.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/VirtualMachineImpl.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/models/LaunchBulkInstancesOperationListResult.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/models/VirtualMachineListResult.java","src/main/java/com/azure/resourcemanager/computebulkactions/implementation/package-info.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/AcceleratorManufacturer.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/AcceleratorType.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ActionType.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/AdditionalCapabilities.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/AdditionalUnattendContent.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/AdditionalUnattendContentComponentName.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/AdditionalUnattendContentPassName.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/AllInstancesDown.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/AllocationStrategy.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ApiEntityReference.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ApiError.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ApiErrorBase.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ApplicationProfile.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ArchitectureType.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/BootDiagnostics.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/BulkActions.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/CachingTypes.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/CancelOperationsRequest.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/CancelOperationsResponse.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/CapacityReservationProfile.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/CapacityType.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ComputeProfile.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/CpuManufacturer.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/CreateResourceOperationResponse.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/DataDisk.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/DeadlineType.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/DeallocateResourceOperationResponse.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/DeleteOptions.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/DeleteResourceOperationResponse.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/DiagnosticsProfile.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/DiffDiskOptions.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/DiffDiskPlacement.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/DiffDiskSettings.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/DiskControllerTypes.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/DiskCreateOptionTypes.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/DiskDeleteOptionTypes.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/DiskDetachOptionTypes.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/DiskEncryptionSetParameters.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/DiskEncryptionSettings.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/DomainNameLabelScopeTypes.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/EncryptionIdentity.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/EventGridAndResourceGraph.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/EvictionPolicy.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecuteCreateRequest.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecuteDeallocateRequest.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecuteDeleteRequest.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecuteHibernateRequest.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecuteStartRequest.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ExecutionParameters.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/GetOperationStatusRequest.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/GetOperationStatusResponse.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/HibernateResourceOperationResponse.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/HostEndpointSettings.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/HyperVGeneration.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/IPVersions.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ImageReference.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/InnerError.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/KeyVaultKeyReference.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/KeyVaultSecretReference.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/LaunchBulkInstancesOperationProperties.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/LinuxConfiguration.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/LinuxPatchAssessmentMode.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/LinuxPatchSettings.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/LinuxVMGuestPatchAutomaticByPlatformRebootSetting.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/LinuxVMGuestPatchAutomaticByPlatformSettings.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/LinuxVMGuestPatchMode.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/LocalStorageDiskType.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/LocationBasedLaunchBulkInstancesOperation.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ManagedDiskParameters.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ManagedServiceIdentityType.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/Mode.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/Modes.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/NetworkApiVersion.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/NetworkInterfaceAuxiliaryMode.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/NetworkInterfaceAuxiliarySku.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/NetworkInterfaceReference.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/NetworkInterfaceReferenceProperties.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/NetworkProfile.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/OSDisk.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/OSImageNotificationProfile.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/OSProfile.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/OperatingSystemTypes.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/Operation.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/OperationState.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/OperationStatusResult.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/Operations.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/OptimizationPreference.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/Origin.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/PatchSettings.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/Plan.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/PriorityProfile.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ProtocolTypes.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ProxyAgentSettings.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/PublicIPAddressSku.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/PublicIPAddressSkuName.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/PublicIPAddressSkuTier.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/PublicIPAllocationMethod.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ResourceOperation.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ResourceOperationDetails.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ResourceOperationError.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ResourceOperationType.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ResourceProvisionPayload.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/Resources.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/RetryPolicy.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ScheduledEventsAdditionalPublishingTargets.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ScheduledEventsPolicy.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ScheduledEventsProfile.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/SecurityEncryptionTypes.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/SecurityProfile.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/SecurityTypes.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/SettingNames.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/SshConfiguration.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/SshPublicKey.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/StartResourceOperationResponse.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/StorageAccountTypes.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/StorageProfile.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/TerminateNotificationProfile.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/UefiSettings.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/UserInitiatedReboot.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/UserInitiatedRedeploy.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VMAttributeMinMaxDouble.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VMAttributeMinMaxInteger.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VMAttributeSupport.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VMAttributes.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VMCategory.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VMDiskSecurityProfile.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VMGalleryApplication.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VMOperationStatus.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VaultCertificate.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VaultSecretGroup.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualHardDisk.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachine.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineExtension.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineExtensionProperties.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineIpTag.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineNetworkInterfaceConfiguration.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineNetworkInterfaceConfigurationProperties.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineNetworkInterfaceDnsSettingsConfiguration.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineNetworkInterfaceIPConfiguration.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineNetworkInterfaceIPConfigurationProperties.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineProfile.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachinePublicIPAddressConfiguration.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachinePublicIPAddressConfigurationProperties.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachinePublicIPAddressDnsSettingsConfiguration.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VirtualMachineType.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/VmSizeProfile.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/WinRMConfiguration.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/WinRMListener.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/WindowsConfiguration.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/WindowsPatchAssessmentMode.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/WindowsVMGuestPatchAutomaticByPlatformRebootSetting.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/WindowsVMGuestPatchMode.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ZoneAllocationPolicy.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ZoneDistributionStrategy.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/ZonePreference.java","src/main/java/com/azure/resourcemanager/computebulkactions/models/package-info.java","src/main/java/com/azure/resourcemanager/computebulkactions/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computebulkactions/proxy-config.json b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computebulkactions/proxy-config.json new file mode 100644 index 000000000000..77b8a165cdc2 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computebulkactions/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.computebulkactions.implementation.BulkActionsClientImpl$BulkActionsService"],["com.azure.resourcemanager.computebulkactions.implementation.OperationsClientImpl$OperationsService"]] \ No newline at end of file diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computebulkactions/reflect-config.json b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computebulkactions/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computebulkactions/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/resources/azure-resourcemanager-computebulkactions.properties b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/resources/azure-resourcemanager-computebulkactions.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/resources/azure-resourcemanager-computebulkactions.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsCancelSamples.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsCancelSamples.java new file mode 100644 index 000000000000..e14c90011c9b --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsCancelSamples.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.computebulkactions.generated; + +/** + * Samples for BulkActions Cancel. + */ +public final class BulkActionsCancelSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_Cancel_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_Cancel - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsCancelGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .cancel("rgcomputebulkactions", "eastus2euap", "3ec2ab23-9f13-4328-85c8-21928acbc7b8", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsCreateOrUpdateSamples.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..8fda799791ba --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsCreateOrUpdateSamples.java @@ -0,0 +1,434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.computebulkactions.models.AcceleratorManufacturer; +import com.azure.resourcemanager.computebulkactions.models.AcceleratorType; +import com.azure.resourcemanager.computebulkactions.models.AdditionalCapabilities; +import com.azure.resourcemanager.computebulkactions.models.AdditionalUnattendContent; +import com.azure.resourcemanager.computebulkactions.models.AdditionalUnattendContentComponentName; +import com.azure.resourcemanager.computebulkactions.models.AdditionalUnattendContentPassName; +import com.azure.resourcemanager.computebulkactions.models.AllInstancesDown; +import com.azure.resourcemanager.computebulkactions.models.AllocationStrategy; +import com.azure.resourcemanager.computebulkactions.models.ApiEntityReference; +import com.azure.resourcemanager.computebulkactions.models.ApplicationProfile; +import com.azure.resourcemanager.computebulkactions.models.ArchitectureType; +import com.azure.resourcemanager.computebulkactions.models.BootDiagnostics; +import com.azure.resourcemanager.computebulkactions.models.CachingTypes; +import com.azure.resourcemanager.computebulkactions.models.CapacityReservationProfile; +import com.azure.resourcemanager.computebulkactions.models.CapacityType; +import com.azure.resourcemanager.computebulkactions.models.ComputeProfile; +import com.azure.resourcemanager.computebulkactions.models.CpuManufacturer; +import com.azure.resourcemanager.computebulkactions.models.DataDisk; +import com.azure.resourcemanager.computebulkactions.models.DeleteOptions; +import com.azure.resourcemanager.computebulkactions.models.DiagnosticsProfile; +import com.azure.resourcemanager.computebulkactions.models.DiffDiskOptions; +import com.azure.resourcemanager.computebulkactions.models.DiffDiskPlacement; +import com.azure.resourcemanager.computebulkactions.models.DiffDiskSettings; +import com.azure.resourcemanager.computebulkactions.models.DiskControllerTypes; +import com.azure.resourcemanager.computebulkactions.models.DiskCreateOptionTypes; +import com.azure.resourcemanager.computebulkactions.models.DiskDeleteOptionTypes; +import com.azure.resourcemanager.computebulkactions.models.DiskDetachOptionTypes; +import com.azure.resourcemanager.computebulkactions.models.DiskEncryptionSetParameters; +import com.azure.resourcemanager.computebulkactions.models.DiskEncryptionSettings; +import com.azure.resourcemanager.computebulkactions.models.DomainNameLabelScopeTypes; +import com.azure.resourcemanager.computebulkactions.models.EncryptionIdentity; +import com.azure.resourcemanager.computebulkactions.models.EventGridAndResourceGraph; +import com.azure.resourcemanager.computebulkactions.models.EvictionPolicy; +import com.azure.resourcemanager.computebulkactions.models.HostEndpointSettings; +import com.azure.resourcemanager.computebulkactions.models.HyperVGeneration; +import com.azure.resourcemanager.computebulkactions.models.IPVersions; +import com.azure.resourcemanager.computebulkactions.models.ImageReference; +import com.azure.resourcemanager.computebulkactions.models.KeyVaultKeyReference; +import com.azure.resourcemanager.computebulkactions.models.KeyVaultSecretReference; +import com.azure.resourcemanager.computebulkactions.models.LaunchBulkInstancesOperationProperties; +import com.azure.resourcemanager.computebulkactions.models.LinuxConfiguration; +import com.azure.resourcemanager.computebulkactions.models.LinuxPatchAssessmentMode; +import com.azure.resourcemanager.computebulkactions.models.LinuxPatchSettings; +import com.azure.resourcemanager.computebulkactions.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.computebulkactions.models.LinuxVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.computebulkactions.models.LinuxVMGuestPatchMode; +import com.azure.resourcemanager.computebulkactions.models.LocalStorageDiskType; +import com.azure.resourcemanager.computebulkactions.models.ManagedDiskParameters; +import com.azure.resourcemanager.computebulkactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.computebulkactions.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.computebulkactions.models.Mode; +import com.azure.resourcemanager.computebulkactions.models.Modes; +import com.azure.resourcemanager.computebulkactions.models.NetworkApiVersion; +import com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceAuxiliarySku; +import com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceReference; +import com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceReferenceProperties; +import com.azure.resourcemanager.computebulkactions.models.NetworkProfile; +import com.azure.resourcemanager.computebulkactions.models.OSDisk; +import com.azure.resourcemanager.computebulkactions.models.OSImageNotificationProfile; +import com.azure.resourcemanager.computebulkactions.models.OSProfile; +import com.azure.resourcemanager.computebulkactions.models.OperatingSystemTypes; +import com.azure.resourcemanager.computebulkactions.models.PatchSettings; +import com.azure.resourcemanager.computebulkactions.models.Plan; +import com.azure.resourcemanager.computebulkactions.models.PriorityProfile; +import com.azure.resourcemanager.computebulkactions.models.ProtocolTypes; +import com.azure.resourcemanager.computebulkactions.models.ProxyAgentSettings; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSku; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSkuName; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSkuTier; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAllocationMethod; +import com.azure.resourcemanager.computebulkactions.models.RetryPolicy; +import com.azure.resourcemanager.computebulkactions.models.ScheduledEventsAdditionalPublishingTargets; +import com.azure.resourcemanager.computebulkactions.models.ScheduledEventsPolicy; +import com.azure.resourcemanager.computebulkactions.models.ScheduledEventsProfile; +import com.azure.resourcemanager.computebulkactions.models.SecurityEncryptionTypes; +import com.azure.resourcemanager.computebulkactions.models.SecurityProfile; +import com.azure.resourcemanager.computebulkactions.models.SecurityTypes; +import com.azure.resourcemanager.computebulkactions.models.SettingNames; +import com.azure.resourcemanager.computebulkactions.models.SshConfiguration; +import com.azure.resourcemanager.computebulkactions.models.SshPublicKey; +import com.azure.resourcemanager.computebulkactions.models.StorageAccountTypes; +import com.azure.resourcemanager.computebulkactions.models.StorageProfile; +import com.azure.resourcemanager.computebulkactions.models.TerminateNotificationProfile; +import com.azure.resourcemanager.computebulkactions.models.UefiSettings; +import com.azure.resourcemanager.computebulkactions.models.UserInitiatedReboot; +import com.azure.resourcemanager.computebulkactions.models.UserInitiatedRedeploy; +import com.azure.resourcemanager.computebulkactions.models.VMAttributeMinMaxDouble; +import com.azure.resourcemanager.computebulkactions.models.VMAttributeMinMaxInteger; +import com.azure.resourcemanager.computebulkactions.models.VMAttributeSupport; +import com.azure.resourcemanager.computebulkactions.models.VMAttributes; +import com.azure.resourcemanager.computebulkactions.models.VMCategory; +import com.azure.resourcemanager.computebulkactions.models.VMDiskSecurityProfile; +import com.azure.resourcemanager.computebulkactions.models.VMGalleryApplication; +import com.azure.resourcemanager.computebulkactions.models.VaultCertificate; +import com.azure.resourcemanager.computebulkactions.models.VaultSecretGroup; +import com.azure.resourcemanager.computebulkactions.models.VirtualHardDisk; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineExtension; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineExtensionProperties; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineIpTag; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceConfigurationProperties; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceDnsSettingsConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceIPConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceIPConfigurationProperties; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineProfile; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressConfigurationProperties; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressDnsSettingsConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineType; +import com.azure.resourcemanager.computebulkactions.models.VmSizeProfile; +import com.azure.resourcemanager.computebulkactions.models.WinRMConfiguration; +import com.azure.resourcemanager.computebulkactions.models.WinRMListener; +import com.azure.resourcemanager.computebulkactions.models.WindowsConfiguration; +import com.azure.resourcemanager.computebulkactions.models.WindowsPatchAssessmentMode; +import com.azure.resourcemanager.computebulkactions.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.computebulkactions.models.WindowsVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.computebulkactions.models.WindowsVMGuestPatchMode; +import com.azure.resourcemanager.computebulkactions.models.ZoneAllocationPolicy; +import com.azure.resourcemanager.computebulkactions.models.ZoneDistributionStrategy; +import com.azure.resourcemanager.computebulkactions.models.ZonePreference; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for BulkActions CreateOrUpdate. + */ +public final class BulkActionsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_CreateOrUpdate - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsCreateOrUpdateGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .define("3ec2ab23-9f13-4328-85c8-21928acbc7b8") + .withExistingLocation("rgcomputebulkactions", "eastus2euap") + .withProperties(new LaunchBulkInstancesOperationProperties().withCapacity(24) + .withCapacityType(CapacityType.VM) + .withPriorityProfile(new PriorityProfile().withType(VirtualMachineType.REGULAR) + .withMaxPricePerVM(21.0D) + .withEvictionPolicy(EvictionPolicy.DELETE) + .withAllocationStrategy(AllocationStrategy.LOWEST_PRICE)) + .withVmSizesProfile(Arrays.asList(new VmSizeProfile().withName("nolktwnfqdwikqiat").withRank(46189))) + .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("dmtpdlqphckngwjhvkucfze")) + .withExcludedVMSizes(Arrays.asList("yhjhharuhcyfxjnhxmflvsrdmei"))) + .withComputeProfile(new ComputeProfile() + .withVirtualMachineProfile(new VirtualMachineProfile() + .withScheduledEventsPolicy(new ScheduledEventsPolicy() + .withUserInitiatedRedeploy(new UserInitiatedRedeploy().withAutomaticallyApprove(true)) + .withUserInitiatedReboot(new UserInitiatedReboot().withAutomaticallyApprove(true)) + .withScheduledEventsAdditionalPublishingTargets( + new ScheduledEventsAdditionalPublishingTargets() + .withEventGridAndResourceGraph(new EventGridAndResourceGraph().withEnable(true) + .withScheduledEventsApiVersion("sbzjonqss"))) + .withAllInstancesDown(new AllInstancesDown().withAutomaticallyApprove(true))) + .withStorageProfile(new StorageProfile() + .withImageReference(new ImageReference().withId("iwqrkiccafacxfctrxb") + .withPublisher("edjvbyisusjhyvnzgyvhixmnfzzsy") + .withOffer("olkxwdozixpjkjuk") + .withSku("qmsq") + .withVersion("hruassyajrafmgmub") + .withSharedGalleryImageId("ahzweiez") + .withCommunityGalleryImageId("bysd")) + .withOsDisk(new OSDisk().withOsType(OperatingSystemTypes.WINDOWS) + .withEncryptionSettings(new DiskEncryptionSettings() + .withDiskEncryptionKey( + new KeyVaultSecretReference().withSecretUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("ioypuofzltakyfcomjwfkmyz"))) + .withKeyEncryptionKey(new KeyVaultKeyReference().withKeyUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("ioypuofzltakyfcomjwfkmyz"))) + .withEnabled(true)) + .withName("pccysrjeo") + .withVhd(new VirtualHardDisk().withUri("anvtwgmfthxmyhdnbvabmzyrknxwf")) + .withImage(new VirtualHardDisk().withUri("https://microsoft.com/a")) + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withDiffDiskSettings(new DiffDiskSettings().withOption(DiffDiskOptions.LOCAL) + .withPlacement(DiffDiskPlacement.CACHE_DISK)) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiskSizeGB(18) + .withManagedDisk(new ManagedDiskParameters().withId("wuqdcyunrkewr") + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet(new DiskEncryptionSetParameters().withId("thmks")) + .withSecurityProfile(new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet(new DiskEncryptionSetParameters().withId("thmks")))) + .withDeleteOption(DiskDeleteOptionTypes.DELETE)) + .withDataDisks(Arrays.asList(new DataDisk().withLun(1) + .withName("aq") + .withVhd(new VirtualHardDisk().withUri("anvtwgmfthxmyhdnbvabmzyrknxwf")) + .withImage(new VirtualHardDisk().withUri("anvtwgmfthxmyhdnbvabmzyrknxwf")) + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiskSizeGB(24) + .withManagedDisk(new ManagedDiskParameters().withId("zcoqnxlomkordbdolkxraqbwgsh") + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet(new DiskEncryptionSetParameters().withId("thmks")) + .withSecurityProfile(new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet(new DiskEncryptionSetParameters().withId("thmks")))) + .withSourceResource(new ApiEntityReference().withId("fpabycyqmkqqfdfrzqmnykmy")) + .withToBeDetached(true) + .withDetachOption(DiskDetachOptionTypes.FORCE_DETACH) + .withDeleteOption(DiskDeleteOptionTypes.DELETE))) + .withDiskControllerType(DiskControllerTypes.SCSI)) + .withAdditionalCapabilities( + new AdditionalCapabilities().withUltraSSDEnabled(true).withHibernationEnabled(true)) + .withOsProfile( + new OSProfile().withComputerName("jagkikqx") + .withAdminUsername("tjdagcdhlpihlhkrz") + .withAdminPassword("fakeTokenPlaceholder") + .withCustomData("jemgccf") + .withWindowsConfiguration( + new WindowsConfiguration().withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withTimeZone("kiibvtut") + .withAdditionalUnattendContent(Arrays.asList(new AdditionalUnattendContent() + .withPassName(AdditionalUnattendContentPassName.OOBE_SYSTEM) + .withComponentName( + AdditionalUnattendContentComponentName.MICROSOFT_WINDOWS_SHELL_SETUP) + .withSettingName(SettingNames.AUTO_LOGON) + .withContent("zdpsub"))) + .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("https://microsoft.com/a"))))) + .withLinuxConfiguration( + new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withPath("xyntsvqsiqsguyegxdvkmwhwz") + .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("obwiwwsgkdg")) + .withVaultCertificates(Arrays.asList(new VaultCertificate() + .withCertificateUrl("https://microsoft.com/agmunp") + .withCertificateStore("zxrjtvfmltdj"))))) + .withAllowExtensionOperations(true) + .withRequireGuestProvisionSignal(true)) + .withNetworkProfile(new NetworkProfile() + .withNetworkInterfaces(Arrays + .asList(new NetworkInterfaceReference().withId("bmlqsytfgnkwgkibsmsoeh") + .withProperties(new NetworkInterfaceReferenceProperties() + .withPrimary(true) + .withDeleteOption(DeleteOptions.DELETE)))) + .withNetworkApiVersion(NetworkApiVersion.TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE) + .withNetworkInterfaceConfigurations(Arrays + .asList(new VirtualMachineNetworkInterfaceConfiguration().withName("keppldrpxjgckgsmq") + .withProperties(new VirtualMachineNetworkInterfaceConfigurationProperties() + .withPrimary(true) + .withDeleteOption(DeleteOptions.DELETE) + .withEnableAcceleratedNetworking(true) + .withDisableTcpStateTracking(true) + .withEnableFpga(true) + .withEnableIPForwarding(true) + .withNetworkSecurityGroup(new SubResource().withId("obwiwwsgkdg")) + .withDnsSettings(new VirtualMachineNetworkInterfaceDnsSettingsConfiguration() + .withDnsServers(Arrays.asList("pnhvxygytoozxmkt"))) + .withIpConfigurations( + Arrays.asList(new VirtualMachineNetworkInterfaceIPConfiguration() + .withName("nqjufbencyticmohsdxogwiu") + .withProperties( + new VirtualMachineNetworkInterfaceIPConfigurationProperties() + .withSubnet( + new SubResource().withId("djtafmblvomuabwlhlyoxzgdkwkz")) + .withPrimary(true) + .withPublicIPAddressConfiguration( + new VirtualMachinePublicIPAddressConfiguration() + .withName("kgvjhctjspzldadcmtgsojglhmj") + .withProperties( + new VirtualMachinePublicIPAddressConfigurationProperties() + .withIdleTimeoutInMinutes(22) + .withDeleteOption(DeleteOptions.DELETE) + .withDnsSettings( + new VirtualMachinePublicIPAddressDnsSettingsConfiguration() + .withDomainNameLabel("vsvbcpusndz") + .withDomainNameLabelScope( + DomainNameLabelScopeTypes.TENANT_REUSE)) + .withIpTags( + Arrays.asList(new VirtualMachineIpTag() + .withIpTagType( + "hengwhngakjlsmhuegnlbtpmiihf") + .withTag("zlnuzjdbdnwbtep"))) + .withPublicIPPrefix( + new SubResource().withId("obwiwwsgkdg")) + .withPublicIPAddressVersion(IPVersions.IPV4) + .withPublicIPAllocationMethod( + PublicIPAllocationMethod.DYNAMIC)) + .withSku(new PublicIPAddressSku() + .withName(PublicIPAddressSkuName.BASIC) + .withTier(PublicIPAddressSkuTier.REGIONAL)) + .withTags(mapOf())) + .withPrivateIPAddressVersion(IPVersions.IPV4) + .withApplicationSecurityGroups( + Arrays.asList(new SubResource().withId("obwiwwsgkdg"))) + .withApplicationGatewayBackendAddressPools( + Arrays.asList(new SubResource().withId("obwiwwsgkdg"))) + .withLoadBalancerBackendAddressPools( + Arrays.asList(new SubResource().withId("obwiwwsgkdg")))))) + .withDscpConfiguration(new SubResource().withId("ioypuofzltakyfcomjwfkmyz")) + .withAuxiliaryMode(NetworkInterfaceAuxiliaryMode.NONE) + .withAuxiliarySku(NetworkInterfaceAuxiliarySku.NONE)) + .withTags(mapOf())))) + .withSecurityProfile(new SecurityProfile() + .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true)) + .withEncryptionAtHost(true) + .withSecurityType(SecurityTypes.TRUSTED_LAUNCH) + .withEncryptionIdentity(new EncryptionIdentity() + .withUserAssignedIdentityResourceId("wkiykqbrifryaruzokophodpjig")) + .withProxyAgentSettings(new ProxyAgentSettings().withEnabled(true) + .withMode(Mode.AUDIT) + .withKeyIncarnationId(17) + .withWireServer(new HostEndpointSettings().withMode(Modes.AUDIT) + .withInVMAccessControlProfileReferenceId("cubhuucckqkxbifmertj")) + .withImds(new HostEndpointSettings().withMode(Modes.AUDIT) + .withInVMAccessControlProfileReferenceId("cubhuucckqkxbifmertj")) + .withAddProxyAgentExtension(true))) + .withDiagnosticsProfile(new DiagnosticsProfile().withBootDiagnostics( + new BootDiagnostics().withEnabled(true).withStorageUri("https://microsoft.com/a"))) + .withLicenseType("iipnwxwfkfbbouzbwicqxnxicjz") + .withExtensionsTimeBudget("hvrimblcqujozpeurohjcn") + .withScheduledEventsProfile(new ScheduledEventsProfile() + .withTerminateNotificationProfile( + new TerminateNotificationProfile().withNotBeforeTimeout("ypif").withEnable(true)) + .withOsImageNotificationProfile( + new OSImageNotificationProfile().withNotBeforeTimeout("fztbudpjkicyigtvltlbszmivfbmb") + .withEnable(true))) + .withUserData("qcsgczwavs") + .withCapacityReservation(new CapacityReservationProfile() + .withCapacityReservationGroup(new SubResource().withId("obwiwwsgkdg"))) + .withApplicationProfile(new ApplicationProfile() + .withGalleryApplications(Arrays.asList(new VMGalleryApplication().withTags("qgn") + .withOrder(14) + .withPackageReferenceId("soddwzqduyolzz") + .withConfigurationReference("mddsvaruvzvblkafsotscupperzu") + .withTreatFailureAsDeploymentFailure(true) + .withEnableAutomaticUpgrade(true))))) + .withExtensions( + Arrays.asList(new VirtualMachineExtension().withName("gj") + .withProperties(new VirtualMachineExtensionProperties() + .withForceUpdateTag("mistpuvreycjbhahmcvgkjskeiop") + .withPublisher("rzsodcysrfxkrgnrjqlpfqe") + .withType("eyehf") + .withTypeHandlerVersion("wezzz") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings(mapOf()) + .withProtectedSettings(mapOf()) + .withSuppressFailures(true) + .withProtectedSettingsFromKeyVault( + new KeyVaultSecretReference().withSecretUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("ioypuofzltakyfcomjwfkmyz"))) + .withProvisionAfterExtensions(Arrays.asList("jddcihtuzdczkvkryhktzjlf"))))) + .withComputeApiVersion("bccikdfzgrygwpefvmvptutceg")) + .withZoneAllocationPolicy(new ZoneAllocationPolicy() + .withDistributionStrategy(ZoneDistributionStrategy.BEST_EFFORT_SINGLE_ZONE) + .withZonePreferences( + Arrays.asList(new ZonePreference().withZone("voauikerqjpeepaeaokkcybyjd").withRank(46292)))) + .withRetryPolicy(new RetryPolicy().withRetryCount(9).withRetryWindowInMinutes(21))) + .withZones(Arrays.asList("cyriutfcgydtaezeso")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf())) + .withPlan(new Plan().withName("owvrgjbxrkj") + .withPublisher("qhybdqbljmztcjujxal") + .withProduct("rlhap") + .withPromotionCode("fakeTokenPlaceholder") + .withVersion("ghmnlomqg")) + .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/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsDeleteSamples.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsDeleteSamples.java new file mode 100644 index 000000000000..4fc7115d1a8b --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsDeleteSamples.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.computebulkactions.generated; + +/** + * Samples for BulkActions Delete. + */ +public final class BulkActionsDeleteSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_Delete - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsDeleteGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .delete("rgcomputebulkactions", "eastus2euap", "3ec2ab23-9f13-4328-85c8-21928acbc7b8", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsGetOperationStatusSamples.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsGetOperationStatusSamples.java new file mode 100644 index 000000000000..2c9ee822a44a --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsGetOperationStatusSamples.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.computebulkactions.generated; + +/** + * Samples for BulkActions GetOperationStatus. + */ +public final class BulkActionsGetOperationStatusSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_GetOperationStatus_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_GetOperationStatus - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsGetOperationStatusGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .getOperationStatusWithResponse("eastus2euap", "2a3fce8e-874c-45f4-9d27-1a804f3b7a0f", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsGetSamples.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsGetSamples.java new file mode 100644 index 000000000000..53c80886f5ef --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsGetSamples.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.computebulkactions.generated; + +/** + * Samples for BulkActions Get. + */ +public final class BulkActionsGetSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_Get_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_Get - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsGetGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .getWithResponse("rgcomputebulkactions", "eastus2euap", "3ec2ab23-9f13-4328-85c8-21928acbc7b8", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsListByResourceGroupSamples.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsListByResourceGroupSamples.java new file mode 100644 index 000000000000..4b04b79342bf --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsListByResourceGroupSamples.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.computebulkactions.generated; + +/** + * Samples for BulkActions ListByResourceGroup. + */ +public final class BulkActionsListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: BulkActions_ListByResourceGroup - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsListByResourceGroupGeneratedByMinimumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .listByResourceGroup("rgcomputebulkactions", "eastus2euap", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_ListByResourceGroup - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsListByResourceGroupGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .listByResourceGroup("rgcomputebulkactions", "eastus2euap", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsListBySubscriptionSamples.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsListBySubscriptionSamples.java new file mode 100644 index 000000000000..57537804b877 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsListBySubscriptionSamples.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.computebulkactions.generated; + +/** + * Samples for BulkActions ListBySubscription. + */ +public final class BulkActionsListBySubscriptionSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_ListBySubscription - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsListBySubscriptionGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions().listBySubscription("eastus2euap", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: BulkActions_ListBySubscription - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsListBySubscriptionGeneratedByMinimumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions().listBySubscription("eastus2euap", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsListVirtualMachinesSamples.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsListVirtualMachinesSamples.java new file mode 100644 index 000000000000..070be7677a4e --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsListVirtualMachinesSamples.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.computebulkactions.generated; + +/** + * Samples for BulkActions ListVirtualMachines. + */ +public final class BulkActionsListVirtualMachinesSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_ListVirtualMachines_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_ListVirtualMachines - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsListVirtualMachinesGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .listVirtualMachines("rgcomputebulkactions", "eastus2euap", "50352BBD-59F1-4EE2-BA9C-A6E51B0B1B2B", + "elxwdbimmgosmnb", "nrcv", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesCancelOperationsSamples.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesCancelOperationsSamples.java new file mode 100644 index 000000000000..6366f14e0a07 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesCancelOperationsSamples.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.computebulkactions.generated; + +import com.azure.resourcemanager.computebulkactions.models.CancelOperationsRequest; +import java.util.Arrays; + +/** + * Samples for BulkActions VirtualMachinesCancelOperations. + */ +public final class BulkActionsVirtualMachinesCancelOperationsSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesCancelOperations_MinimumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesCancelOperations_MaximumSet_Gen - generated by [MaximumSet] rule - + * generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void + bulkActionsVirtualMachinesCancelOperationsMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMinimumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesCancelOperationsWithResponse("eastus2euap", + new CancelOperationsRequest().withOperationIds(Arrays.asList("23480d2f-1dca-4610-afb4-dd25eec1f34r")) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesCancelOperations_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesCancelOperations_MaximumSet_Gen - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesCancelOperationsMaximumSetGenGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesCancelOperationsWithResponse("eastus2euap", + new CancelOperationsRequest().withOperationIds(Arrays.asList("2a3fce8e-874c-45f4-9d27-1a804f3b7a0f")) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesExecuteCreateSamples.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesExecuteCreateSamples.java new file mode 100644 index 000000000000..5afc3a74bebb --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesExecuteCreateSamples.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.ExecuteCreateRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.computebulkactions.models.ResourceProvisionPayload; +import com.azure.resourcemanager.computebulkactions.models.RetryPolicy; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for BulkActions VirtualMachinesExecuteCreate. + */ +public final class BulkActionsVirtualMachinesExecuteCreateSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesExecuteCreate_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesExecuteCreate_MaximumSet_Gen - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesExecuteCreateMaximumSetGenGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesExecuteCreateWithResponse("eastus2euap", new ExecuteCreateRequest() + .withResourceConfigParameters(new ResourceProvisionPayload().withBaseProfile(mapOf("resourcegroupName", + BinaryData.fromBytes("yourresourcegroup".getBytes(StandardCharsets.UTF_8)), "computeApiVersion", + BinaryData.fromBytes("2023-09-01".getBytes(StandardCharsets.UTF_8)), "properties", + BinaryData.fromBytes( + "{vmExtensions=[{name=Microsoft.Azure.Geneva.GenevaMonitoring, location=eastus2euap, properties={autoUpgradeMinorVersion=true, enableAutomaticUpgrade=true, suppressFailures=true, publisher=Microsoft.Azure.Geneva, type=GenevaMonitoring, typeHandlerVersion=2.0}}], hardwareProfile={vmSize=Standard_D2ads_v5}, storageProfile={imageReference={publisher=MicrosoftWindowsServer, offer=WindowsServer, sku=2022-datacenter-azure-edition, version=latest}, osDisk={osType=Windows, createOption=FromImage, caching=ReadWrite, managedDisk={storageAccountType=Standard_LRS}, deleteOption=Detach, diskSizeGB=127}, diskControllerType=SCSI}, networkProfile={networkInterfaceConfigurations=[{name=vmTest, properties={primary=true, enableIPForwarding=true, ipConfigurations=[{name=vmTest, properties={subnet={id=/subscriptions/264f0c8a-4d5f-496c-80df-b438624ce55f/resourceGroups/yourresourcegroup/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default}, primary=true, applicationGatewayBackendAddressPools=[], loadBalancerBackendAddressPools=[]}}]}}], networkApiVersion=2022-07-01}}" + .getBytes(StandardCharsets.UTF_8)))) + .withResourceOverrides(Arrays.asList(mapOf("name", + BinaryData.fromBytes("testvmtestTwo".getBytes(StandardCharsets.UTF_8)), "location", + BinaryData.fromBytes("eastus2euap".getBytes(StandardCharsets.UTF_8)), "properties", + BinaryData.fromBytes( + "{hardwareProfile={vmSize=Standard_D2ads_v5}, osProfile={computerName=testtestTwo, adminUsername=testUserName, adminPassword=YourStr0ngP@ssword123!, windowsConfiguration={provisionVmAgent=true, enableAutomaticUpdates=true, patchSettings={patchMode=AutomaticByPlatform, assessmentMode=ImageDefault}}}}" + .getBytes(StandardCharsets.UTF_8))))) + .withResourceCount(1)) + .withExecutionParameters(new ExecutionParameters() + .withRetryPolicy(new RetryPolicy().withRetryCount(5).withRetryWindowInMinutes(45))) + .withCorrelationId("7efcfae3-f50d-4323-9aba-1093a33368f8"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesExecuteCreate_MinimumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesExecuteCreate_MinimumSet_Gen - generated by [MinimumSet] rule - generated + * by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void + bulkActionsVirtualMachinesExecuteCreateMinimumSetGenGeneratedByMinimumSetRuleGeneratedByMinimumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesExecuteCreateWithResponse("eastus2euap", + new ExecuteCreateRequest() + .withResourceConfigParameters(new ResourceProvisionPayload().withResourceCount(1)) + .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/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesExecuteDeallocateSamples.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesExecuteDeallocateSamples.java new file mode 100644 index 000000000000..5904cf544d25 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesExecuteDeallocateSamples.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.computebulkactions.generated; + +import com.azure.resourcemanager.computebulkactions.models.ExecuteDeallocateRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.computebulkactions.models.Resources; +import com.azure.resourcemanager.computebulkactions.models.RetryPolicy; +import java.util.Arrays; + +/** + * Samples for BulkActions VirtualMachinesExecuteDeallocate. + */ +public final class BulkActionsVirtualMachinesExecuteDeallocateSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesExecuteDeallocate_MinimumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesExecuteDeallocate_MinimumSet_Gen - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesExecuteDeallocateMinimumSetGenGeneratedByMinimumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesExecuteDeallocateWithResponse("eastus2euap", new ExecuteDeallocateRequest() + .withExecutionParameters(new ExecutionParameters()) + .withResources(new Resources().withIds(Arrays.asList( + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"))) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesExecuteDeallocate_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesExecuteDeallocate_MaximumSet_Gen - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesExecuteDeallocateMaximumSetGenGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesExecuteDeallocateWithResponse("eastus2euap", new ExecuteDeallocateRequest() + .withExecutionParameters(new ExecutionParameters() + .withRetryPolicy(new RetryPolicy().withRetryCount(4).withRetryWindowInMinutes(27))) + .withResources(new Resources().withIds(Arrays.asList( + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"))) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesExecuteDeleteSamples.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesExecuteDeleteSamples.java new file mode 100644 index 000000000000..f45077d5e9cc --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesExecuteDeleteSamples.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.computebulkactions.generated; + +import com.azure.resourcemanager.computebulkactions.models.ExecuteDeleteRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.computebulkactions.models.Resources; +import com.azure.resourcemanager.computebulkactions.models.RetryPolicy; +import java.util.Arrays; + +/** + * Samples for BulkActions VirtualMachinesExecuteDelete. + */ +public final class BulkActionsVirtualMachinesExecuteDeleteSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesExecuteDelete_MinimumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesExecuteDelete_MinimumSet_Gen - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesExecuteDeleteMinimumSetGenGeneratedByMinimumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesExecuteDeleteWithResponse("eastus2euap", new ExecuteDeleteRequest() + .withExecutionParameters(new ExecutionParameters()) + .withResources(new Resources().withIds(Arrays.asList( + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4"))) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesExecuteDelete_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesExecuteDelete_MaximumSet_Gen - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesExecuteDeleteMaximumSetGenGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesExecuteDeleteWithResponse("east2us2euap", new ExecuteDeleteRequest() + .withExecutionParameters(new ExecutionParameters() + .withRetryPolicy(new RetryPolicy().withRetryCount(2).withRetryWindowInMinutes(45))) + .withResources(new Resources().withIds(Arrays.asList( + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4"))) + .withCorrelationId("dfe927c5-16a6-40b7-a0f7-8524975ed642") + .withForceDeletion(true), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesExecuteHibernateSamples.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesExecuteHibernateSamples.java new file mode 100644 index 000000000000..668a5bce2554 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesExecuteHibernateSamples.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.computebulkactions.generated; + +import com.azure.resourcemanager.computebulkactions.models.ExecuteHibernateRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.computebulkactions.models.Resources; +import com.azure.resourcemanager.computebulkactions.models.RetryPolicy; +import java.util.Arrays; + +/** + * Samples for BulkActions VirtualMachinesExecuteHibernate. + */ +public final class BulkActionsVirtualMachinesExecuteHibernateSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesExecuteHibernate_MinimumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesExecuteHibernate_MinimumSet_Gen - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesExecuteHibernateMinimumSetGenGeneratedByMinimumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesExecuteHibernateWithResponse("acuh", new ExecuteHibernateRequest() + .withExecutionParameters(new ExecutionParameters()) + .withResources(new Resources().withIds(Arrays.asList( + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"))) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesExecuteHibernate_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesExecuteHibernate_MaximumSet_Gen - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesExecuteHibernateMaximumSetGenGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesExecuteHibernateWithResponse("eastus2euap", new ExecuteHibernateRequest() + .withExecutionParameters(new ExecutionParameters() + .withRetryPolicy(new RetryPolicy().withRetryCount(5).withRetryWindowInMinutes(27))) + .withResources(new Resources().withIds(Arrays.asList( + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"))) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesExecuteStartSamples.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesExecuteStartSamples.java new file mode 100644 index 000000000000..e2219b90370a --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesExecuteStartSamples.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.computebulkactions.generated; + +import com.azure.resourcemanager.computebulkactions.models.ExecuteStartRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.computebulkactions.models.Resources; +import com.azure.resourcemanager.computebulkactions.models.RetryPolicy; +import java.util.Arrays; + +/** + * Samples for BulkActions VirtualMachinesExecuteStart. + */ +public final class BulkActionsVirtualMachinesExecuteStartSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesExecuteStart_MinimumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesExecuteStart_MinimumSet_Gen - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesExecuteStartMinimumSetGenGeneratedByMinimumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesExecuteStartWithResponse("eastus2euap", new ExecuteStartRequest() + .withExecutionParameters(new ExecutionParameters()) + .withResources(new Resources().withIds(Arrays.asList( + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"))) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesExecuteStart_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesExecuteStart_MaximumSet_Gen - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesExecuteStartMaximumSetGenGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesExecuteStartWithResponse("eastus2euap", new ExecuteStartRequest() + .withExecutionParameters(new ExecutionParameters() + .withRetryPolicy(new RetryPolicy().withRetryCount(2).withRetryWindowInMinutes(27))) + .withResources(new Resources().withIds(Arrays.asList( + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"))) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesGetOperationStatusSamples.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesGetOperationStatusSamples.java new file mode 100644 index 000000000000..2526d877c5f5 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/BulkActionsVirtualMachinesGetOperationStatusSamples.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.computebulkactions.generated; + +import com.azure.resourcemanager.computebulkactions.models.GetOperationStatusRequest; +import java.util.Arrays; + +/** + * Samples for BulkActions VirtualMachinesGetOperationStatus. + */ +public final class BulkActionsVirtualMachinesGetOperationStatusSamples { + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesGetOperationStatus_MinimumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesGetOperationStatus_MinimumSet_Gen - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesGetOperationStatusMinimumSetGenGeneratedByMinimumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesGetOperationStatusWithResponse("eastus2euap", + new GetOperationStatusRequest().withOperationIds(Arrays.asList("23480d2f-1dca-4610-afb4-dd25eec1f34r")) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-02-01-preview/BulkActions_VirtualMachinesGetOperationStatus_MaximumSet_Gen.json + */ + /** + * Sample code: BulkActions_VirtualMachinesGetOperationStatus_MaximumSet_Gen - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void bulkActionsVirtualMachinesGetOperationStatusMaximumSetGenGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.bulkActions() + .virtualMachinesGetOperationStatusWithResponse("eastus2euap", + new GetOperationStatusRequest().withOperationIds(Arrays.asList("2a3fce8e-874c-45f4-9d27-1a804f3b7a0f")) + .withCorrelationId("4431320c-7a90-4300-b82b-73f0696ae50e"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/OperationsListSamples.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/OperationsListSamples.java new file mode 100644 index 000000000000..47adb177abcb --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/samples/java/com/azure/resourcemanager/computebulkactions/generated/OperationsListSamples.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.computebulkactions.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2026-02-01-preview/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List - generated by [MaximumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void operationsListGeneratedByMaximumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-02-01-preview/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List - generated by [MinimumSet] rule. + * + * @param manager Entry point to ComputeBulkActionsManager. + */ + public static void operationsListGeneratedByMinimumSetRule( + com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/AdditionalCapabilitiesTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/AdditionalCapabilitiesTests.java new file mode 100644 index 000000000000..546914768375 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":true,\"hibernationEnabled\":true}") + .toObject(AdditionalCapabilities.class); + Assertions.assertTrue(model.ultraSSDEnabled()); + Assertions.assertTrue(model.hibernationEnabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AdditionalCapabilities model + = new AdditionalCapabilities().withUltraSSDEnabled(true).withHibernationEnabled(true); + model = BinaryData.fromObject(model).toObject(AdditionalCapabilities.class); + Assertions.assertTrue(model.ultraSSDEnabled()); + Assertions.assertTrue(model.hibernationEnabled()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/AdditionalUnattendContentTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/AdditionalUnattendContentTests.java new file mode 100644 index 000000000000..c08669c07190 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.AdditionalUnattendContent; +import com.azure.resourcemanager.computebulkactions.models.AdditionalUnattendContentComponentName; +import com.azure.resourcemanager.computebulkactions.models.AdditionalUnattendContentPassName; +import com.azure.resourcemanager.computebulkactions.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\":\"AutoLogon\",\"content\":\"onlebxetqgtzxdpn\"}") + .toObject(AdditionalUnattendContent.class); + Assertions.assertEquals(AdditionalUnattendContentPassName.OOBE_SYSTEM, model.passName()); + Assertions.assertEquals(AdditionalUnattendContentComponentName.MICROSOFT_WINDOWS_SHELL_SETUP, + model.componentName()); + Assertions.assertEquals(SettingNames.AUTO_LOGON, model.settingName()); + Assertions.assertEquals("onlebxetqgtzxdpn", 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.AUTO_LOGON) + .withContent("onlebxetqgtzxdpn"); + 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.AUTO_LOGON, model.settingName()); + Assertions.assertEquals("onlebxetqgtzxdpn", model.content()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/AllInstancesDownTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/AllInstancesDownTests.java new file mode 100644 index 000000000000..d4c18b8ecad7 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":true}").toObject(AllInstancesDown.class); + Assertions.assertTrue(model.automaticallyApprove()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AllInstancesDown model = new AllInstancesDown().withAutomaticallyApprove(true); + model = BinaryData.fromObject(model).toObject(AllInstancesDown.class); + Assertions.assertTrue(model.automaticallyApprove()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ApiEntityReferenceTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ApiEntityReferenceTests.java new file mode 100644 index 000000000000..eba5b4d5a630 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ApiEntityReferenceTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":\"h\"}").toObject(ApiEntityReference.class); + Assertions.assertEquals("h", model.id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ApiEntityReference model = new ApiEntityReference().withId("h"); + model = BinaryData.fromObject(model).toObject(ApiEntityReference.class); + Assertions.assertEquals("h", model.id()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ApplicationProfileTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ApplicationProfileTests.java new file mode 100644 index 000000000000..d17a84c42c6d --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ApplicationProfileTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.ApplicationProfile; +import com.azure.resourcemanager.computebulkactions.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\":\"nzdndslgna\",\"order\":1257002665,\"packageReferenceId\":\"gynduha\",\"configurationReference\":\"qlkth\",\"treatFailureAsDeploymentFailure\":true,\"enableAutomaticUpgrade\":true},{\"tags\":\"bgycduiertgccym\",\"order\":50940581,\"packageReferenceId\":\"l\",\"configurationReference\":\"slqlfmmdn\",\"treatFailureAsDeploymentFailure\":true,\"enableAutomaticUpgrade\":true}]}") + .toObject(ApplicationProfile.class); + Assertions.assertEquals("nzdndslgna", model.galleryApplications().get(0).tags()); + Assertions.assertEquals(1257002665, model.galleryApplications().get(0).order()); + Assertions.assertEquals("gynduha", model.galleryApplications().get(0).packageReferenceId()); + Assertions.assertEquals("qlkth", model.galleryApplications().get(0).configurationReference()); + Assertions.assertTrue(model.galleryApplications().get(0).treatFailureAsDeploymentFailure()); + Assertions.assertTrue(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("nzdndslgna") + .withOrder(1257002665) + .withPackageReferenceId("gynduha") + .withConfigurationReference("qlkth") + .withTreatFailureAsDeploymentFailure(true) + .withEnableAutomaticUpgrade(true), + new VMGalleryApplication().withTags("bgycduiertgccym") + .withOrder(50940581) + .withPackageReferenceId("l") + .withConfigurationReference("slqlfmmdn") + .withTreatFailureAsDeploymentFailure(true) + .withEnableAutomaticUpgrade(true))); + model = BinaryData.fromObject(model).toObject(ApplicationProfile.class); + Assertions.assertEquals("nzdndslgna", model.galleryApplications().get(0).tags()); + Assertions.assertEquals(1257002665, model.galleryApplications().get(0).order()); + Assertions.assertEquals("gynduha", model.galleryApplications().get(0).packageReferenceId()); + Assertions.assertEquals("qlkth", model.galleryApplications().get(0).configurationReference()); + Assertions.assertTrue(model.galleryApplications().get(0).treatFailureAsDeploymentFailure()); + Assertions.assertTrue(model.galleryApplications().get(0).enableAutomaticUpgrade()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/BootDiagnosticsTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/BootDiagnosticsTests.java new file mode 100644 index 000000000000..4172d40359b1 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":\"sotftpvj\"}").toObject(BootDiagnostics.class); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("sotftpvj", model.storageUri()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BootDiagnostics model = new BootDiagnostics().withEnabled(false).withStorageUri("sotftpvj"); + model = BinaryData.fromObject(model).toObject(BootDiagnostics.class); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("sotftpvj", model.storageUri()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/CancelOperationsRequestTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/CancelOperationsRequestTests.java new file mode 100644 index 000000000000..f698de7e740f --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/CancelOperationsRequestTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.CancelOperationsRequest; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class CancelOperationsRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CancelOperationsRequest model = BinaryData.fromString( + "{\"operationIds\":[\"hairsbrgzdwms\",\"eypqwdxggicccn\",\"qhuexm\",\"ttlstvlzywemhz\"],\"correlationid\":\"ncsdtclusiyp\"}") + .toObject(CancelOperationsRequest.class); + Assertions.assertEquals("hairsbrgzdwms", model.operationIds().get(0)); + Assertions.assertEquals("ncsdtclusiyp", model.correlationId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CancelOperationsRequest model = new CancelOperationsRequest() + .withOperationIds(Arrays.asList("hairsbrgzdwms", "eypqwdxggicccn", "qhuexm", "ttlstvlzywemhz")) + .withCorrelationId("ncsdtclusiyp"); + model = BinaryData.fromObject(model).toObject(CancelOperationsRequest.class); + Assertions.assertEquals("hairsbrgzdwms", model.operationIds().get(0)); + Assertions.assertEquals("ncsdtclusiyp", model.correlationId()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/CapacityReservationProfileTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/CapacityReservationProfileTests.java new file mode 100644 index 000000000000..0f7fcbe90eba --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":\"pehindoygm\"}}") + .toObject(CapacityReservationProfile.class); + Assertions.assertEquals("pehindoygm", model.capacityReservationGroup().id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CapacityReservationProfile model + = new CapacityReservationProfile().withCapacityReservationGroup(new SubResource().withId("pehindoygm")); + model = BinaryData.fromObject(model).toObject(CapacityReservationProfile.class); + Assertions.assertEquals("pehindoygm", model.capacityReservationGroup().id()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/DataDiskTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/DataDiskTests.java new file mode 100644 index 000000000000..e39e48528f1b --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.ApiEntityReference; +import com.azure.resourcemanager.computebulkactions.models.CachingTypes; +import com.azure.resourcemanager.computebulkactions.models.DataDisk; +import com.azure.resourcemanager.computebulkactions.models.DiskCreateOptionTypes; +import com.azure.resourcemanager.computebulkactions.models.DiskDeleteOptionTypes; +import com.azure.resourcemanager.computebulkactions.models.DiskDetachOptionTypes; +import com.azure.resourcemanager.computebulkactions.models.DiskEncryptionSetParameters; +import com.azure.resourcemanager.computebulkactions.models.ManagedDiskParameters; +import com.azure.resourcemanager.computebulkactions.models.SecurityEncryptionTypes; +import com.azure.resourcemanager.computebulkactions.models.StorageAccountTypes; +import com.azure.resourcemanager.computebulkactions.models.VMDiskSecurityProfile; +import com.azure.resourcemanager.computebulkactions.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\":102046613,\"name\":\"hkh\",\"vhd\":{\"uri\":\"igdtopbob\"},\"image\":{\"uri\":\"hm\"},\"caching\":\"ReadOnly\",\"writeAcceleratorEnabled\":false,\"createOption\":\"FromImage\",\"diskSizeGB\":1242660761,\"managedDisk\":{\"storageAccountType\":\"Premium_ZRS\",\"diskEncryptionSet\":{\"id\":\"vtpgvdfgiotkf\"},\"securityProfile\":{\"securityEncryptionType\":\"VMGuestStateOnly\",\"diskEncryptionSet\":{\"id\":\"ngxlefgugnxkrxdq\"}},\"id\":\"dt\"},\"sourceResource\":{\"id\":\"rvqdra\"},\"toBeDetached\":false,\"detachOption\":\"ForceDetach\",\"deleteOption\":\"Detach\"}") + .toObject(DataDisk.class); + Assertions.assertEquals(102046613, model.lun()); + Assertions.assertEquals("hkh", model.name()); + Assertions.assertEquals("igdtopbob", model.vhd().uri()); + Assertions.assertEquals("hm", model.image().uri()); + Assertions.assertEquals(CachingTypes.READ_ONLY, model.caching()); + Assertions.assertFalse(model.writeAcceleratorEnabled()); + Assertions.assertEquals(DiskCreateOptionTypes.FROM_IMAGE, model.createOption()); + Assertions.assertEquals(1242660761, model.diskSizeGB()); + Assertions.assertEquals("dt", model.managedDisk().id()); + Assertions.assertEquals(StorageAccountTypes.PREMIUM_ZRS, model.managedDisk().storageAccountType()); + Assertions.assertEquals("vtpgvdfgiotkf", model.managedDisk().diskEncryptionSet().id()); + Assertions.assertEquals(SecurityEncryptionTypes.VMGUEST_STATE_ONLY, + model.managedDisk().securityProfile().securityEncryptionType()); + Assertions.assertEquals("ngxlefgugnxkrxdq", model.managedDisk().securityProfile().diskEncryptionSet().id()); + Assertions.assertEquals("rvqdra", model.sourceResource().id()); + Assertions.assertFalse(model.toBeDetached()); + Assertions.assertEquals(DiskDetachOptionTypes.FORCE_DETACH, model.detachOption()); + Assertions.assertEquals(DiskDeleteOptionTypes.DETACH, model.deleteOption()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DataDisk model + = new DataDisk().withLun(102046613) + .withName("hkh") + .withVhd(new VirtualHardDisk().withUri("igdtopbob")) + .withImage(new VirtualHardDisk().withUri("hm")) + .withCaching(CachingTypes.READ_ONLY) + .withWriteAcceleratorEnabled(false) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiskSizeGB(1242660761) + .withManagedDisk(new ManagedDiskParameters().withId("dt") + .withStorageAccountType(StorageAccountTypes.PREMIUM_ZRS) + .withDiskEncryptionSet(new DiskEncryptionSetParameters().withId("vtpgvdfgiotkf")) + .withSecurityProfile(new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet(new DiskEncryptionSetParameters().withId("ngxlefgugnxkrxdq")))) + .withSourceResource(new ApiEntityReference().withId("rvqdra")) + .withToBeDetached(false) + .withDetachOption(DiskDetachOptionTypes.FORCE_DETACH) + .withDeleteOption(DiskDeleteOptionTypes.DETACH); + model = BinaryData.fromObject(model).toObject(DataDisk.class); + Assertions.assertEquals(102046613, model.lun()); + Assertions.assertEquals("hkh", model.name()); + Assertions.assertEquals("igdtopbob", model.vhd().uri()); + Assertions.assertEquals("hm", model.image().uri()); + Assertions.assertEquals(CachingTypes.READ_ONLY, model.caching()); + Assertions.assertFalse(model.writeAcceleratorEnabled()); + Assertions.assertEquals(DiskCreateOptionTypes.FROM_IMAGE, model.createOption()); + Assertions.assertEquals(1242660761, model.diskSizeGB()); + Assertions.assertEquals("dt", model.managedDisk().id()); + Assertions.assertEquals(StorageAccountTypes.PREMIUM_ZRS, model.managedDisk().storageAccountType()); + Assertions.assertEquals("vtpgvdfgiotkf", model.managedDisk().diskEncryptionSet().id()); + Assertions.assertEquals(SecurityEncryptionTypes.VMGUEST_STATE_ONLY, + model.managedDisk().securityProfile().securityEncryptionType()); + Assertions.assertEquals("ngxlefgugnxkrxdq", model.managedDisk().securityProfile().diskEncryptionSet().id()); + Assertions.assertEquals("rvqdra", model.sourceResource().id()); + Assertions.assertFalse(model.toBeDetached()); + Assertions.assertEquals(DiskDetachOptionTypes.FORCE_DETACH, model.detachOption()); + Assertions.assertEquals(DiskDeleteOptionTypes.DETACH, model.deleteOption()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/DiagnosticsProfileTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/DiagnosticsProfileTests.java new file mode 100644 index 000000000000..b1546dd7895f --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.BootDiagnostics; +import com.azure.resourcemanager.computebulkactions.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\":\"rfbjf\"}}") + .toObject(DiagnosticsProfile.class); + Assertions.assertFalse(model.bootDiagnostics().enabled()); + Assertions.assertEquals("rfbjf", model.bootDiagnostics().storageUri()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DiagnosticsProfile model = new DiagnosticsProfile() + .withBootDiagnostics(new BootDiagnostics().withEnabled(false).withStorageUri("rfbjf")); + model = BinaryData.fromObject(model).toObject(DiagnosticsProfile.class); + Assertions.assertFalse(model.bootDiagnostics().enabled()); + Assertions.assertEquals("rfbjf", model.bootDiagnostics().storageUri()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/DiffDiskSettingsTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/DiffDiskSettingsTests.java new file mode 100644 index 000000000000..8b701ca21136 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.DiffDiskOptions; +import com.azure.resourcemanager.computebulkactions.models.DiffDiskPlacement; +import com.azure.resourcemanager.computebulkactions.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/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/DiskEncryptionSetParametersTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/DiskEncryptionSetParametersTests.java new file mode 100644 index 000000000000..0628e4acf014 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/DiskEncryptionSetParametersTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.DiskEncryptionSetParameters; +import org.junit.jupiter.api.Assertions; + +public final class DiskEncryptionSetParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DiskEncryptionSetParameters model + = BinaryData.fromString("{\"id\":\"kw\"}").toObject(DiskEncryptionSetParameters.class); + Assertions.assertEquals("kw", model.id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DiskEncryptionSetParameters model = new DiskEncryptionSetParameters().withId("kw"); + model = BinaryData.fromObject(model).toObject(DiskEncryptionSetParameters.class); + Assertions.assertEquals("kw", model.id()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/EncryptionIdentityTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/EncryptionIdentityTests.java new file mode 100644 index 000000000000..a346a1016c56 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":\"vasrruvwb\"}") + .toObject(EncryptionIdentity.class); + Assertions.assertEquals("vasrruvwb", model.userAssignedIdentityResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EncryptionIdentity model = new EncryptionIdentity().withUserAssignedIdentityResourceId("vasrruvwb"); + model = BinaryData.fromObject(model).toObject(EncryptionIdentity.class); + Assertions.assertEquals("vasrruvwb", model.userAssignedIdentityResourceId()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/EventGridAndResourceGraphTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/EventGridAndResourceGraphTests.java new file mode 100644 index 000000000000..4bb57495d2cc --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":\"t\"}") + .toObject(EventGridAndResourceGraph.class); + Assertions.assertFalse(model.enable()); + Assertions.assertEquals("t", model.scheduledEventsApiVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EventGridAndResourceGraph model + = new EventGridAndResourceGraph().withEnable(false).withScheduledEventsApiVersion("t"); + model = BinaryData.fromObject(model).toObject(EventGridAndResourceGraph.class); + Assertions.assertFalse(model.enable()); + Assertions.assertEquals("t", model.scheduledEventsApiVersion()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ExecuteCreateRequestTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ExecuteCreateRequestTests.java new file mode 100644 index 000000000000..0b575c3ef5a5 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ExecuteCreateRequestTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.ExecuteCreateRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.computebulkactions.models.OptimizationPreference; +import com.azure.resourcemanager.computebulkactions.models.ResourceProvisionPayload; +import com.azure.resourcemanager.computebulkactions.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 ExecuteCreateRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ExecuteCreateRequest model = BinaryData.fromString( + "{\"resourceConfigParameters\":{\"baseProfile\":{\"ofncckwyfzqwhxxb\":\"\\\"dataaztz\\\"\",\"xzfe\":\"\\\"datayq\\\"\",\"mncwsobqwcsdb\":\"\\\"dataztppriolxorjalto\\\"\"},\"resourceOverrides\":[{\"lsbjjcanvxbv\":\"\\\"datafhucqdpfuv\\\"\"},{\"mr\":\"\\\"dataudutnco\\\"\",\"f\":\"\\\"dataxqtvcofu\\\"\",\"u\":\"\\\"datavkg\\\"\"},{\"n\":\"\\\"datadknnqvsazn\\\"\",\"mkycgra\":\"\\\"dataorudsgsa\\\"\"}],\"resourceCount\":1064161892,\"resourcePrefix\":\"uetae\"},\"executionParameters\":{\"optimizationPreference\":\"Availability\",\"retryPolicy\":{\"retryCount\":1552436434,\"retryWindowInMinutes\":973815152}},\"correlationid\":\"s\"}") + .toObject(ExecuteCreateRequest.class); + Assertions.assertEquals(1064161892, model.resourceConfigParameters().resourceCount()); + Assertions.assertEquals("uetae", model.resourceConfigParameters().resourcePrefix()); + Assertions.assertEquals(OptimizationPreference.AVAILABILITY, + model.executionParameters().optimizationPreference()); + Assertions.assertEquals(1552436434, model.executionParameters().retryPolicy().retryCount()); + Assertions.assertEquals(973815152, model.executionParameters().retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals("s", model.correlationId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ExecuteCreateRequest model = new ExecuteCreateRequest() + .withResourceConfigParameters(new ResourceProvisionPayload() + .withBaseProfile( + mapOf("ofncckwyfzqwhxxb", BinaryData.fromBytes("\"dataaztz\"".getBytes(StandardCharsets.UTF_8)), + "xzfe", BinaryData.fromBytes("\"datayq\"".getBytes(StandardCharsets.UTF_8)), "mncwsobqwcsdb", + BinaryData.fromBytes("\"dataztppriolxorjalto\"".getBytes(StandardCharsets.UTF_8)))) + .withResourceOverrides(Arrays.asList( + mapOf("lsbjjcanvxbv", BinaryData.fromBytes("\"datafhucqdpfuv\"".getBytes(StandardCharsets.UTF_8))), + mapOf("mr", BinaryData.fromBytes("\"dataudutnco\"".getBytes(StandardCharsets.UTF_8)), "f", + BinaryData.fromBytes("\"dataxqtvcofu\"".getBytes(StandardCharsets.UTF_8)), "u", + BinaryData.fromBytes("\"datavkg\"".getBytes(StandardCharsets.UTF_8))), + mapOf("n", BinaryData.fromBytes("\"datadknnqvsazn\"".getBytes(StandardCharsets.UTF_8)), "mkycgra", + BinaryData.fromBytes("\"dataorudsgsa\"".getBytes(StandardCharsets.UTF_8))))) + .withResourceCount(1064161892) + .withResourcePrefix("uetae")) + .withExecutionParameters( + new ExecutionParameters().withOptimizationPreference(OptimizationPreference.AVAILABILITY) + .withRetryPolicy(new RetryPolicy().withRetryCount(1552436434).withRetryWindowInMinutes(973815152))) + .withCorrelationId("s"); + model = BinaryData.fromObject(model).toObject(ExecuteCreateRequest.class); + Assertions.assertEquals(1064161892, model.resourceConfigParameters().resourceCount()); + Assertions.assertEquals("uetae", model.resourceConfigParameters().resourcePrefix()); + Assertions.assertEquals(OptimizationPreference.AVAILABILITY, + model.executionParameters().optimizationPreference()); + Assertions.assertEquals(1552436434, model.executionParameters().retryPolicy().retryCount()); + Assertions.assertEquals(973815152, model.executionParameters().retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals("s", model.correlationId()); + } + + // 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/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ExecuteDeallocateRequestTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ExecuteDeallocateRequestTests.java new file mode 100644 index 000000000000..100e87292941 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ExecuteDeallocateRequestTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.ExecuteDeallocateRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.computebulkactions.models.OptimizationPreference; +import com.azure.resourcemanager.computebulkactions.models.Resources; +import com.azure.resourcemanager.computebulkactions.models.RetryPolicy; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ExecuteDeallocateRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ExecuteDeallocateRequest model = BinaryData.fromString( + "{\"executionParameters\":{\"optimizationPreference\":\"Availability\",\"retryPolicy\":{\"retryCount\":2063960908,\"retryWindowInMinutes\":2031634096}},\"resources\":{\"ids\":[\"su\",\"arm\",\"wdmjsjqbjhhyx\",\"rw\"]},\"correlationid\":\"yc\"}") + .toObject(ExecuteDeallocateRequest.class); + Assertions.assertEquals(OptimizationPreference.AVAILABILITY, + model.executionParameters().optimizationPreference()); + Assertions.assertEquals(2063960908, model.executionParameters().retryPolicy().retryCount()); + Assertions.assertEquals(2031634096, model.executionParameters().retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals("su", model.resources().ids().get(0)); + Assertions.assertEquals("yc", model.correlationId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ExecuteDeallocateRequest model = new ExecuteDeallocateRequest() + .withExecutionParameters( + new ExecutionParameters().withOptimizationPreference(OptimizationPreference.AVAILABILITY) + .withRetryPolicy(new RetryPolicy().withRetryCount(2063960908).withRetryWindowInMinutes(2031634096))) + .withResources(new Resources().withIds(Arrays.asList("su", "arm", "wdmjsjqbjhhyx", "rw"))) + .withCorrelationId("yc"); + model = BinaryData.fromObject(model).toObject(ExecuteDeallocateRequest.class); + Assertions.assertEquals(OptimizationPreference.AVAILABILITY, + model.executionParameters().optimizationPreference()); + Assertions.assertEquals(2063960908, model.executionParameters().retryPolicy().retryCount()); + Assertions.assertEquals(2031634096, model.executionParameters().retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals("su", model.resources().ids().get(0)); + Assertions.assertEquals("yc", model.correlationId()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ExecuteDeleteRequestTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ExecuteDeleteRequestTests.java new file mode 100644 index 000000000000..986c60f0e867 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ExecuteDeleteRequestTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.ExecuteDeleteRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.computebulkactions.models.OptimizationPreference; +import com.azure.resourcemanager.computebulkactions.models.Resources; +import com.azure.resourcemanager.computebulkactions.models.RetryPolicy; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ExecuteDeleteRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ExecuteDeleteRequest model = BinaryData.fromString( + "{\"executionParameters\":{\"optimizationPreference\":\"CostAvailabilityBalanced\",\"retryPolicy\":{\"retryCount\":71172193,\"retryWindowInMinutes\":1165571898}},\"resources\":{\"ids\":[\"snfdsdoakgtdl\",\"kkze\",\"dlhewp\",\"sdsttwvog\"]},\"correlationid\":\"bbejdcngqqm\",\"forceDeletion\":false}") + .toObject(ExecuteDeleteRequest.class); + Assertions.assertEquals(OptimizationPreference.COST_AVAILABILITY_BALANCED, + model.executionParameters().optimizationPreference()); + Assertions.assertEquals(71172193, model.executionParameters().retryPolicy().retryCount()); + Assertions.assertEquals(1165571898, model.executionParameters().retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals("snfdsdoakgtdl", model.resources().ids().get(0)); + Assertions.assertEquals("bbejdcngqqm", model.correlationId()); + Assertions.assertFalse(model.forceDeletion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ExecuteDeleteRequest model = new ExecuteDeleteRequest() + .withExecutionParameters( + new ExecutionParameters().withOptimizationPreference(OptimizationPreference.COST_AVAILABILITY_BALANCED) + .withRetryPolicy(new RetryPolicy().withRetryCount(71172193).withRetryWindowInMinutes(1165571898))) + .withResources(new Resources().withIds(Arrays.asList("snfdsdoakgtdl", "kkze", "dlhewp", "sdsttwvog"))) + .withCorrelationId("bbejdcngqqm") + .withForceDeletion(false); + model = BinaryData.fromObject(model).toObject(ExecuteDeleteRequest.class); + Assertions.assertEquals(OptimizationPreference.COST_AVAILABILITY_BALANCED, + model.executionParameters().optimizationPreference()); + Assertions.assertEquals(71172193, model.executionParameters().retryPolicy().retryCount()); + Assertions.assertEquals(1165571898, model.executionParameters().retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals("snfdsdoakgtdl", model.resources().ids().get(0)); + Assertions.assertEquals("bbejdcngqqm", model.correlationId()); + Assertions.assertFalse(model.forceDeletion()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ExecuteHibernateRequestTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ExecuteHibernateRequestTests.java new file mode 100644 index 000000000000..2e891132f436 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ExecuteHibernateRequestTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.ExecuteHibernateRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.computebulkactions.models.OptimizationPreference; +import com.azure.resourcemanager.computebulkactions.models.Resources; +import com.azure.resourcemanager.computebulkactions.models.RetryPolicy; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ExecuteHibernateRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ExecuteHibernateRequest model = BinaryData.fromString( + "{\"executionParameters\":{\"optimizationPreference\":\"Cost\",\"retryPolicy\":{\"retryCount\":699446772,\"retryWindowInMinutes\":767638110}},\"resources\":{\"ids\":[\"lwnwxuqlcvydyp\",\"tdooaoj\",\"niodkooeb\"]},\"correlationid\":\"nuj\"}") + .toObject(ExecuteHibernateRequest.class); + Assertions.assertEquals(OptimizationPreference.COST, model.executionParameters().optimizationPreference()); + Assertions.assertEquals(699446772, model.executionParameters().retryPolicy().retryCount()); + Assertions.assertEquals(767638110, model.executionParameters().retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals("lwnwxuqlcvydyp", model.resources().ids().get(0)); + Assertions.assertEquals("nuj", model.correlationId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ExecuteHibernateRequest model = new ExecuteHibernateRequest() + .withExecutionParameters(new ExecutionParameters().withOptimizationPreference(OptimizationPreference.COST) + .withRetryPolicy(new RetryPolicy().withRetryCount(699446772).withRetryWindowInMinutes(767638110))) + .withResources(new Resources().withIds(Arrays.asList("lwnwxuqlcvydyp", "tdooaoj", "niodkooeb"))) + .withCorrelationId("nuj"); + model = BinaryData.fromObject(model).toObject(ExecuteHibernateRequest.class); + Assertions.assertEquals(OptimizationPreference.COST, model.executionParameters().optimizationPreference()); + Assertions.assertEquals(699446772, model.executionParameters().retryPolicy().retryCount()); + Assertions.assertEquals(767638110, model.executionParameters().retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals("lwnwxuqlcvydyp", model.resources().ids().get(0)); + Assertions.assertEquals("nuj", model.correlationId()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ExecuteStartRequestTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ExecuteStartRequestTests.java new file mode 100644 index 000000000000..e1132e2a9c12 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ExecuteStartRequestTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.ExecuteStartRequest; +import com.azure.resourcemanager.computebulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.computebulkactions.models.OptimizationPreference; +import com.azure.resourcemanager.computebulkactions.models.Resources; +import com.azure.resourcemanager.computebulkactions.models.RetryPolicy; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ExecuteStartRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ExecuteStartRequest model = BinaryData.fromString( + "{\"executionParameters\":{\"optimizationPreference\":\"Cost\",\"retryPolicy\":{\"retryCount\":24291544,\"retryWindowInMinutes\":1252976241}},\"resources\":{\"ids\":[\"fpagaowpulp\",\"blylsyxkqjnsj\"]},\"correlationid\":\"r\"}") + .toObject(ExecuteStartRequest.class); + Assertions.assertEquals(OptimizationPreference.COST, model.executionParameters().optimizationPreference()); + Assertions.assertEquals(24291544, model.executionParameters().retryPolicy().retryCount()); + Assertions.assertEquals(1252976241, model.executionParameters().retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals("fpagaowpulp", model.resources().ids().get(0)); + Assertions.assertEquals("r", model.correlationId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ExecuteStartRequest model = new ExecuteStartRequest() + .withExecutionParameters(new ExecutionParameters().withOptimizationPreference(OptimizationPreference.COST) + .withRetryPolicy(new RetryPolicy().withRetryCount(24291544).withRetryWindowInMinutes(1252976241))) + .withResources(new Resources().withIds(Arrays.asList("fpagaowpulp", "blylsyxkqjnsj"))) + .withCorrelationId("r"); + model = BinaryData.fromObject(model).toObject(ExecuteStartRequest.class); + Assertions.assertEquals(OptimizationPreference.COST, model.executionParameters().optimizationPreference()); + Assertions.assertEquals(24291544, model.executionParameters().retryPolicy().retryCount()); + Assertions.assertEquals(1252976241, model.executionParameters().retryPolicy().retryWindowInMinutes()); + Assertions.assertEquals("fpagaowpulp", model.resources().ids().get(0)); + Assertions.assertEquals("r", model.correlationId()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ExecutionParametersTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ExecutionParametersTests.java new file mode 100644 index 000000000000..efe707843b5c --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ExecutionParametersTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.ExecutionParameters; +import com.azure.resourcemanager.computebulkactions.models.OptimizationPreference; +import com.azure.resourcemanager.computebulkactions.models.RetryPolicy; +import org.junit.jupiter.api.Assertions; + +public final class ExecutionParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ExecutionParameters model = BinaryData.fromString( + "{\"optimizationPreference\":\"Cost\",\"retryPolicy\":{\"retryCount\":1017473450,\"retryWindowInMinutes\":1622537719}}") + .toObject(ExecutionParameters.class); + Assertions.assertEquals(OptimizationPreference.COST, model.optimizationPreference()); + Assertions.assertEquals(1017473450, model.retryPolicy().retryCount()); + Assertions.assertEquals(1622537719, model.retryPolicy().retryWindowInMinutes()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ExecutionParameters model = new ExecutionParameters().withOptimizationPreference(OptimizationPreference.COST) + .withRetryPolicy(new RetryPolicy().withRetryCount(1017473450).withRetryWindowInMinutes(1622537719)); + model = BinaryData.fromObject(model).toObject(ExecutionParameters.class); + Assertions.assertEquals(OptimizationPreference.COST, model.optimizationPreference()); + Assertions.assertEquals(1017473450, model.retryPolicy().retryCount()); + Assertions.assertEquals(1622537719, model.retryPolicy().retryWindowInMinutes()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/GetOperationStatusRequestTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/GetOperationStatusRequestTests.java new file mode 100644 index 000000000000..7165497ddf51 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/GetOperationStatusRequestTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.GetOperationStatusRequest; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class GetOperationStatusRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GetOperationStatusRequest model = BinaryData + .fromString("{\"operationIds\":[\"ae\",\"u\",\"ah\",\"icslfaoq\"],\"correlationid\":\"piyylhalnswhccsp\"}") + .toObject(GetOperationStatusRequest.class); + Assertions.assertEquals("ae", model.operationIds().get(0)); + Assertions.assertEquals("piyylhalnswhccsp", model.correlationId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GetOperationStatusRequest model + = new GetOperationStatusRequest().withOperationIds(Arrays.asList("ae", "u", "ah", "icslfaoq")) + .withCorrelationId("piyylhalnswhccsp"); + model = BinaryData.fromObject(model).toObject(GetOperationStatusRequest.class); + Assertions.assertEquals("ae", model.operationIds().get(0)); + Assertions.assertEquals("piyylhalnswhccsp", model.correlationId()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/HostEndpointSettingsTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/HostEndpointSettingsTests.java new file mode 100644 index 000000000000..a491d4da464c --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.HostEndpointSettings; +import com.azure.resourcemanager.computebulkactions.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\":\"Audit\",\"inVMAccessControlProfileReferenceId\":\"birx\"}") + .toObject(HostEndpointSettings.class); + Assertions.assertEquals(Modes.AUDIT, model.mode()); + Assertions.assertEquals("birx", model.inVMAccessControlProfileReferenceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HostEndpointSettings model + = new HostEndpointSettings().withMode(Modes.AUDIT).withInVMAccessControlProfileReferenceId("birx"); + model = BinaryData.fromObject(model).toObject(HostEndpointSettings.class); + Assertions.assertEquals(Modes.AUDIT, model.mode()); + Assertions.assertEquals("birx", model.inVMAccessControlProfileReferenceId()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ImageReferenceTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ImageReferenceTests.java new file mode 100644 index 000000000000..3ab324b30614 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":\"qex\",\"offer\":\"ocxscpaierhhbcs\",\"sku\":\"ummajtjaod\",\"version\":\"bnbdxkqpxokajion\",\"sharedGalleryImageId\":\"mexgstxgcp\",\"communityGalleryImageId\":\"gmaajrm\",\"id\":\"jwzrl\"}") + .toObject(ImageReference.class); + Assertions.assertEquals("jwzrl", model.id()); + Assertions.assertEquals("qex", model.publisher()); + Assertions.assertEquals("ocxscpaierhhbcs", model.offer()); + Assertions.assertEquals("ummajtjaod", model.sku()); + Assertions.assertEquals("bnbdxkqpxokajion", model.version()); + Assertions.assertEquals("mexgstxgcp", model.sharedGalleryImageId()); + Assertions.assertEquals("gmaajrm", model.communityGalleryImageId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ImageReference model = new ImageReference().withId("jwzrl") + .withPublisher("qex") + .withOffer("ocxscpaierhhbcs") + .withSku("ummajtjaod") + .withVersion("bnbdxkqpxokajion") + .withSharedGalleryImageId("mexgstxgcp") + .withCommunityGalleryImageId("gmaajrm"); + model = BinaryData.fromObject(model).toObject(ImageReference.class); + Assertions.assertEquals("jwzrl", model.id()); + Assertions.assertEquals("qex", model.publisher()); + Assertions.assertEquals("ocxscpaierhhbcs", model.offer()); + Assertions.assertEquals("ummajtjaod", model.sku()); + Assertions.assertEquals("bnbdxkqpxokajion", model.version()); + Assertions.assertEquals("mexgstxgcp", model.sharedGalleryImageId()); + Assertions.assertEquals("gmaajrm", model.communityGalleryImageId()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/InnerErrorTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/InnerErrorTests.java new file mode 100644 index 000000000000..8ddcb8175744 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":\"idb\",\"errorDetail\":\"atpxl\"}").toObject(InnerError.class); + Assertions.assertEquals("idb", model.exceptionType()); + Assertions.assertEquals("atpxl", model.errorDetail()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/LinuxPatchSettingsTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/LinuxPatchSettingsTests.java new file mode 100644 index 000000000000..2565854f9e2c --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.LinuxPatchAssessmentMode; +import com.azure.resourcemanager.computebulkactions.models.LinuxPatchSettings; +import com.azure.resourcemanager.computebulkactions.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.computebulkactions.models.LinuxVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.computebulkactions.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\":\"Always\",\"bypassPlatformSafetyChecksOnUserSchedule\":false}}") + .toObject(LinuxPatchSettings.class); + Assertions.assertEquals(LinuxVMGuestPatchMode.AUTOMATIC_BY_PLATFORM, model.patchMode()); + Assertions.assertEquals(LinuxPatchAssessmentMode.AUTOMATIC_BY_PLATFORM, model.assessmentMode()); + Assertions.assertEquals(LinuxVMGuestPatchAutomaticByPlatformRebootSetting.ALWAYS, + model.automaticByPlatformSettings().rebootSetting()); + Assertions.assertFalse(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.ALWAYS) + .withBypassPlatformSafetyChecksOnUserSchedule(false)); + 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.ALWAYS, + model.automaticByPlatformSettings().rebootSetting()); + Assertions.assertFalse(model.automaticByPlatformSettings().bypassPlatformSafetyChecksOnUserSchedule()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/LinuxVMGuestPatchAutomaticByPlatformSettingsTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/LinuxVMGuestPatchAutomaticByPlatformSettingsTests.java new file mode 100644 index 000000000000..28dd13e6e93b --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.computebulkactions.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\":\"Always\",\"bypassPlatformSafetyChecksOnUserSchedule\":false}") + .toObject(LinuxVMGuestPatchAutomaticByPlatformSettings.class); + Assertions.assertEquals(LinuxVMGuestPatchAutomaticByPlatformRebootSetting.ALWAYS, model.rebootSetting()); + Assertions.assertFalse(model.bypassPlatformSafetyChecksOnUserSchedule()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + LinuxVMGuestPatchAutomaticByPlatformSettings model = new LinuxVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting(LinuxVMGuestPatchAutomaticByPlatformRebootSetting.ALWAYS) + .withBypassPlatformSafetyChecksOnUserSchedule(false); + model = BinaryData.fromObject(model).toObject(LinuxVMGuestPatchAutomaticByPlatformSettings.class); + Assertions.assertEquals(LinuxVMGuestPatchAutomaticByPlatformRebootSetting.ALWAYS, model.rebootSetting()); + Assertions.assertFalse(model.bypassPlatformSafetyChecksOnUserSchedule()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ManagedDiskParametersTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ManagedDiskParametersTests.java new file mode 100644 index 000000000000..4fee1594f170 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ManagedDiskParametersTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.DiskEncryptionSetParameters; +import com.azure.resourcemanager.computebulkactions.models.ManagedDiskParameters; +import com.azure.resourcemanager.computebulkactions.models.SecurityEncryptionTypes; +import com.azure.resourcemanager.computebulkactions.models.StorageAccountTypes; +import com.azure.resourcemanager.computebulkactions.models.VMDiskSecurityProfile; +import org.junit.jupiter.api.Assertions; + +public final class ManagedDiskParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedDiskParameters model = BinaryData.fromString( + "{\"storageAccountType\":\"PremiumV2_LRS\",\"diskEncryptionSet\":{\"id\":\"qbzvddntwnd\"},\"securityProfile\":{\"securityEncryptionType\":\"VMGuestStateOnly\",\"diskEncryptionSet\":{\"id\":\"npzaoq\"}},\"id\":\"hrhcffcyddglmjth\"}") + .toObject(ManagedDiskParameters.class); + Assertions.assertEquals("hrhcffcyddglmjth", model.id()); + Assertions.assertEquals(StorageAccountTypes.PREMIUM_V2_LRS, model.storageAccountType()); + Assertions.assertEquals("qbzvddntwnd", model.diskEncryptionSet().id()); + Assertions.assertEquals(SecurityEncryptionTypes.VMGUEST_STATE_ONLY, + model.securityProfile().securityEncryptionType()); + Assertions.assertEquals("npzaoq", model.securityProfile().diskEncryptionSet().id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedDiskParameters model = new ManagedDiskParameters().withId("hrhcffcyddglmjth") + .withStorageAccountType(StorageAccountTypes.PREMIUM_V2_LRS) + .withDiskEncryptionSet(new DiskEncryptionSetParameters().withId("qbzvddntwnd")) + .withSecurityProfile( + new VMDiskSecurityProfile().withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet(new DiskEncryptionSetParameters().withId("npzaoq"))); + model = BinaryData.fromObject(model).toObject(ManagedDiskParameters.class); + Assertions.assertEquals("hrhcffcyddglmjth", model.id()); + Assertions.assertEquals(StorageAccountTypes.PREMIUM_V2_LRS, model.storageAccountType()); + Assertions.assertEquals("qbzvddntwnd", model.diskEncryptionSet().id()); + Assertions.assertEquals(SecurityEncryptionTypes.VMGUEST_STATE_ONLY, + model.securityProfile().securityEncryptionType()); + Assertions.assertEquals("npzaoq", model.securityProfile().diskEncryptionSet().id()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ManagedServiceIdentityTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ManagedServiceIdentityTests.java new file mode 100644 index 000000000000..983fce5152e7 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.computebulkactions.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.computebulkactions.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\":\"a\",\"tenantId\":\"vpnpp\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"wqapnedgfbcvk\":{\"principalId\":\"wdmhdlxyjrxs\",\"clientId\":\"afcnih\"},\"tbobz\":{\"principalId\":\"q\",\"clientId\":\"keqdcvdrhvoods\"},\"rslpmutwuoeg\":{\"principalId\":\"pcjwv\",\"clientId\":\"dldwmgxc\"}}}") + .toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("wqapnedgfbcvk", new UserAssignedIdentity(), "tbobz", + new UserAssignedIdentity(), "rslpmutwuoeg", new UserAssignedIdentity())); + model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_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/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/NetworkInterfaceReferencePropertiesTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/NetworkInterfaceReferencePropertiesTests.java new file mode 100644 index 000000000000..a651708e8c16 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.DeleteOptions; +import com.azure.resourcemanager.computebulkactions.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\":true,\"deleteOption\":\"Detach\"}") + .toObject(NetworkInterfaceReferenceProperties.class); + Assertions.assertTrue(model.primary()); + Assertions.assertEquals(DeleteOptions.DETACH, model.deleteOption()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkInterfaceReferenceProperties model + = new NetworkInterfaceReferenceProperties().withPrimary(true).withDeleteOption(DeleteOptions.DETACH); + model = BinaryData.fromObject(model).toObject(NetworkInterfaceReferenceProperties.class); + Assertions.assertTrue(model.primary()); + Assertions.assertEquals(DeleteOptions.DETACH, model.deleteOption()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/NetworkInterfaceReferenceTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/NetworkInterfaceReferenceTests.java new file mode 100644 index 000000000000..a0793ea3e6cf --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.DeleteOptions; +import com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceReference; +import com.azure.resourcemanager.computebulkactions.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\":\"Detach\"},\"id\":\"cktvfcivfsnkymuc\"}") + .toObject(NetworkInterfaceReference.class); + Assertions.assertEquals("cktvfcivfsnkymuc", model.id()); + Assertions.assertFalse(model.properties().primary()); + Assertions.assertEquals(DeleteOptions.DETACH, model.properties().deleteOption()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkInterfaceReference model = new NetworkInterfaceReference().withId("cktvfcivfsnkymuc") + .withProperties( + new NetworkInterfaceReferenceProperties().withPrimary(false).withDeleteOption(DeleteOptions.DETACH)); + model = BinaryData.fromObject(model).toObject(NetworkInterfaceReference.class); + Assertions.assertEquals("cktvfcivfsnkymuc", model.id()); + Assertions.assertFalse(model.properties().primary()); + Assertions.assertEquals(DeleteOptions.DETACH, model.properties().deleteOption()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/NetworkProfileTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/NetworkProfileTests.java new file mode 100644 index 000000000000..6b5a054073dd --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/NetworkProfileTests.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.DeleteOptions; +import com.azure.resourcemanager.computebulkactions.models.NetworkApiVersion; +import com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceAuxiliarySku; +import com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceReference; +import com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceReferenceProperties; +import com.azure.resourcemanager.computebulkactions.models.NetworkProfile; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceConfigurationProperties; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceDnsSettingsConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceIPConfiguration; +import com.azure.resourcemanager.computebulkactions.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\":\"f\"},{\"properties\":{\"primary\":false,\"deleteOption\":\"Detach\"},\"id\":\"pvhez\"},{\"properties\":{\"primary\":false,\"deleteOption\":\"Delete\"},\"id\":\"refovgmkqsleyyvx\"},{\"properties\":{\"primary\":false,\"deleteOption\":\"Detach\"},\"id\":\"t\"}],\"networkApiVersion\":\"2020-11-01\",\"networkInterfaceConfigurations\":[{\"name\":\"cr\",\"properties\":{\"primary\":true,\"deleteOption\":\"Detach\",\"enableAcceleratedNetworking\":true,\"disableTcpStateTracking\":false,\"enableFpga\":true,\"enableIPForwarding\":false,\"networkSecurityGroup\":{\"id\":\"sounqecanoaeu\"},\"dnsSettings\":{\"dnsServers\":[\"hltrpmopjmcmatuo\",\"thfuiuaodsfcpkvx\",\"dpuozmyz\",\"dagfuaxbezyiuok\"]},\"ipConfigurations\":[{\"name\":\"whrdxwzywqsmbsu\",\"properties\":{}},{\"name\":\"xim\",\"properties\":{}},{\"name\":\"yocf\",\"properties\":{}},{\"name\":\"ksymd\",\"properties\":{}}],\"dscpConfiguration\":{\"id\":\"kiiuxhqyudxor\"},\"auxiliaryMode\":\"None\",\"auxiliarySku\":\"A4\"},\"tags\":{\"llr\":\"zvyifqrvkdvj\",\"xxbczwtr\":\"vvdfwatkpnpul\"}},{\"name\":\"wiqzbqjvsovmyo\",\"properties\":{\"primary\":true,\"deleteOption\":\"Delete\",\"enableAcceleratedNetworking\":false,\"disableTcpStateTracking\":true,\"enableFpga\":true,\"enableIPForwarding\":true,\"networkSecurityGroup\":{\"id\":\"mflbv\"},\"dnsSettings\":{\"dnsServers\":[\"rkcciwwzjuqk\"]},\"ipConfigurations\":[{\"name\":\"sa\",\"properties\":{}}],\"dscpConfiguration\":{\"id\":\"uo\"},\"auxiliaryMode\":\"AcceleratedConnections\",\"auxiliarySku\":\"A1\"},\"tags\":{\"mjmvxieduugidyjr\":\"auu\",\"y\":\"f\"}},{\"name\":\"osvexcsonpclhoc\",\"properties\":{\"primary\":false,\"deleteOption\":\"Delete\",\"enableAcceleratedNetworking\":false,\"disableTcpStateTracking\":false,\"enableFpga\":false,\"enableIPForwarding\":true,\"networkSecurityGroup\":{\"id\":\"fmvfaxkffeiit\"},\"dnsSettings\":{\"dnsServers\":[\"ez\"]},\"ipConfigurations\":[{\"name\":\"shxmzsbbzoggigrx\",\"properties\":{}}],\"dscpConfiguration\":{\"id\":\"vjxxjnsp\"},\"auxiliaryMode\":\"None\",\"auxiliarySku\":\"A8\"},\"tags\":{\"udwtiukbl\":\"nkoukn\",\"o\":\"ngkpocipazy\",\"ntypmrbpizcdrqj\":\"gukgjnpiucgygevq\"}},{\"name\":\"dpydn\",\"properties\":{\"primary\":true,\"deleteOption\":\"Delete\",\"enableAcceleratedNetworking\":true,\"disableTcpStateTracking\":false,\"enableFpga\":false,\"enableIPForwarding\":true,\"networkSecurityGroup\":{\"id\":\"jttgzf\"},\"dnsSettings\":{\"dnsServers\":[\"cbkhajdeyeamdph\",\"g\",\"lpbuxwgipwhonowk\"]},\"ipConfigurations\":[{\"name\":\"hwankixzbinjepu\",\"properties\":{}},{\"name\":\"mryw\",\"properties\":{}},{\"name\":\"zoqftiyqzrnkcqvy\",\"properties\":{}},{\"name\":\"whzlsicohoq\",\"properties\":{}}],\"dscpConfiguration\":{\"id\":\"lryav\"},\"auxiliaryMode\":\"AcceleratedConnections\",\"auxiliarySku\":\"A4\"},\"tags\":{\"klyaxuconu\":\"mqhgyxzkonocuk\",\"pewr\":\"szfkbe\",\"kt\":\"jmwvvj\",\"ffrzpwvlqdqgbiqy\":\"xsenhwlr\"}}]}") + .toObject(NetworkProfile.class); + Assertions.assertEquals("f", 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("cr", model.networkInterfaceConfigurations().get(0).name()); + Assertions.assertTrue(model.networkInterfaceConfigurations().get(0).properties().primary()); + Assertions.assertEquals(DeleteOptions.DETACH, + model.networkInterfaceConfigurations().get(0).properties().deleteOption()); + Assertions.assertTrue(model.networkInterfaceConfigurations().get(0).properties().enableAcceleratedNetworking()); + Assertions.assertFalse(model.networkInterfaceConfigurations().get(0).properties().disableTcpStateTracking()); + Assertions.assertTrue(model.networkInterfaceConfigurations().get(0).properties().enableFpga()); + Assertions.assertFalse(model.networkInterfaceConfigurations().get(0).properties().enableIPForwarding()); + Assertions.assertEquals("sounqecanoaeu", + model.networkInterfaceConfigurations().get(0).properties().networkSecurityGroup().id()); + Assertions.assertEquals("hltrpmopjmcmatuo", + model.networkInterfaceConfigurations().get(0).properties().dnsSettings().dnsServers().get(0)); + Assertions.assertEquals("whrdxwzywqsmbsu", + model.networkInterfaceConfigurations().get(0).properties().ipConfigurations().get(0).name()); + Assertions.assertEquals("kiiuxhqyudxor", + model.networkInterfaceConfigurations().get(0).properties().dscpConfiguration().id()); + Assertions.assertEquals(NetworkInterfaceAuxiliaryMode.NONE, + model.networkInterfaceConfigurations().get(0).properties().auxiliaryMode()); + Assertions.assertEquals(NetworkInterfaceAuxiliarySku.A4, + model.networkInterfaceConfigurations().get(0).properties().auxiliarySku()); + Assertions.assertEquals("zvyifqrvkdvj", model.networkInterfaceConfigurations().get(0).tags().get("llr")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkProfile model = new NetworkProfile() + .withNetworkInterfaces(Arrays.asList( + new NetworkInterfaceReference().withId("f") + .withProperties(new NetworkInterfaceReferenceProperties().withPrimary(true) + .withDeleteOption(DeleteOptions.DELETE)), + new NetworkInterfaceReference().withId("pvhez") + .withProperties(new NetworkInterfaceReferenceProperties().withPrimary(false) + .withDeleteOption(DeleteOptions.DETACH)), + new NetworkInterfaceReference().withId("refovgmkqsleyyvx") + .withProperties(new NetworkInterfaceReferenceProperties().withPrimary(false) + .withDeleteOption(DeleteOptions.DELETE)), + new NetworkInterfaceReference().withId("t") + .withProperties(new NetworkInterfaceReferenceProperties().withPrimary(false) + .withDeleteOption(DeleteOptions.DETACH)))) + .withNetworkApiVersion(NetworkApiVersion.TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE) + .withNetworkInterfaceConfigurations(Arrays.asList( + new VirtualMachineNetworkInterfaceConfiguration().withName("cr") + .withProperties(new VirtualMachineNetworkInterfaceConfigurationProperties().withPrimary(true) + .withDeleteOption(DeleteOptions.DETACH) + .withEnableAcceleratedNetworking(true) + .withDisableTcpStateTracking(false) + .withEnableFpga(true) + .withEnableIPForwarding(false) + .withNetworkSecurityGroup(new SubResource().withId("sounqecanoaeu")) + .withDnsSettings(new VirtualMachineNetworkInterfaceDnsSettingsConfiguration().withDnsServers( + Arrays.asList("hltrpmopjmcmatuo", "thfuiuaodsfcpkvx", "dpuozmyz", "dagfuaxbezyiuok"))) + .withIpConfigurations(Arrays.asList( + new VirtualMachineNetworkInterfaceIPConfiguration().withName("whrdxwzywqsmbsu") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties()), + new VirtualMachineNetworkInterfaceIPConfiguration().withName("xim") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties()), + new VirtualMachineNetworkInterfaceIPConfiguration().withName("yocf") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties()), + new VirtualMachineNetworkInterfaceIPConfiguration().withName("ksymd") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties()))) + .withDscpConfiguration(new SubResource().withId("kiiuxhqyudxor")) + .withAuxiliaryMode(NetworkInterfaceAuxiliaryMode.NONE) + .withAuxiliarySku(NetworkInterfaceAuxiliarySku.A4)) + .withTags(mapOf("llr", "zvyifqrvkdvj", "xxbczwtr", "vvdfwatkpnpul")), + new VirtualMachineNetworkInterfaceConfiguration().withName("wiqzbqjvsovmyo") + .withProperties(new VirtualMachineNetworkInterfaceConfigurationProperties().withPrimary(true) + .withDeleteOption(DeleteOptions.DELETE) + .withEnableAcceleratedNetworking(false) + .withDisableTcpStateTracking(true) + .withEnableFpga(true) + .withEnableIPForwarding(true) + .withNetworkSecurityGroup(new SubResource().withId("mflbv")) + .withDnsSettings(new VirtualMachineNetworkInterfaceDnsSettingsConfiguration() + .withDnsServers(Arrays.asList("rkcciwwzjuqk"))) + .withIpConfigurations( + Arrays.asList(new VirtualMachineNetworkInterfaceIPConfiguration().withName("sa") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties()))) + .withDscpConfiguration(new SubResource().withId("uo")) + .withAuxiliaryMode(NetworkInterfaceAuxiliaryMode.ACCELERATED_CONNECTIONS) + .withAuxiliarySku(NetworkInterfaceAuxiliarySku.A1)) + .withTags(mapOf("mjmvxieduugidyjr", "auu", "y", "f")), + new VirtualMachineNetworkInterfaceConfiguration().withName("osvexcsonpclhoc") + .withProperties(new VirtualMachineNetworkInterfaceConfigurationProperties().withPrimary(false) + .withDeleteOption(DeleteOptions.DELETE) + .withEnableAcceleratedNetworking(false) + .withDisableTcpStateTracking(false) + .withEnableFpga(false) + .withEnableIPForwarding(true) + .withNetworkSecurityGroup(new SubResource().withId("fmvfaxkffeiit")) + .withDnsSettings(new VirtualMachineNetworkInterfaceDnsSettingsConfiguration() + .withDnsServers(Arrays.asList("ez"))) + .withIpConfigurations(Arrays + .asList(new VirtualMachineNetworkInterfaceIPConfiguration().withName("shxmzsbbzoggigrx") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties()))) + .withDscpConfiguration(new SubResource().withId("vjxxjnsp")) + .withAuxiliaryMode(NetworkInterfaceAuxiliaryMode.NONE) + .withAuxiliarySku(NetworkInterfaceAuxiliarySku.A8)) + .withTags(mapOf("udwtiukbl", "nkoukn", "o", "ngkpocipazy", "ntypmrbpizcdrqj", "gukgjnpiucgygevq")), + new VirtualMachineNetworkInterfaceConfiguration().withName("dpydn") + .withProperties(new VirtualMachineNetworkInterfaceConfigurationProperties().withPrimary(true) + .withDeleteOption(DeleteOptions.DELETE) + .withEnableAcceleratedNetworking(true) + .withDisableTcpStateTracking(false) + .withEnableFpga(false) + .withEnableIPForwarding(true) + .withNetworkSecurityGroup(new SubResource().withId("jttgzf")) + .withDnsSettings(new VirtualMachineNetworkInterfaceDnsSettingsConfiguration() + .withDnsServers(Arrays.asList("cbkhajdeyeamdph", "g", "lpbuxwgipwhonowk"))) + .withIpConfigurations(Arrays.asList( + new VirtualMachineNetworkInterfaceIPConfiguration().withName("hwankixzbinjepu") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties()), + new VirtualMachineNetworkInterfaceIPConfiguration().withName("mryw") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties()), + new VirtualMachineNetworkInterfaceIPConfiguration().withName("zoqftiyqzrnkcqvy") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties()), + new VirtualMachineNetworkInterfaceIPConfiguration().withName("whzlsicohoq") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties()))) + .withDscpConfiguration(new SubResource().withId("lryav")) + .withAuxiliaryMode(NetworkInterfaceAuxiliaryMode.ACCELERATED_CONNECTIONS) + .withAuxiliarySku(NetworkInterfaceAuxiliarySku.A4)) + .withTags(mapOf("klyaxuconu", "mqhgyxzkonocuk", "pewr", "szfkbe", "kt", "jmwvvj", + "ffrzpwvlqdqgbiqy", "xsenhwlr")))); + model = BinaryData.fromObject(model).toObject(NetworkProfile.class); + Assertions.assertEquals("f", 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("cr", model.networkInterfaceConfigurations().get(0).name()); + Assertions.assertTrue(model.networkInterfaceConfigurations().get(0).properties().primary()); + Assertions.assertEquals(DeleteOptions.DETACH, + model.networkInterfaceConfigurations().get(0).properties().deleteOption()); + Assertions.assertTrue(model.networkInterfaceConfigurations().get(0).properties().enableAcceleratedNetworking()); + Assertions.assertFalse(model.networkInterfaceConfigurations().get(0).properties().disableTcpStateTracking()); + Assertions.assertTrue(model.networkInterfaceConfigurations().get(0).properties().enableFpga()); + Assertions.assertFalse(model.networkInterfaceConfigurations().get(0).properties().enableIPForwarding()); + Assertions.assertEquals("sounqecanoaeu", + model.networkInterfaceConfigurations().get(0).properties().networkSecurityGroup().id()); + Assertions.assertEquals("hltrpmopjmcmatuo", + model.networkInterfaceConfigurations().get(0).properties().dnsSettings().dnsServers().get(0)); + Assertions.assertEquals("whrdxwzywqsmbsu", + model.networkInterfaceConfigurations().get(0).properties().ipConfigurations().get(0).name()); + Assertions.assertEquals("kiiuxhqyudxor", + model.networkInterfaceConfigurations().get(0).properties().dscpConfiguration().id()); + Assertions.assertEquals(NetworkInterfaceAuxiliaryMode.NONE, + model.networkInterfaceConfigurations().get(0).properties().auxiliaryMode()); + Assertions.assertEquals(NetworkInterfaceAuxiliarySku.A4, + model.networkInterfaceConfigurations().get(0).properties().auxiliarySku()); + Assertions.assertEquals("zvyifqrvkdvj", model.networkInterfaceConfigurations().get(0).tags().get("llr")); + } + + // 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/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/OSImageNotificationProfileTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/OSImageNotificationProfileTests.java new file mode 100644 index 000000000000..b670ea51a775 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/OSImageNotificationProfileTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":\"rjerv\",\"enable\":false}") + .toObject(OSImageNotificationProfile.class); + Assertions.assertEquals("rjerv", model.notBeforeTimeout()); + Assertions.assertFalse(model.enable()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OSImageNotificationProfile model + = new OSImageNotificationProfile().withNotBeforeTimeout("rjerv").withEnable(false); + model = BinaryData.fromObject(model).toObject(OSImageNotificationProfile.class); + Assertions.assertEquals("rjerv", model.notBeforeTimeout()); + Assertions.assertFalse(model.enable()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/OperationDisplayTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/OperationDisplayTests.java new file mode 100644 index 000000000000..55e99ebaeec5 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/OperationDisplayTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.OperationDisplay; + +public final class OperationDisplayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationDisplay model = BinaryData.fromString( + "{\"provider\":\"cdm\",\"resource\":\"rcryuanzwuxzdxta\",\"operation\":\"lhmwhfpmrqobm\",\"description\":\"kknryrtihf\"}") + .toObject(OperationDisplay.class); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/OperationInnerTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/OperationInnerTests.java new file mode 100644 index 000000000000..2d41b8a86ede --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/OperationInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.fluent.models.OperationInner; + +public final class OperationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationInner model = BinaryData.fromString( + "{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") + .toObject(OperationInner.class); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/OperationListResultTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/OperationListResultTests.java new file mode 100644 index 000000000000..7e5867e8b9b1 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/OperationListResultTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.implementation.models.OperationListResult; +import org.junit.jupiter.api.Assertions; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"fpownoizhwlr\",\"isDataAction\":false,\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"esaagdfm\",\"isDataAction\":true,\"display\":{\"provider\":\"j\",\"resource\":\"ifkwmrvktsizntoc\",\"operation\":\"a\",\"description\":\"ajpsquc\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kfo\"}") + .toObject(OperationListResult.class); + Assertions.assertEquals("kfo", model.nextLink()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/OperationsListMockTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/OperationsListMockTests.java new file mode 100644 index 000000000000..d42978214b25 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/OperationsListMockTests.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.computebulkactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.computebulkactions.ComputeBulkActionsManager; +import com.azure.resourcemanager.computebulkactions.models.Operation; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OperationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"name\":\"yhejhzisxgfp\",\"isDataAction\":true,\"display\":{\"provider\":\"pv\",\"resource\":\"r\",\"operation\":\"vu\",\"description\":\"raehtwdwrft\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; + + 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)); + + PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/PatchSettingsTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/PatchSettingsTests.java new file mode 100644 index 000000000000..b0c63cd92ec6 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.PatchSettings; +import com.azure.resourcemanager.computebulkactions.models.WindowsPatchAssessmentMode; +import com.azure.resourcemanager.computebulkactions.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.computebulkactions.models.WindowsVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.computebulkactions.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\":\"Manual\",\"enableHotpatching\":true,\"assessmentMode\":\"AutomaticByPlatform\",\"automaticByPlatformSettings\":{\"rebootSetting\":\"Always\",\"bypassPlatformSafetyChecksOnUserSchedule\":false}}") + .toObject(PatchSettings.class); + Assertions.assertEquals(WindowsVMGuestPatchMode.MANUAL, model.patchMode()); + Assertions.assertTrue(model.enableHotpatching()); + Assertions.assertEquals(WindowsPatchAssessmentMode.AUTOMATIC_BY_PLATFORM, 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.MANUAL) + .withEnableHotpatching(true) + .withAssessmentMode(WindowsPatchAssessmentMode.AUTOMATIC_BY_PLATFORM) + .withAutomaticByPlatformSettings(new WindowsVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting(WindowsVMGuestPatchAutomaticByPlatformRebootSetting.ALWAYS) + .withBypassPlatformSafetyChecksOnUserSchedule(false)); + model = BinaryData.fromObject(model).toObject(PatchSettings.class); + Assertions.assertEquals(WindowsVMGuestPatchMode.MANUAL, model.patchMode()); + Assertions.assertTrue(model.enableHotpatching()); + Assertions.assertEquals(WindowsPatchAssessmentMode.AUTOMATIC_BY_PLATFORM, model.assessmentMode()); + Assertions.assertEquals(WindowsVMGuestPatchAutomaticByPlatformRebootSetting.ALWAYS, + model.automaticByPlatformSettings().rebootSetting()); + Assertions.assertFalse(model.automaticByPlatformSettings().bypassPlatformSafetyChecksOnUserSchedule()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/PriorityProfileTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/PriorityProfileTests.java new file mode 100644 index 000000000000..fed465388e44 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.AllocationStrategy; +import com.azure.resourcemanager.computebulkactions.models.EvictionPolicy; +import com.azure.resourcemanager.computebulkactions.models.PriorityProfile; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineType; +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\":\"Spot\",\"maxPricePerVM\":17.8025238081559,\"evictionPolicy\":\"Deallocate\",\"allocationStrategy\":\"Prioritized\"}") + .toObject(PriorityProfile.class); + Assertions.assertEquals(VirtualMachineType.SPOT, model.type()); + Assertions.assertEquals(17.8025238081559D, model.maxPricePerVM()); + Assertions.assertEquals(EvictionPolicy.DEALLOCATE, model.evictionPolicy()); + Assertions.assertEquals(AllocationStrategy.PRIORITIZED, model.allocationStrategy()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PriorityProfile model = new PriorityProfile().withType(VirtualMachineType.SPOT) + .withMaxPricePerVM(17.8025238081559D) + .withEvictionPolicy(EvictionPolicy.DEALLOCATE) + .withAllocationStrategy(AllocationStrategy.PRIORITIZED); + model = BinaryData.fromObject(model).toObject(PriorityProfile.class); + Assertions.assertEquals(VirtualMachineType.SPOT, model.type()); + Assertions.assertEquals(17.8025238081559D, model.maxPricePerVM()); + Assertions.assertEquals(EvictionPolicy.DEALLOCATE, model.evictionPolicy()); + Assertions.assertEquals(AllocationStrategy.PRIORITIZED, model.allocationStrategy()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/PublicIPAddressSkuTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/PublicIPAddressSkuTests.java new file mode 100644 index 000000000000..ab1ce8b98d60 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSku; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSkuName; +import com.azure.resourcemanager.computebulkactions.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\":\"Global\"}").toObject(PublicIPAddressSku.class); + Assertions.assertEquals(PublicIPAddressSkuName.STANDARD, model.name()); + Assertions.assertEquals(PublicIPAddressSkuTier.GLOBAL, model.tier()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PublicIPAddressSku model = new PublicIPAddressSku().withName(PublicIPAddressSkuName.STANDARD) + .withTier(PublicIPAddressSkuTier.GLOBAL); + model = BinaryData.fromObject(model).toObject(PublicIPAddressSku.class); + Assertions.assertEquals(PublicIPAddressSkuName.STANDARD, model.name()); + Assertions.assertEquals(PublicIPAddressSkuTier.GLOBAL, model.tier()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ResourceProvisionPayloadTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ResourceProvisionPayloadTests.java new file mode 100644 index 000000000000..72fc794d1e7a --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ResourceProvisionPayloadTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":{\"kif\":\"\\\"dataxwabmqoe\\\"\"},\"resourceOverrides\":[{\"ujmqlgkfbtndoa\":\"\\\"datau\\\"\",\"bjcntujitc\":\"\\\"datan\\\"\",\"twwaezkojvdcpzf\":\"\\\"dataed\\\"\",\"foxciq\":\"\\\"dataqouicybxarzgsz\\\"\"},{\"xkhnzbonlwnto\":\"\\\"dataidoamciodhkha\\\"\"}],\"resourceCount\":364905356,\"resourcePrefix\":\"kdwbwhkszz\"}") + .toObject(ResourceProvisionPayload.class); + Assertions.assertEquals(364905356, model.resourceCount()); + Assertions.assertEquals("kdwbwhkszz", model.resourcePrefix()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceProvisionPayload model = new ResourceProvisionPayload() + .withBaseProfile(mapOf("kif", BinaryData.fromBytes("\"dataxwabmqoe\"".getBytes(StandardCharsets.UTF_8)))) + .withResourceOverrides(Arrays.asList( + mapOf("ujmqlgkfbtndoa", BinaryData.fromBytes("\"datau\"".getBytes(StandardCharsets.UTF_8)), + "bjcntujitc", BinaryData.fromBytes("\"datan\"".getBytes(StandardCharsets.UTF_8)), "twwaezkojvdcpzf", + BinaryData.fromBytes("\"dataed\"".getBytes(StandardCharsets.UTF_8)), "foxciq", + BinaryData.fromBytes("\"dataqouicybxarzgsz\"".getBytes(StandardCharsets.UTF_8))), + mapOf("xkhnzbonlwnto", BinaryData.fromBytes("\"dataidoamciodhkha\"".getBytes(StandardCharsets.UTF_8))))) + .withResourceCount(364905356) + .withResourcePrefix("kdwbwhkszz"); + model = BinaryData.fromObject(model).toObject(ResourceProvisionPayload.class); + Assertions.assertEquals(364905356, model.resourceCount()); + Assertions.assertEquals("kdwbwhkszz", 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/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ResourcesTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ResourcesTests.java new file mode 100644 index 000000000000..1fa31decb5a6 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ResourcesTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.Resources; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ResourcesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Resources model = BinaryData.fromString("{\"ids\":[\"ymareqnajxqugj\",\"ky\"]}").toObject(Resources.class); + Assertions.assertEquals("ymareqnajxqugj", model.ids().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Resources model = new Resources().withIds(Arrays.asList("ymareqnajxqugj", "ky")); + model = BinaryData.fromObject(model).toObject(Resources.class); + Assertions.assertEquals("ymareqnajxqugj", model.ids().get(0)); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/RetryPolicyTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/RetryPolicyTests.java new file mode 100644 index 000000000000..2634b41f9a87 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/RetryPolicyTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.RetryPolicy; +import org.junit.jupiter.api.Assertions; + +public final class RetryPolicyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RetryPolicy model = BinaryData.fromString("{\"retryCount\":1063509843,\"retryWindowInMinutes\":2075677013}") + .toObject(RetryPolicy.class); + Assertions.assertEquals(1063509843, model.retryCount()); + Assertions.assertEquals(2075677013, model.retryWindowInMinutes()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RetryPolicy model = new RetryPolicy().withRetryCount(1063509843).withRetryWindowInMinutes(2075677013); + model = BinaryData.fromObject(model).toObject(RetryPolicy.class); + Assertions.assertEquals(1063509843, model.retryCount()); + Assertions.assertEquals(2075677013, model.retryWindowInMinutes()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ScheduledEventsAdditionalPublishingTargetsTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ScheduledEventsAdditionalPublishingTargetsTests.java new file mode 100644 index 000000000000..998be7906571 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ScheduledEventsAdditionalPublishingTargetsTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.EventGridAndResourceGraph; +import com.azure.resourcemanager.computebulkactions.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\":\"oodqxhcrm\"}}") + .toObject(ScheduledEventsAdditionalPublishingTargets.class); + Assertions.assertTrue(model.eventGridAndResourceGraph().enable()); + Assertions.assertEquals("oodqxhcrm", model.eventGridAndResourceGraph().scheduledEventsApiVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ScheduledEventsAdditionalPublishingTargets model + = new ScheduledEventsAdditionalPublishingTargets().withEventGridAndResourceGraph( + new EventGridAndResourceGraph().withEnable(true).withScheduledEventsApiVersion("oodqxhcrm")); + model = BinaryData.fromObject(model).toObject(ScheduledEventsAdditionalPublishingTargets.class); + Assertions.assertTrue(model.eventGridAndResourceGraph().enable()); + Assertions.assertEquals("oodqxhcrm", model.eventGridAndResourceGraph().scheduledEventsApiVersion()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ScheduledEventsPolicyTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ScheduledEventsPolicyTests.java new file mode 100644 index 000000000000..6909a7023c71 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.AllInstancesDown; +import com.azure.resourcemanager.computebulkactions.models.EventGridAndResourceGraph; +import com.azure.resourcemanager.computebulkactions.models.ScheduledEventsAdditionalPublishingTargets; +import com.azure.resourcemanager.computebulkactions.models.ScheduledEventsPolicy; +import com.azure.resourcemanager.computebulkactions.models.UserInitiatedReboot; +import com.azure.resourcemanager.computebulkactions.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\":false},\"scheduledEventsAdditionalPublishingTargets\":{\"eventGridAndResourceGraph\":{\"enable\":false,\"scheduledEventsApiVersion\":\"z\"}},\"allInstancesDown\":{\"automaticallyApprove\":false}}") + .toObject(ScheduledEventsPolicy.class); + Assertions.assertTrue(model.userInitiatedRedeploy().automaticallyApprove()); + Assertions.assertFalse(model.userInitiatedReboot().automaticallyApprove()); + Assertions.assertFalse(model.scheduledEventsAdditionalPublishingTargets().eventGridAndResourceGraph().enable()); + Assertions.assertEquals("z", + model.scheduledEventsAdditionalPublishingTargets().eventGridAndResourceGraph().scheduledEventsApiVersion()); + Assertions.assertFalse(model.allInstancesDown().automaticallyApprove()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ScheduledEventsPolicy model = new ScheduledEventsPolicy() + .withUserInitiatedRedeploy(new UserInitiatedRedeploy().withAutomaticallyApprove(true)) + .withUserInitiatedReboot(new UserInitiatedReboot().withAutomaticallyApprove(false)) + .withScheduledEventsAdditionalPublishingTargets( + new ScheduledEventsAdditionalPublishingTargets().withEventGridAndResourceGraph( + new EventGridAndResourceGraph().withEnable(false).withScheduledEventsApiVersion("z"))) + .withAllInstancesDown(new AllInstancesDown().withAutomaticallyApprove(false)); + model = BinaryData.fromObject(model).toObject(ScheduledEventsPolicy.class); + Assertions.assertTrue(model.userInitiatedRedeploy().automaticallyApprove()); + Assertions.assertFalse(model.userInitiatedReboot().automaticallyApprove()); + Assertions.assertFalse(model.scheduledEventsAdditionalPublishingTargets().eventGridAndResourceGraph().enable()); + Assertions.assertEquals("z", + model.scheduledEventsAdditionalPublishingTargets().eventGridAndResourceGraph().scheduledEventsApiVersion()); + Assertions.assertFalse(model.allInstancesDown().automaticallyApprove()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ScheduledEventsProfileTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ScheduledEventsProfileTests.java new file mode 100644 index 000000000000..98108918ef07 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.OSImageNotificationProfile; +import com.azure.resourcemanager.computebulkactions.models.ScheduledEventsProfile; +import com.azure.resourcemanager.computebulkactions.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\":\"xilzznf\",\"enable\":true},\"osImageNotificationProfile\":{\"notBeforeTimeout\":\"pmqtaru\",\"enable\":true}}") + .toObject(ScheduledEventsProfile.class); + Assertions.assertEquals("xilzznf", model.terminateNotificationProfile().notBeforeTimeout()); + Assertions.assertTrue(model.terminateNotificationProfile().enable()); + Assertions.assertEquals("pmqtaru", 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("xilzznf").withEnable(true)) + .withOsImageNotificationProfile( + new OSImageNotificationProfile().withNotBeforeTimeout("pmqtaru").withEnable(true)); + model = BinaryData.fromObject(model).toObject(ScheduledEventsProfile.class); + Assertions.assertEquals("xilzznf", model.terminateNotificationProfile().notBeforeTimeout()); + Assertions.assertTrue(model.terminateNotificationProfile().enable()); + Assertions.assertEquals("pmqtaru", model.osImageNotificationProfile().notBeforeTimeout()); + Assertions.assertTrue(model.osImageNotificationProfile().enable()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/TerminateNotificationProfileTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/TerminateNotificationProfileTests.java new file mode 100644 index 000000000000..93870d135973 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":\"kcjhwqytjrybnwj\",\"enable\":true}") + .toObject(TerminateNotificationProfile.class); + Assertions.assertEquals("kcjhwqytjrybnwj", model.notBeforeTimeout()); + Assertions.assertTrue(model.enable()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TerminateNotificationProfile model + = new TerminateNotificationProfile().withNotBeforeTimeout("kcjhwqytjrybnwj").withEnable(true); + model = BinaryData.fromObject(model).toObject(TerminateNotificationProfile.class); + Assertions.assertEquals("kcjhwqytjrybnwj", model.notBeforeTimeout()); + Assertions.assertTrue(model.enable()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/UefiSettingsTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/UefiSettingsTests.java new file mode 100644 index 000000000000..e8117f8eb225 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":false,\"vTpmEnabled\":false}").toObject(UefiSettings.class); + Assertions.assertFalse(model.secureBootEnabled()); + Assertions.assertFalse(model.vTpmEnabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UefiSettings model = new UefiSettings().withSecureBootEnabled(false).withVTpmEnabled(false); + model = BinaryData.fromObject(model).toObject(UefiSettings.class); + Assertions.assertFalse(model.secureBootEnabled()); + Assertions.assertFalse(model.vTpmEnabled()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/UserAssignedIdentityTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/UserAssignedIdentityTests.java new file mode 100644 index 000000000000..046a9948de3f --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.UserAssignedIdentity; + +public final class UserAssignedIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserAssignedIdentity model = BinaryData.fromString("{\"principalId\":\"khjwn\",\"clientId\":\"qsluicp\"}") + .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/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/UserInitiatedRebootTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/UserInitiatedRebootTests.java new file mode 100644 index 000000000000..d9aa84c318a3 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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.automaticallyApprove()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserInitiatedReboot model = new UserInitiatedReboot().withAutomaticallyApprove(true); + model = BinaryData.fromObject(model).toObject(UserInitiatedReboot.class); + Assertions.assertTrue(model.automaticallyApprove()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/UserInitiatedRedeployTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/UserInitiatedRedeployTests.java new file mode 100644 index 000000000000..e615a902ca25 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":false}").toObject(UserInitiatedRedeploy.class); + Assertions.assertFalse(model.automaticallyApprove()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserInitiatedRedeploy model = new UserInitiatedRedeploy().withAutomaticallyApprove(false); + model = BinaryData.fromObject(model).toObject(UserInitiatedRedeploy.class); + Assertions.assertFalse(model.automaticallyApprove()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VMAttributeMinMaxDoubleTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VMAttributeMinMaxDoubleTests.java new file mode 100644 index 000000000000..eaa90368be16 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":4.920319357958491,\"max\":8.547914273795865}") + .toObject(VMAttributeMinMaxDouble.class); + Assertions.assertEquals(4.920319357958491D, model.min()); + Assertions.assertEquals(8.547914273795865D, model.max()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VMAttributeMinMaxDouble model + = new VMAttributeMinMaxDouble().withMin(4.920319357958491D).withMax(8.547914273795865D); + model = BinaryData.fromObject(model).toObject(VMAttributeMinMaxDouble.class); + Assertions.assertEquals(4.920319357958491D, model.min()); + Assertions.assertEquals(8.547914273795865D, model.max()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VMAttributeMinMaxIntegerTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VMAttributeMinMaxIntegerTests.java new file mode 100644 index 000000000000..df4601b4d0f7 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":1777353299,\"max\":72940743}").toObject(VMAttributeMinMaxInteger.class); + Assertions.assertEquals(1777353299, model.min()); + Assertions.assertEquals(72940743, model.max()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VMAttributeMinMaxInteger model = new VMAttributeMinMaxInteger().withMin(1777353299).withMax(72940743); + model = BinaryData.fromObject(model).toObject(VMAttributeMinMaxInteger.class); + Assertions.assertEquals(1777353299, model.min()); + Assertions.assertEquals(72940743, model.max()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VMAttributesTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VMAttributesTests.java new file mode 100644 index 000000000000..879c1d49b7eb --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VMAttributesTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.AcceleratorManufacturer; +import com.azure.resourcemanager.computebulkactions.models.AcceleratorType; +import com.azure.resourcemanager.computebulkactions.models.ArchitectureType; +import com.azure.resourcemanager.computebulkactions.models.CpuManufacturer; +import com.azure.resourcemanager.computebulkactions.models.HyperVGeneration; +import com.azure.resourcemanager.computebulkactions.models.LocalStorageDiskType; +import com.azure.resourcemanager.computebulkactions.models.VMAttributeMinMaxDouble; +import com.azure.resourcemanager.computebulkactions.models.VMAttributeMinMaxInteger; +import com.azure.resourcemanager.computebulkactions.models.VMAttributeSupport; +import com.azure.resourcemanager.computebulkactions.models.VMAttributes; +import com.azure.resourcemanager.computebulkactions.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\":1475325470,\"max\":1048772360},\"memoryInGiB\":{\"min\":55.79204652280551,\"max\":92.80520786392837},\"architectureTypes\":[\"ARM64\"],\"memoryInGiBPerVCpu\":{\"min\":49.97953918700359,\"max\":49.27169259848523},\"localStorageSupport\":\"Included\",\"localStorageInGiB\":{\"min\":30.246734473014257,\"max\":5.834464974596598},\"localStorageDiskTypes\":[\"SSD\",\"HDD\"],\"dataDiskCount\":{\"min\":1308251370,\"max\":1800206320},\"networkInterfaceCount\":{\"min\":863181749,\"max\":1288567604},\"networkBandwidthInMbps\":{\"min\":66.59647381820668,\"max\":22.220514848143623},\"rdmaSupport\":\"Excluded\",\"rdmaNetworkInterfaceCount\":{\"min\":161045800,\"max\":1771773023},\"acceleratorSupport\":\"Excluded\",\"acceleratorManufacturers\":[\"Nvidia\",\"Nvidia\"],\"acceleratorTypes\":[\"GPU\"],\"acceleratorCount\":{\"min\":814455302,\"max\":1004345628},\"vmCategories\":[\"ComputeOptimized\"],\"cpuManufacturers\":[\"AMD\",\"Microsoft\"],\"hyperVGenerations\":[\"Gen1\",\"Gen1\"],\"burstableSupport\":\"Included\",\"allowedVMSizes\":[\"wtmutduq\",\"ta\",\"spwgcuertumkdosv\",\"whbmd\"],\"excludedVMSizes\":[\"jfddgmbmbe\"]}") + .toObject(VMAttributes.class); + Assertions.assertEquals(1475325470, model.vCpuCount().min()); + Assertions.assertEquals(1048772360, model.vCpuCount().max()); + Assertions.assertEquals(55.79204652280551D, model.memoryInGiB().min()); + Assertions.assertEquals(92.80520786392837D, model.memoryInGiB().max()); + Assertions.assertEquals(ArchitectureType.ARM64, model.architectureTypes().get(0)); + Assertions.assertEquals(49.97953918700359D, model.memoryInGiBPerVCpu().min()); + Assertions.assertEquals(49.27169259848523D, model.memoryInGiBPerVCpu().max()); + Assertions.assertEquals(VMAttributeSupport.INCLUDED, model.localStorageSupport()); + Assertions.assertEquals(30.246734473014257D, model.localStorageInGiB().min()); + Assertions.assertEquals(5.834464974596598D, model.localStorageInGiB().max()); + Assertions.assertEquals(LocalStorageDiskType.SSD, model.localStorageDiskTypes().get(0)); + Assertions.assertEquals(1308251370, model.dataDiskCount().min()); + Assertions.assertEquals(1800206320, model.dataDiskCount().max()); + Assertions.assertEquals(863181749, model.networkInterfaceCount().min()); + Assertions.assertEquals(1288567604, model.networkInterfaceCount().max()); + Assertions.assertEquals(66.59647381820668D, model.networkBandwidthInMbps().min()); + Assertions.assertEquals(22.220514848143623D, model.networkBandwidthInMbps().max()); + Assertions.assertEquals(VMAttributeSupport.EXCLUDED, model.rdmaSupport()); + Assertions.assertEquals(161045800, model.rdmaNetworkInterfaceCount().min()); + Assertions.assertEquals(1771773023, model.rdmaNetworkInterfaceCount().max()); + Assertions.assertEquals(VMAttributeSupport.EXCLUDED, model.acceleratorSupport()); + Assertions.assertEquals(AcceleratorManufacturer.NVIDIA, model.acceleratorManufacturers().get(0)); + Assertions.assertEquals(AcceleratorType.GPU, model.acceleratorTypes().get(0)); + Assertions.assertEquals(814455302, model.acceleratorCount().min()); + Assertions.assertEquals(1004345628, model.acceleratorCount().max()); + Assertions.assertEquals(VMCategory.COMPUTE_OPTIMIZED, model.vmCategories().get(0)); + Assertions.assertEquals(CpuManufacturer.AMD, model.cpuManufacturers().get(0)); + Assertions.assertEquals(HyperVGeneration.GEN1, model.hyperVGenerations().get(0)); + Assertions.assertEquals(VMAttributeSupport.INCLUDED, model.burstableSupport()); + Assertions.assertEquals("wtmutduq", model.allowedVMSizes().get(0)); + Assertions.assertEquals("jfddgmbmbe", model.excludedVMSizes().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VMAttributes model = new VMAttributes() + .withVCpuCount(new VMAttributeMinMaxInteger().withMin(1475325470).withMax(1048772360)) + .withMemoryInGiB(new VMAttributeMinMaxDouble().withMin(55.79204652280551D).withMax(92.80520786392837D)) + .withArchitectureTypes(Arrays.asList(ArchitectureType.ARM64)) + .withMemoryInGiBPerVCpu( + new VMAttributeMinMaxDouble().withMin(49.97953918700359D).withMax(49.27169259848523D)) + .withLocalStorageSupport(VMAttributeSupport.INCLUDED) + .withLocalStorageInGiB( + new VMAttributeMinMaxDouble().withMin(30.246734473014257D).withMax(5.834464974596598D)) + .withLocalStorageDiskTypes(Arrays.asList(LocalStorageDiskType.SSD, LocalStorageDiskType.HDD)) + .withDataDiskCount(new VMAttributeMinMaxInteger().withMin(1308251370).withMax(1800206320)) + .withNetworkInterfaceCount(new VMAttributeMinMaxInteger().withMin(863181749).withMax(1288567604)) + .withNetworkBandwidthInMbps( + new VMAttributeMinMaxDouble().withMin(66.59647381820668D).withMax(22.220514848143623D)) + .withRdmaSupport(VMAttributeSupport.EXCLUDED) + .withRdmaNetworkInterfaceCount(new VMAttributeMinMaxInteger().withMin(161045800).withMax(1771773023)) + .withAcceleratorSupport(VMAttributeSupport.EXCLUDED) + .withAcceleratorManufacturers(Arrays.asList(AcceleratorManufacturer.NVIDIA, AcceleratorManufacturer.NVIDIA)) + .withAcceleratorTypes(Arrays.asList(AcceleratorType.GPU)) + .withAcceleratorCount(new VMAttributeMinMaxInteger().withMin(814455302).withMax(1004345628)) + .withVmCategories(Arrays.asList(VMCategory.COMPUTE_OPTIMIZED)) + .withCpuManufacturers(Arrays.asList(CpuManufacturer.AMD, CpuManufacturer.MICROSOFT)) + .withHyperVGenerations(Arrays.asList(HyperVGeneration.GEN1, HyperVGeneration.GEN1)) + .withBurstableSupport(VMAttributeSupport.INCLUDED) + .withAllowedVMSizes(Arrays.asList("wtmutduq", "ta", "spwgcuertumkdosv", "whbmd")) + .withExcludedVMSizes(Arrays.asList("jfddgmbmbe")); + model = BinaryData.fromObject(model).toObject(VMAttributes.class); + Assertions.assertEquals(1475325470, model.vCpuCount().min()); + Assertions.assertEquals(1048772360, model.vCpuCount().max()); + Assertions.assertEquals(55.79204652280551D, model.memoryInGiB().min()); + Assertions.assertEquals(92.80520786392837D, model.memoryInGiB().max()); + Assertions.assertEquals(ArchitectureType.ARM64, model.architectureTypes().get(0)); + Assertions.assertEquals(49.97953918700359D, model.memoryInGiBPerVCpu().min()); + Assertions.assertEquals(49.27169259848523D, model.memoryInGiBPerVCpu().max()); + Assertions.assertEquals(VMAttributeSupport.INCLUDED, model.localStorageSupport()); + Assertions.assertEquals(30.246734473014257D, model.localStorageInGiB().min()); + Assertions.assertEquals(5.834464974596598D, model.localStorageInGiB().max()); + Assertions.assertEquals(LocalStorageDiskType.SSD, model.localStorageDiskTypes().get(0)); + Assertions.assertEquals(1308251370, model.dataDiskCount().min()); + Assertions.assertEquals(1800206320, model.dataDiskCount().max()); + Assertions.assertEquals(863181749, model.networkInterfaceCount().min()); + Assertions.assertEquals(1288567604, model.networkInterfaceCount().max()); + Assertions.assertEquals(66.59647381820668D, model.networkBandwidthInMbps().min()); + Assertions.assertEquals(22.220514848143623D, model.networkBandwidthInMbps().max()); + Assertions.assertEquals(VMAttributeSupport.EXCLUDED, model.rdmaSupport()); + Assertions.assertEquals(161045800, model.rdmaNetworkInterfaceCount().min()); + Assertions.assertEquals(1771773023, model.rdmaNetworkInterfaceCount().max()); + Assertions.assertEquals(VMAttributeSupport.EXCLUDED, model.acceleratorSupport()); + Assertions.assertEquals(AcceleratorManufacturer.NVIDIA, model.acceleratorManufacturers().get(0)); + Assertions.assertEquals(AcceleratorType.GPU, model.acceleratorTypes().get(0)); + Assertions.assertEquals(814455302, model.acceleratorCount().min()); + Assertions.assertEquals(1004345628, model.acceleratorCount().max()); + Assertions.assertEquals(VMCategory.COMPUTE_OPTIMIZED, model.vmCategories().get(0)); + Assertions.assertEquals(CpuManufacturer.AMD, model.cpuManufacturers().get(0)); + Assertions.assertEquals(HyperVGeneration.GEN1, model.hyperVGenerations().get(0)); + Assertions.assertEquals(VMAttributeSupport.INCLUDED, model.burstableSupport()); + Assertions.assertEquals("wtmutduq", model.allowedVMSizes().get(0)); + Assertions.assertEquals("jfddgmbmbe", model.excludedVMSizes().get(0)); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VMDiskSecurityProfileTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VMDiskSecurityProfileTests.java new file mode 100644 index 000000000000..83c847164a2c --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.DiskEncryptionSetParameters; +import com.azure.resourcemanager.computebulkactions.models.SecurityEncryptionTypes; +import com.azure.resourcemanager.computebulkactions.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\":\"xmqci\"}}") + .toObject(VMDiskSecurityProfile.class); + Assertions.assertEquals(SecurityEncryptionTypes.VMGUEST_STATE_ONLY, model.securityEncryptionType()); + Assertions.assertEquals("xmqci", model.diskEncryptionSet().id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VMDiskSecurityProfile model + = new VMDiskSecurityProfile().withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet(new DiskEncryptionSetParameters().withId("xmqci")); + model = BinaryData.fromObject(model).toObject(VMDiskSecurityProfile.class); + Assertions.assertEquals(SecurityEncryptionTypes.VMGUEST_STATE_ONLY, model.securityEncryptionType()); + Assertions.assertEquals("xmqci", model.diskEncryptionSet().id()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VMGalleryApplicationTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VMGalleryApplicationTests.java new file mode 100644 index 000000000000..5f4dcefdfb39 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":\"swiydmcwyhzdx\",\"order\":1314424917,\"packageReferenceId\":\"dbzm\",\"configurationReference\":\"dfznudaodv\",\"treatFailureAsDeploymentFailure\":true,\"enableAutomaticUpgrade\":true}") + .toObject(VMGalleryApplication.class); + Assertions.assertEquals("swiydmcwyhzdx", model.tags()); + Assertions.assertEquals(1314424917, model.order()); + Assertions.assertEquals("dbzm", model.packageReferenceId()); + Assertions.assertEquals("dfznudaodv", model.configurationReference()); + Assertions.assertTrue(model.treatFailureAsDeploymentFailure()); + Assertions.assertTrue(model.enableAutomaticUpgrade()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VMGalleryApplication model = new VMGalleryApplication().withTags("swiydmcwyhzdx") + .withOrder(1314424917) + .withPackageReferenceId("dbzm") + .withConfigurationReference("dfznudaodv") + .withTreatFailureAsDeploymentFailure(true) + .withEnableAutomaticUpgrade(true); + model = BinaryData.fromObject(model).toObject(VMGalleryApplication.class); + Assertions.assertEquals("swiydmcwyhzdx", model.tags()); + Assertions.assertEquals(1314424917, model.order()); + Assertions.assertEquals("dbzm", model.packageReferenceId()); + Assertions.assertEquals("dfznudaodv", model.configurationReference()); + Assertions.assertTrue(model.treatFailureAsDeploymentFailure()); + Assertions.assertTrue(model.enableAutomaticUpgrade()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VaultCertificateTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VaultCertificateTests.java new file mode 100644 index 000000000000..8069373cd7f0 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":\"evfyexfwhybcib\",\"certificateStore\":\"vdcsitynn\"}") + .toObject(VaultCertificate.class); + Assertions.assertEquals("evfyexfwhybcib", model.certificateUrl()); + Assertions.assertEquals("vdcsitynn", model.certificateStore()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VaultCertificate model + = new VaultCertificate().withCertificateUrl("evfyexfwhybcib").withCertificateStore("vdcsitynn"); + model = BinaryData.fromObject(model).toObject(VaultCertificate.class); + Assertions.assertEquals("evfyexfwhybcib", model.certificateUrl()); + Assertions.assertEquals("vdcsitynn", model.certificateStore()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VaultSecretGroupTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VaultSecretGroupTests.java new file mode 100644 index 000000000000..9fe936ae39ca --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VaultSecretGroupTests.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.computebulkactions.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.VaultCertificate; +import com.azure.resourcemanager.computebulkactions.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\":\"tadehxnltyfsopp\"},\"vaultCertificates\":[{\"certificateUrl\":\"snzwd\",\"certificateStore\":\"bavo\"},{\"certificateUrl\":\"zdmohctbqvu\",\"certificateStore\":\"xdn\"},{\"certificateUrl\":\"vo\",\"certificateStore\":\"ujjugwdkcglh\"},{\"certificateUrl\":\"azjdyggd\",\"certificateStore\":\"ixhbkuofqweykhm\"}]}") + .toObject(VaultSecretGroup.class); + Assertions.assertEquals("tadehxnltyfsopp", model.sourceVault().id()); + Assertions.assertEquals("snzwd", model.vaultCertificates().get(0).certificateUrl()); + Assertions.assertEquals("bavo", model.vaultCertificates().get(0).certificateStore()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VaultSecretGroup model = new VaultSecretGroup().withSourceVault(new SubResource().withId("tadehxnltyfsopp")) + .withVaultCertificates( + Arrays.asList(new VaultCertificate().withCertificateUrl("snzwd").withCertificateStore("bavo"), + new VaultCertificate().withCertificateUrl("zdmohctbqvu").withCertificateStore("xdn"), + new VaultCertificate().withCertificateUrl("vo").withCertificateStore("ujjugwdkcglh"), + new VaultCertificate().withCertificateUrl("azjdyggd").withCertificateStore("ixhbkuofqweykhm"))); + model = BinaryData.fromObject(model).toObject(VaultSecretGroup.class); + Assertions.assertEquals("tadehxnltyfsopp", model.sourceVault().id()); + Assertions.assertEquals("snzwd", model.vaultCertificates().get(0).certificateUrl()); + Assertions.assertEquals("bavo", model.vaultCertificates().get(0).certificateStore()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualHardDiskTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualHardDiskTests.java new file mode 100644 index 000000000000..3a2fce325659 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":\"pmouexhdz\"}").toObject(VirtualHardDisk.class); + Assertions.assertEquals("pmouexhdz", model.uri()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualHardDisk model = new VirtualHardDisk().withUri("pmouexhdz"); + model = BinaryData.fromObject(model).toObject(VirtualHardDisk.class); + Assertions.assertEquals("pmouexhdz", model.uri()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachineIpTagTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachineIpTagTests.java new file mode 100644 index 000000000000..e900af15adb1 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":\"aqtdoqmcbx\",\"tag\":\"vxysl\"}") + .toObject(VirtualMachineIpTag.class); + Assertions.assertEquals("aqtdoqmcbx", model.ipTagType()); + Assertions.assertEquals("vxysl", model.tag()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualMachineIpTag model = new VirtualMachineIpTag().withIpTagType("aqtdoqmcbx").withTag("vxysl"); + model = BinaryData.fromObject(model).toObject(VirtualMachineIpTag.class); + Assertions.assertEquals("aqtdoqmcbx", model.ipTagType()); + Assertions.assertEquals("vxysl", model.tag()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachineNetworkInterfaceConfigurationPropertiesTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachineNetworkInterfaceConfigurationPropertiesTests.java new file mode 100644 index 000000000000..bfa0c45759a0 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachineNetworkInterfaceConfigurationPropertiesTests.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.computebulkactions.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.DeleteOptions; +import com.azure.resourcemanager.computebulkactions.models.IPVersions; +import com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceAuxiliarySku; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSku; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSkuName; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSkuTier; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAllocationMethod; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineIpTag; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceConfigurationProperties; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceDnsSettingsConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceIPConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceIPConfigurationProperties; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressConfigurationProperties; +import com.azure.resourcemanager.computebulkactions.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\":false,\"disableTcpStateTracking\":false,\"enableFpga\":true,\"enableIPForwarding\":false,\"networkSecurityGroup\":{\"id\":\"vce\"},\"dnsSettings\":{\"dnsServers\":[\"lo\",\"notyfjfcnjbkcn\"]},\"ipConfigurations\":[{\"name\":\"hbttkphyw\",\"properties\":{\"subnet\":{\"id\":\"t\"},\"primary\":false,\"publicIPAddressConfiguration\":{\"name\":\"rmclfplphoxu\",\"properties\":{\"idleTimeoutInMinutes\":2041952882,\"deleteOption\":\"Delete\",\"dnsSettings\":{\"domainNameLabel\":\"ye\"},\"ipTags\":[{},{},{},{}],\"publicIPPrefix\":{},\"publicIPAddressVersion\":\"IPv6\",\"publicIPAllocationMethod\":\"Static\"},\"sku\":{\"name\":\"Standard\",\"tier\":\"Regional\"},\"tags\":{\"ids\":\"ueefjzwfqkqu\",\"ocqxtccmg\":\"yonobgl\"}},\"privateIPAddressVersion\":\"IPv4\",\"applicationSecurityGroups\":[{\"id\":\"lmoyrx\"},{\"id\":\"fudwpznt\"},{\"id\":\"dzhlrq\"},{\"id\":\"hckfrlhrx\"}],\"applicationGatewayBackendAddressPools\":[{\"id\":\"vpycanuzbp\"}],\"loadBalancerBackendAddressPools\":[{\"id\":\"kuwbcrnwb\"},{\"id\":\"hhseyv\"}]}}],\"dscpConfiguration\":{\"id\":\"rts\"},\"auxiliaryMode\":\"Floating\",\"auxiliarySku\":\"A1\"}") + .toObject(VirtualMachineNetworkInterfaceConfigurationProperties.class); + Assertions.assertTrue(model.primary()); + Assertions.assertEquals(DeleteOptions.DETACH, model.deleteOption()); + Assertions.assertFalse(model.enableAcceleratedNetworking()); + Assertions.assertFalse(model.disableTcpStateTracking()); + Assertions.assertTrue(model.enableFpga()); + Assertions.assertFalse(model.enableIPForwarding()); + Assertions.assertEquals("vce", model.networkSecurityGroup().id()); + Assertions.assertEquals("lo", model.dnsSettings().dnsServers().get(0)); + Assertions.assertEquals("hbttkphyw", model.ipConfigurations().get(0).name()); + Assertions.assertEquals("t", model.ipConfigurations().get(0).properties().subnet().id()); + Assertions.assertFalse(model.ipConfigurations().get(0).properties().primary()); + Assertions.assertEquals("rmclfplphoxu", + model.ipConfigurations().get(0).properties().publicIPAddressConfiguration().name()); + Assertions.assertEquals(2041952882, + model.ipConfigurations() + .get(0) + .properties() + .publicIPAddressConfiguration() + .properties() + .idleTimeoutInMinutes()); + Assertions.assertEquals(DeleteOptions.DELETE, + model.ipConfigurations().get(0).properties().publicIPAddressConfiguration().properties().deleteOption()); + Assertions.assertEquals("ye", + model.ipConfigurations() + .get(0) + .properties() + .publicIPAddressConfiguration() + .properties() + .dnsSettings() + .domainNameLabel()); + Assertions.assertEquals(IPVersions.IPV6, + model.ipConfigurations() + .get(0) + .properties() + .publicIPAddressConfiguration() + .properties() + .publicIPAddressVersion()); + Assertions.assertEquals(PublicIPAllocationMethod.STATIC, + model.ipConfigurations() + .get(0) + .properties() + .publicIPAddressConfiguration() + .properties() + .publicIPAllocationMethod()); + Assertions.assertEquals(PublicIPAddressSkuName.STANDARD, + model.ipConfigurations().get(0).properties().publicIPAddressConfiguration().sku().name()); + Assertions.assertEquals(PublicIPAddressSkuTier.REGIONAL, + model.ipConfigurations().get(0).properties().publicIPAddressConfiguration().sku().tier()); + Assertions.assertEquals("ueefjzwfqkqu", + model.ipConfigurations().get(0).properties().publicIPAddressConfiguration().tags().get("ids")); + Assertions.assertEquals(IPVersions.IPV4, + model.ipConfigurations().get(0).properties().privateIPAddressVersion()); + Assertions.assertEquals("lmoyrx", + model.ipConfigurations().get(0).properties().applicationSecurityGroups().get(0).id()); + Assertions.assertEquals("vpycanuzbp", + model.ipConfigurations().get(0).properties().applicationGatewayBackendAddressPools().get(0).id()); + Assertions.assertEquals("kuwbcrnwb", + model.ipConfigurations().get(0).properties().loadBalancerBackendAddressPools().get(0).id()); + Assertions.assertEquals("rts", model.dscpConfiguration().id()); + Assertions.assertEquals(NetworkInterfaceAuxiliaryMode.FLOATING, model.auxiliaryMode()); + Assertions.assertEquals(NetworkInterfaceAuxiliarySku.A1, model.auxiliarySku()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualMachineNetworkInterfaceConfigurationProperties model + = new VirtualMachineNetworkInterfaceConfigurationProperties().withPrimary(true) + .withDeleteOption(DeleteOptions.DETACH) + .withEnableAcceleratedNetworking(false) + .withDisableTcpStateTracking(false) + .withEnableFpga(true) + .withEnableIPForwarding(false) + .withNetworkSecurityGroup(new SubResource().withId("vce")) + .withDnsSettings(new VirtualMachineNetworkInterfaceDnsSettingsConfiguration() + .withDnsServers(Arrays.asList("lo", "notyfjfcnjbkcn"))) + .withIpConfigurations( + Arrays + .asList(new VirtualMachineNetworkInterfaceIPConfiguration().withName("hbttkphyw") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties() + .withSubnet(new SubResource().withId("t")) + .withPrimary(false) + .withPublicIPAddressConfiguration(new VirtualMachinePublicIPAddressConfiguration() + .withName("rmclfplphoxu") + .withProperties(new VirtualMachinePublicIPAddressConfigurationProperties() + .withIdleTimeoutInMinutes(2041952882) + .withDeleteOption(DeleteOptions.DELETE) + .withDnsSettings(new VirtualMachinePublicIPAddressDnsSettingsConfiguration() + .withDomainNameLabel("ye")) + .withIpTags(Arrays.asList(new VirtualMachineIpTag(), new VirtualMachineIpTag(), + new VirtualMachineIpTag(), new VirtualMachineIpTag())) + .withPublicIPPrefix(new SubResource()) + .withPublicIPAddressVersion(IPVersions.IPV6) + .withPublicIPAllocationMethod(PublicIPAllocationMethod.STATIC)) + .withSku(new PublicIPAddressSku().withName(PublicIPAddressSkuName.STANDARD) + .withTier(PublicIPAddressSkuTier.REGIONAL)) + .withTags(mapOf("ids", "ueefjzwfqkqu", "ocqxtccmg", "yonobgl"))) + .withPrivateIPAddressVersion(IPVersions.IPV4) + .withApplicationSecurityGroups(Arrays.asList(new SubResource().withId("lmoyrx"), + new SubResource().withId("fudwpznt"), new SubResource().withId("dzhlrq"), + new SubResource().withId("hckfrlhrx"))) + .withApplicationGatewayBackendAddressPools( + Arrays.asList(new SubResource().withId("vpycanuzbp"))) + .withLoadBalancerBackendAddressPools(Arrays.asList( + new SubResource().withId("kuwbcrnwb"), new SubResource().withId("hhseyv")))))) + .withDscpConfiguration(new SubResource().withId("rts")) + .withAuxiliaryMode(NetworkInterfaceAuxiliaryMode.FLOATING) + .withAuxiliarySku(NetworkInterfaceAuxiliarySku.A1); + model = BinaryData.fromObject(model).toObject(VirtualMachineNetworkInterfaceConfigurationProperties.class); + Assertions.assertTrue(model.primary()); + Assertions.assertEquals(DeleteOptions.DETACH, model.deleteOption()); + Assertions.assertFalse(model.enableAcceleratedNetworking()); + Assertions.assertFalse(model.disableTcpStateTracking()); + Assertions.assertTrue(model.enableFpga()); + Assertions.assertFalse(model.enableIPForwarding()); + Assertions.assertEquals("vce", model.networkSecurityGroup().id()); + Assertions.assertEquals("lo", model.dnsSettings().dnsServers().get(0)); + Assertions.assertEquals("hbttkphyw", model.ipConfigurations().get(0).name()); + Assertions.assertEquals("t", model.ipConfigurations().get(0).properties().subnet().id()); + Assertions.assertFalse(model.ipConfigurations().get(0).properties().primary()); + Assertions.assertEquals("rmclfplphoxu", + model.ipConfigurations().get(0).properties().publicIPAddressConfiguration().name()); + Assertions.assertEquals(2041952882, + model.ipConfigurations() + .get(0) + .properties() + .publicIPAddressConfiguration() + .properties() + .idleTimeoutInMinutes()); + Assertions.assertEquals(DeleteOptions.DELETE, + model.ipConfigurations().get(0).properties().publicIPAddressConfiguration().properties().deleteOption()); + Assertions.assertEquals("ye", + model.ipConfigurations() + .get(0) + .properties() + .publicIPAddressConfiguration() + .properties() + .dnsSettings() + .domainNameLabel()); + Assertions.assertEquals(IPVersions.IPV6, + model.ipConfigurations() + .get(0) + .properties() + .publicIPAddressConfiguration() + .properties() + .publicIPAddressVersion()); + Assertions.assertEquals(PublicIPAllocationMethod.STATIC, + model.ipConfigurations() + .get(0) + .properties() + .publicIPAddressConfiguration() + .properties() + .publicIPAllocationMethod()); + Assertions.assertEquals(PublicIPAddressSkuName.STANDARD, + model.ipConfigurations().get(0).properties().publicIPAddressConfiguration().sku().name()); + Assertions.assertEquals(PublicIPAddressSkuTier.REGIONAL, + model.ipConfigurations().get(0).properties().publicIPAddressConfiguration().sku().tier()); + Assertions.assertEquals("ueefjzwfqkqu", + model.ipConfigurations().get(0).properties().publicIPAddressConfiguration().tags().get("ids")); + Assertions.assertEquals(IPVersions.IPV4, + model.ipConfigurations().get(0).properties().privateIPAddressVersion()); + Assertions.assertEquals("lmoyrx", + model.ipConfigurations().get(0).properties().applicationSecurityGroups().get(0).id()); + Assertions.assertEquals("vpycanuzbp", + model.ipConfigurations().get(0).properties().applicationGatewayBackendAddressPools().get(0).id()); + Assertions.assertEquals("kuwbcrnwb", + model.ipConfigurations().get(0).properties().loadBalancerBackendAddressPools().get(0).id()); + Assertions.assertEquals("rts", model.dscpConfiguration().id()); + Assertions.assertEquals(NetworkInterfaceAuxiliaryMode.FLOATING, model.auxiliaryMode()); + Assertions.assertEquals(NetworkInterfaceAuxiliarySku.A1, 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/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachineNetworkInterfaceConfigurationTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachineNetworkInterfaceConfigurationTests.java new file mode 100644 index 000000000000..bd0a0ca09653 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachineNetworkInterfaceConfigurationTests.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.DeleteOptions; +import com.azure.resourcemanager.computebulkactions.models.IPVersions; +import com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.computebulkactions.models.NetworkInterfaceAuxiliarySku; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSku; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceConfigurationProperties; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceDnsSettingsConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceIPConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceIPConfigurationProperties; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressConfiguration; +import com.azure.resourcemanager.computebulkactions.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\":\"bebrjcxerfuwuttt\",\"properties\":{\"primary\":true,\"deleteOption\":\"Detach\",\"enableAcceleratedNetworking\":false,\"disableTcpStateTracking\":true,\"enableFpga\":true,\"enableIPForwarding\":false,\"networkSecurityGroup\":{\"id\":\"ahfn\"},\"dnsSettings\":{\"dnsServers\":[\"qxj\"]},\"ipConfigurations\":[{\"name\":\"ujqgidok\",\"properties\":{\"subnet\":{\"id\":\"yoxgvcltbgsnc\"},\"primary\":false,\"publicIPAddressConfiguration\":{\"name\":\"esz\",\"properties\":{},\"sku\":{},\"tags\":{\"vecxgodebfqkk\":\"htxfvgxbfsmxnehm\",\"fbxzpuzycisp\":\"bmpukgriwflz\",\"y\":\"qzahmgkbrp\",\"rgvtqag\":\"hibnuqqkpika\"}},\"privateIPAddressVersion\":\"IPv4\",\"applicationSecurityGroups\":[{},{},{}],\"applicationGatewayBackendAddressPools\":[{},{},{}],\"loadBalancerBackendAddressPools\":[{}]}},{\"name\":\"gmebfsiarbutrcv\",\"properties\":{\"subnet\":{\"id\":\"zmhjrunmp\"},\"primary\":true,\"publicIPAddressConfiguration\":{\"name\":\"bh\",\"properties\":{},\"sku\":{},\"tags\":{\"xywnytnrsynlqidy\":\"nkxmyskpbhenbtk\",\"axdbabph\":\"yxczfclh\",\"mnyyazt\":\"wrqlfktsthsuco\",\"wrqpue\":\"bt\"}},\"privateIPAddressVersion\":\"IPv4\",\"applicationSecurityGroups\":[{},{},{},{}],\"applicationGatewayBackendAddressPools\":[{},{},{}],\"loadBalancerBackendAddressPools\":[{},{}]}},{\"name\":\"xzfeyueaxibxuj\",\"properties\":{\"subnet\":{\"id\":\"walm\"},\"primary\":false,\"publicIPAddressConfiguration\":{\"name\":\"xaepdkzjancuxr\",\"properties\":{},\"sku\":{},\"tags\":{\"bniwdj\":\"v\",\"s\":\"wz\",\"xytxhpzxbz\":\"bpg\",\"lcuhxwtctyqiklb\":\"fzab\"}},\"privateIPAddressVersion\":\"IPv4\",\"applicationSecurityGroups\":[{},{},{}],\"applicationGatewayBackendAddressPools\":[{},{},{}],\"loadBalancerBackendAddressPools\":[{},{},{}]}},{\"name\":\"vgyuguos\",\"properties\":{\"subnet\":{\"id\":\"ss\"},\"primary\":true,\"publicIPAddressConfiguration\":{\"name\":\"kfplgmgsxnk\",\"properties\":{},\"sku\":{},\"tags\":{\"i\":\"slpvlop\"}},\"privateIPAddressVersion\":\"IPv4\",\"applicationSecurityGroups\":[{}],\"applicationGatewayBackendAddressPools\":[{},{},{},{}],\"loadBalancerBackendAddressPools\":[{},{}]}}],\"dscpConfiguration\":{\"id\":\"aiuebbaumnyqu\"},\"auxiliaryMode\":\"None\",\"auxiliarySku\":\"None\"},\"tags\":{\"ckhsmtxpsieb\":\"a\",\"rdqmhjjdhtldwkyz\":\"fhvpesaps\",\"cwsvlxotog\":\"uutkncw\"}}") + .toObject(VirtualMachineNetworkInterfaceConfiguration.class); + Assertions.assertEquals("bebrjcxerfuwuttt", model.name()); + Assertions.assertTrue(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("ahfn", model.properties().networkSecurityGroup().id()); + Assertions.assertEquals("qxj", model.properties().dnsSettings().dnsServers().get(0)); + Assertions.assertEquals("ujqgidok", model.properties().ipConfigurations().get(0).name()); + Assertions.assertEquals("yoxgvcltbgsnc", + model.properties().ipConfigurations().get(0).properties().subnet().id()); + Assertions.assertFalse(model.properties().ipConfigurations().get(0).properties().primary()); + Assertions.assertEquals("esz", + model.properties().ipConfigurations().get(0).properties().publicIPAddressConfiguration().name()); + Assertions.assertEquals("htxfvgxbfsmxnehm", + model.properties() + .ipConfigurations() + .get(0) + .properties() + .publicIPAddressConfiguration() + .tags() + .get("vecxgodebfqkk")); + Assertions.assertEquals(IPVersions.IPV4, + model.properties().ipConfigurations().get(0).properties().privateIPAddressVersion()); + Assertions.assertEquals("aiuebbaumnyqu", model.properties().dscpConfiguration().id()); + Assertions.assertEquals(NetworkInterfaceAuxiliaryMode.NONE, model.properties().auxiliaryMode()); + Assertions.assertEquals(NetworkInterfaceAuxiliarySku.NONE, model.properties().auxiliarySku()); + Assertions.assertEquals("a", model.tags().get("ckhsmtxpsieb")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualMachineNetworkInterfaceConfiguration model + = new VirtualMachineNetworkInterfaceConfiguration().withName("bebrjcxerfuwuttt") + .withProperties( + new VirtualMachineNetworkInterfaceConfigurationProperties().withPrimary(true) + .withDeleteOption(DeleteOptions.DETACH) + .withEnableAcceleratedNetworking(false) + .withDisableTcpStateTracking(true) + .withEnableFpga(true) + .withEnableIPForwarding(false) + .withNetworkSecurityGroup(new SubResource().withId("ahfn")) + .withDnsSettings(new VirtualMachineNetworkInterfaceDnsSettingsConfiguration() + .withDnsServers(Arrays.asList("qxj"))) + .withIpConfigurations( + Arrays.asList( + new VirtualMachineNetworkInterfaceIPConfiguration().withName("ujqgidok") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties() + .withSubnet(new SubResource().withId("yoxgvcltbgsnc")) + .withPrimary(false) + .withPublicIPAddressConfiguration( + new VirtualMachinePublicIPAddressConfiguration().withName("esz") + .withProperties( + new VirtualMachinePublicIPAddressConfigurationProperties()) + .withSku(new PublicIPAddressSku()) + .withTags(mapOf("vecxgodebfqkk", "htxfvgxbfsmxnehm", "fbxzpuzycisp", + "bmpukgriwflz", "y", "qzahmgkbrp", "rgvtqag", "hibnuqqkpika"))) + .withPrivateIPAddressVersion(IPVersions.IPV4) + .withApplicationSecurityGroups( + Arrays.asList(new SubResource(), new SubResource(), new SubResource())) + .withApplicationGatewayBackendAddressPools( + Arrays.asList(new SubResource(), new SubResource(), new SubResource())) + .withLoadBalancerBackendAddressPools(Arrays.asList(new SubResource()))), + new VirtualMachineNetworkInterfaceIPConfiguration().withName("gmebfsiarbutrcv") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties() + .withSubnet(new SubResource().withId("zmhjrunmp")) + .withPrimary(true) + .withPublicIPAddressConfiguration( + new VirtualMachinePublicIPAddressConfiguration().withName("bh") + .withProperties( + new VirtualMachinePublicIPAddressConfigurationProperties()) + .withSku(new PublicIPAddressSku()) + .withTags(mapOf("xywnytnrsynlqidy", "nkxmyskpbhenbtk", "axdbabph", + "yxczfclh", "mnyyazt", "wrqlfktsthsuco", "wrqpue", "bt"))) + .withPrivateIPAddressVersion(IPVersions.IPV4) + .withApplicationSecurityGroups(Arrays.asList(new SubResource(), + new SubResource(), new SubResource(), new SubResource())) + .withApplicationGatewayBackendAddressPools( + Arrays.asList(new SubResource(), new SubResource(), new SubResource())) + .withLoadBalancerBackendAddressPools( + Arrays.asList(new SubResource(), new SubResource()))), + new VirtualMachineNetworkInterfaceIPConfiguration().withName("xzfeyueaxibxuj") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties() + .withSubnet(new SubResource().withId("walm")) + .withPrimary(false) + .withPublicIPAddressConfiguration( + new VirtualMachinePublicIPAddressConfiguration().withName("xaepdkzjancuxr") + .withProperties( + new VirtualMachinePublicIPAddressConfigurationProperties()) + .withSku(new PublicIPAddressSku()) + .withTags(mapOf("bniwdj", "v", "s", "wz", "xytxhpzxbz", "bpg", + "lcuhxwtctyqiklb", "fzab"))) + .withPrivateIPAddressVersion(IPVersions.IPV4) + .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 VirtualMachineNetworkInterfaceIPConfiguration().withName("vgyuguos") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties() + .withSubnet(new SubResource().withId("ss")) + .withPrimary(true) + .withPublicIPAddressConfiguration( + new VirtualMachinePublicIPAddressConfiguration().withName("kfplgmgsxnk") + .withProperties( + new VirtualMachinePublicIPAddressConfigurationProperties()) + .withSku(new PublicIPAddressSku()) + .withTags(mapOf("i", "slpvlop"))) + .withPrivateIPAddressVersion(IPVersions.IPV4) + .withApplicationSecurityGroups(Arrays.asList(new SubResource())) + .withApplicationGatewayBackendAddressPools(Arrays.asList(new SubResource(), + new SubResource(), new SubResource(), new SubResource())) + .withLoadBalancerBackendAddressPools( + Arrays.asList(new SubResource(), new SubResource()))))) + .withDscpConfiguration(new SubResource().withId("aiuebbaumnyqu")) + .withAuxiliaryMode(NetworkInterfaceAuxiliaryMode.NONE) + .withAuxiliarySku(NetworkInterfaceAuxiliarySku.NONE)) + .withTags(mapOf("ckhsmtxpsieb", "a", "rdqmhjjdhtldwkyz", "fhvpesaps", "cwsvlxotog", "uutkncw")); + model = BinaryData.fromObject(model).toObject(VirtualMachineNetworkInterfaceConfiguration.class); + Assertions.assertEquals("bebrjcxerfuwuttt", model.name()); + Assertions.assertTrue(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("ahfn", model.properties().networkSecurityGroup().id()); + Assertions.assertEquals("qxj", model.properties().dnsSettings().dnsServers().get(0)); + Assertions.assertEquals("ujqgidok", model.properties().ipConfigurations().get(0).name()); + Assertions.assertEquals("yoxgvcltbgsnc", + model.properties().ipConfigurations().get(0).properties().subnet().id()); + Assertions.assertFalse(model.properties().ipConfigurations().get(0).properties().primary()); + Assertions.assertEquals("esz", + model.properties().ipConfigurations().get(0).properties().publicIPAddressConfiguration().name()); + Assertions.assertEquals("htxfvgxbfsmxnehm", + model.properties() + .ipConfigurations() + .get(0) + .properties() + .publicIPAddressConfiguration() + .tags() + .get("vecxgodebfqkk")); + Assertions.assertEquals(IPVersions.IPV4, + model.properties().ipConfigurations().get(0).properties().privateIPAddressVersion()); + Assertions.assertEquals("aiuebbaumnyqu", model.properties().dscpConfiguration().id()); + Assertions.assertEquals(NetworkInterfaceAuxiliaryMode.NONE, model.properties().auxiliaryMode()); + Assertions.assertEquals(NetworkInterfaceAuxiliarySku.NONE, model.properties().auxiliarySku()); + Assertions.assertEquals("a", model.tags().get("ckhsmtxpsieb")); + } + + // 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/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachineNetworkInterfaceDnsSettingsConfigurationTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachineNetworkInterfaceDnsSettingsConfigurationTests.java new file mode 100644 index 000000000000..e8c5cbfcaee6 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":[\"emaofmxagkvt\",\"elmqk\",\"hahvljuahaq\",\"hcdhmdual\"]}") + .toObject(VirtualMachineNetworkInterfaceDnsSettingsConfiguration.class); + Assertions.assertEquals("emaofmxagkvt", model.dnsServers().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualMachineNetworkInterfaceDnsSettingsConfiguration model + = new VirtualMachineNetworkInterfaceDnsSettingsConfiguration() + .withDnsServers(Arrays.asList("emaofmxagkvt", "elmqk", "hahvljuahaq", "hcdhmdual")); + model = BinaryData.fromObject(model).toObject(VirtualMachineNetworkInterfaceDnsSettingsConfiguration.class); + Assertions.assertEquals("emaofmxagkvt", model.dnsServers().get(0)); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachineNetworkInterfaceIPConfigurationPropertiesTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachineNetworkInterfaceIPConfigurationPropertiesTests.java new file mode 100644 index 000000000000..dd36e114e194 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachineNetworkInterfaceIPConfigurationPropertiesTests.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.computebulkactions.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.DeleteOptions; +import com.azure.resourcemanager.computebulkactions.models.DomainNameLabelScopeTypes; +import com.azure.resourcemanager.computebulkactions.models.IPVersions; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSku; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSkuName; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSkuTier; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAllocationMethod; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineIpTag; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceIPConfigurationProperties; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressConfigurationProperties; +import com.azure.resourcemanager.computebulkactions.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\":\"c\"},\"primary\":true,\"publicIPAddressConfiguration\":{\"name\":\"vlvqhjkbegi\",\"properties\":{\"idleTimeoutInMinutes\":1451066007,\"deleteOption\":\"Detach\",\"dnsSettings\":{\"domainNameLabel\":\"bwwaloa\",\"domainNameLabelScope\":\"ResourceGroupReuse\"},\"ipTags\":[{\"ipTagType\":\"tzjuzgwyzmhtxo\",\"tag\":\"mtsavjcbpwxqp\"}],\"publicIPPrefix\":{\"id\":\"nftguvriuhpr\"},\"publicIPAddressVersion\":\"IPv6\",\"publicIPAllocationMethod\":\"Static\"},\"sku\":{\"name\":\"Standard\",\"tier\":\"Global\"},\"tags\":{\"oyq\":\"ww\",\"mefqsgzvahapjyzh\":\"exrmcqibycnojvk\",\"zlmwlxkvugfhz\":\"vgqzcjrvxd\",\"hnnpr\":\"vawjvzunlu\"}},\"privateIPAddressVersion\":\"IPv4\",\"applicationSecurityGroups\":[{\"id\":\"lpjzuaejxdu\"},{\"id\":\"skzbb\"},{\"id\":\"zumveekgpwo\"},{\"id\":\"hkfpbs\"}],\"applicationGatewayBackendAddressPools\":[{\"id\":\"dxluu\"}],\"loadBalancerBackendAddressPools\":[{\"id\":\"ouwaboekqvkeln\"},{\"id\":\"vbxwyjsflhh\"},{\"id\":\"aln\"},{\"id\":\"xisxyawjoyaqcsl\"}]}") + .toObject(VirtualMachineNetworkInterfaceIPConfigurationProperties.class); + Assertions.assertEquals("c", model.subnet().id()); + Assertions.assertTrue(model.primary()); + Assertions.assertEquals("vlvqhjkbegi", model.publicIPAddressConfiguration().name()); + Assertions.assertEquals(1451066007, model.publicIPAddressConfiguration().properties().idleTimeoutInMinutes()); + Assertions.assertEquals(DeleteOptions.DETACH, model.publicIPAddressConfiguration().properties().deleteOption()); + Assertions.assertEquals("bwwaloa", + model.publicIPAddressConfiguration().properties().dnsSettings().domainNameLabel()); + Assertions.assertEquals(DomainNameLabelScopeTypes.RESOURCE_GROUP_REUSE, + model.publicIPAddressConfiguration().properties().dnsSettings().domainNameLabelScope()); + Assertions.assertEquals("tzjuzgwyzmhtxo", + model.publicIPAddressConfiguration().properties().ipTags().get(0).ipTagType()); + Assertions.assertEquals("mtsavjcbpwxqp", + model.publicIPAddressConfiguration().properties().ipTags().get(0).tag()); + Assertions.assertEquals("nftguvriuhpr", + model.publicIPAddressConfiguration().properties().publicIPPrefix().id()); + Assertions.assertEquals(IPVersions.IPV6, + model.publicIPAddressConfiguration().properties().publicIPAddressVersion()); + Assertions.assertEquals(PublicIPAllocationMethod.STATIC, + model.publicIPAddressConfiguration().properties().publicIPAllocationMethod()); + Assertions.assertEquals(PublicIPAddressSkuName.STANDARD, model.publicIPAddressConfiguration().sku().name()); + Assertions.assertEquals(PublicIPAddressSkuTier.GLOBAL, model.publicIPAddressConfiguration().sku().tier()); + Assertions.assertEquals("ww", model.publicIPAddressConfiguration().tags().get("oyq")); + Assertions.assertEquals(IPVersions.IPV4, model.privateIPAddressVersion()); + Assertions.assertEquals("lpjzuaejxdu", model.applicationSecurityGroups().get(0).id()); + Assertions.assertEquals("dxluu", model.applicationGatewayBackendAddressPools().get(0).id()); + Assertions.assertEquals("ouwaboekqvkeln", model.loadBalancerBackendAddressPools().get(0).id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualMachineNetworkInterfaceIPConfigurationProperties model + = new VirtualMachineNetworkInterfaceIPConfigurationProperties().withSubnet(new SubResource().withId("c")) + .withPrimary(true) + .withPublicIPAddressConfiguration( + new VirtualMachinePublicIPAddressConfiguration().withName("vlvqhjkbegi") + .withProperties(new VirtualMachinePublicIPAddressConfigurationProperties() + .withIdleTimeoutInMinutes(1451066007) + .withDeleteOption(DeleteOptions.DETACH) + .withDnsSettings(new VirtualMachinePublicIPAddressDnsSettingsConfiguration() + .withDomainNameLabel("bwwaloa") + .withDomainNameLabelScope(DomainNameLabelScopeTypes.RESOURCE_GROUP_REUSE)) + .withIpTags(Arrays.asList( + new VirtualMachineIpTag().withIpTagType("tzjuzgwyzmhtxo").withTag("mtsavjcbpwxqp"))) + .withPublicIPPrefix(new SubResource().withId("nftguvriuhpr")) + .withPublicIPAddressVersion(IPVersions.IPV6) + .withPublicIPAllocationMethod(PublicIPAllocationMethod.STATIC)) + .withSku(new PublicIPAddressSku().withName(PublicIPAddressSkuName.STANDARD) + .withTier(PublicIPAddressSkuTier.GLOBAL)) + .withTags(mapOf("oyq", "ww", "mefqsgzvahapjyzh", "exrmcqibycnojvk", "zlmwlxkvugfhz", + "vgqzcjrvxd", "hnnpr", "vawjvzunlu"))) + .withPrivateIPAddressVersion(IPVersions.IPV4) + .withApplicationSecurityGroups( + Arrays.asList(new SubResource().withId("lpjzuaejxdu"), new SubResource().withId("skzbb"), + new SubResource().withId("zumveekgpwo"), new SubResource().withId("hkfpbs"))) + .withApplicationGatewayBackendAddressPools(Arrays.asList(new SubResource().withId("dxluu"))) + .withLoadBalancerBackendAddressPools( + Arrays.asList(new SubResource().withId("ouwaboekqvkeln"), new SubResource().withId("vbxwyjsflhh"), + new SubResource().withId("aln"), new SubResource().withId("xisxyawjoyaqcsl"))); + model = BinaryData.fromObject(model).toObject(VirtualMachineNetworkInterfaceIPConfigurationProperties.class); + Assertions.assertEquals("c", model.subnet().id()); + Assertions.assertTrue(model.primary()); + Assertions.assertEquals("vlvqhjkbegi", model.publicIPAddressConfiguration().name()); + Assertions.assertEquals(1451066007, model.publicIPAddressConfiguration().properties().idleTimeoutInMinutes()); + Assertions.assertEquals(DeleteOptions.DETACH, model.publicIPAddressConfiguration().properties().deleteOption()); + Assertions.assertEquals("bwwaloa", + model.publicIPAddressConfiguration().properties().dnsSettings().domainNameLabel()); + Assertions.assertEquals(DomainNameLabelScopeTypes.RESOURCE_GROUP_REUSE, + model.publicIPAddressConfiguration().properties().dnsSettings().domainNameLabelScope()); + Assertions.assertEquals("tzjuzgwyzmhtxo", + model.publicIPAddressConfiguration().properties().ipTags().get(0).ipTagType()); + Assertions.assertEquals("mtsavjcbpwxqp", + model.publicIPAddressConfiguration().properties().ipTags().get(0).tag()); + Assertions.assertEquals("nftguvriuhpr", + model.publicIPAddressConfiguration().properties().publicIPPrefix().id()); + Assertions.assertEquals(IPVersions.IPV6, + model.publicIPAddressConfiguration().properties().publicIPAddressVersion()); + Assertions.assertEquals(PublicIPAllocationMethod.STATIC, + model.publicIPAddressConfiguration().properties().publicIPAllocationMethod()); + Assertions.assertEquals(PublicIPAddressSkuName.STANDARD, model.publicIPAddressConfiguration().sku().name()); + Assertions.assertEquals(PublicIPAddressSkuTier.GLOBAL, model.publicIPAddressConfiguration().sku().tier()); + Assertions.assertEquals("ww", model.publicIPAddressConfiguration().tags().get("oyq")); + Assertions.assertEquals(IPVersions.IPV4, model.privateIPAddressVersion()); + Assertions.assertEquals("lpjzuaejxdu", model.applicationSecurityGroups().get(0).id()); + Assertions.assertEquals("dxluu", model.applicationGatewayBackendAddressPools().get(0).id()); + Assertions.assertEquals("ouwaboekqvkeln", 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/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachineNetworkInterfaceIPConfigurationTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachineNetworkInterfaceIPConfigurationTests.java new file mode 100644 index 000000000000..7de6a13999a0 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachineNetworkInterfaceIPConfigurationTests.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.DeleteOptions; +import com.azure.resourcemanager.computebulkactions.models.DomainNameLabelScopeTypes; +import com.azure.resourcemanager.computebulkactions.models.IPVersions; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSku; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSkuName; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSkuTier; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAllocationMethod; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineIpTag; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceIPConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineNetworkInterfaceIPConfigurationProperties; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressConfigurationProperties; +import com.azure.resourcemanager.computebulkactions.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\":\"exq\",\"properties\":{\"subnet\":{\"id\":\"dmwsrcrgvxpvgomz\"},\"primary\":false,\"publicIPAddressConfiguration\":{\"name\":\"sgwbnbbeld\",\"properties\":{\"idleTimeoutInMinutes\":555346684,\"deleteOption\":\"Delete\",\"dnsSettings\":{\"domainNameLabel\":\"io\",\"domainNameLabelScope\":\"ResourceGroupReuse\"},\"ipTags\":[{\"ipTagType\":\"auhashsfwx\",\"tag\":\"owzxcu\"},{\"ipTagType\":\"cjooxdjebwpucwwf\",\"tag\":\"vbvmeu\"}],\"publicIPPrefix\":{\"id\":\"vyhzceuojgjrwj\"},\"publicIPAddressVersion\":\"IPv6\",\"publicIPAllocationMethod\":\"Dynamic\"},\"sku\":{\"name\":\"Basic\",\"tier\":\"Regional\"},\"tags\":{\"it\":\"x\",\"hniskxfbkpyc\":\"nrjawgqwg\"}},\"privateIPAddressVersion\":\"IPv4\",\"applicationSecurityGroups\":[{\"id\":\"nhjdauw\"},{\"id\":\"ylwz\"}],\"applicationGatewayBackendAddressPools\":[{\"id\":\"xujznbmpowu\"},{\"id\":\"rzqlveu\"},{\"id\":\"upjm\"}],\"loadBalancerBackendAddressPools\":[{\"id\":\"obbc\"},{\"id\":\"s\"},{\"id\":\"jriplrbpbewtghf\"}]}}") + .toObject(VirtualMachineNetworkInterfaceIPConfiguration.class); + Assertions.assertEquals("exq", model.name()); + Assertions.assertEquals("dmwsrcrgvxpvgomz", model.properties().subnet().id()); + Assertions.assertFalse(model.properties().primary()); + Assertions.assertEquals("sgwbnbbeld", model.properties().publicIPAddressConfiguration().name()); + Assertions.assertEquals(555346684, + model.properties().publicIPAddressConfiguration().properties().idleTimeoutInMinutes()); + Assertions.assertEquals(DeleteOptions.DELETE, + model.properties().publicIPAddressConfiguration().properties().deleteOption()); + Assertions.assertEquals("io", + model.properties().publicIPAddressConfiguration().properties().dnsSettings().domainNameLabel()); + Assertions.assertEquals(DomainNameLabelScopeTypes.RESOURCE_GROUP_REUSE, + model.properties().publicIPAddressConfiguration().properties().dnsSettings().domainNameLabelScope()); + Assertions.assertEquals("auhashsfwx", + model.properties().publicIPAddressConfiguration().properties().ipTags().get(0).ipTagType()); + Assertions.assertEquals("owzxcu", + model.properties().publicIPAddressConfiguration().properties().ipTags().get(0).tag()); + Assertions.assertEquals("vyhzceuojgjrwj", + model.properties().publicIPAddressConfiguration().properties().publicIPPrefix().id()); + Assertions.assertEquals(IPVersions.IPV6, + model.properties().publicIPAddressConfiguration().properties().publicIPAddressVersion()); + Assertions.assertEquals(PublicIPAllocationMethod.DYNAMIC, + model.properties().publicIPAddressConfiguration().properties().publicIPAllocationMethod()); + Assertions.assertEquals(PublicIPAddressSkuName.BASIC, + model.properties().publicIPAddressConfiguration().sku().name()); + Assertions.assertEquals(PublicIPAddressSkuTier.REGIONAL, + model.properties().publicIPAddressConfiguration().sku().tier()); + Assertions.assertEquals("x", model.properties().publicIPAddressConfiguration().tags().get("it")); + Assertions.assertEquals(IPVersions.IPV4, model.properties().privateIPAddressVersion()); + Assertions.assertEquals("nhjdauw", model.properties().applicationSecurityGroups().get(0).id()); + Assertions.assertEquals("xujznbmpowu", model.properties().applicationGatewayBackendAddressPools().get(0).id()); + Assertions.assertEquals("obbc", model.properties().loadBalancerBackendAddressPools().get(0).id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualMachineNetworkInterfaceIPConfiguration model + = new VirtualMachineNetworkInterfaceIPConfiguration().withName("exq") + .withProperties(new VirtualMachineNetworkInterfaceIPConfigurationProperties() + .withSubnet(new SubResource().withId("dmwsrcrgvxpvgomz")) + .withPrimary(false) + .withPublicIPAddressConfiguration(new VirtualMachinePublicIPAddressConfiguration() + .withName("sgwbnbbeld") + .withProperties(new VirtualMachinePublicIPAddressConfigurationProperties() + .withIdleTimeoutInMinutes(555346684) + .withDeleteOption(DeleteOptions.DELETE) + .withDnsSettings( + new VirtualMachinePublicIPAddressDnsSettingsConfiguration().withDomainNameLabel("io") + .withDomainNameLabelScope(DomainNameLabelScopeTypes.RESOURCE_GROUP_REUSE)) + .withIpTags( + Arrays.asList(new VirtualMachineIpTag().withIpTagType("auhashsfwx").withTag("owzxcu"), + new VirtualMachineIpTag().withIpTagType("cjooxdjebwpucwwf").withTag("vbvmeu"))) + .withPublicIPPrefix(new SubResource().withId("vyhzceuojgjrwj")) + .withPublicIPAddressVersion(IPVersions.IPV6) + .withPublicIPAllocationMethod(PublicIPAllocationMethod.DYNAMIC)) + .withSku(new PublicIPAddressSku().withName(PublicIPAddressSkuName.BASIC) + .withTier(PublicIPAddressSkuTier.REGIONAL)) + .withTags(mapOf("it", "x", "hniskxfbkpyc", "nrjawgqwg"))) + .withPrivateIPAddressVersion(IPVersions.IPV4) + .withApplicationSecurityGroups( + Arrays.asList(new SubResource().withId("nhjdauw"), new SubResource().withId("ylwz"))) + .withApplicationGatewayBackendAddressPools(Arrays.asList(new SubResource().withId("xujznbmpowu"), + new SubResource().withId("rzqlveu"), new SubResource().withId("upjm"))) + .withLoadBalancerBackendAddressPools(Arrays.asList(new SubResource().withId("obbc"), + new SubResource().withId("s"), new SubResource().withId("jriplrbpbewtghf")))); + model = BinaryData.fromObject(model).toObject(VirtualMachineNetworkInterfaceIPConfiguration.class); + Assertions.assertEquals("exq", model.name()); + Assertions.assertEquals("dmwsrcrgvxpvgomz", model.properties().subnet().id()); + Assertions.assertFalse(model.properties().primary()); + Assertions.assertEquals("sgwbnbbeld", model.properties().publicIPAddressConfiguration().name()); + Assertions.assertEquals(555346684, + model.properties().publicIPAddressConfiguration().properties().idleTimeoutInMinutes()); + Assertions.assertEquals(DeleteOptions.DELETE, + model.properties().publicIPAddressConfiguration().properties().deleteOption()); + Assertions.assertEquals("io", + model.properties().publicIPAddressConfiguration().properties().dnsSettings().domainNameLabel()); + Assertions.assertEquals(DomainNameLabelScopeTypes.RESOURCE_GROUP_REUSE, + model.properties().publicIPAddressConfiguration().properties().dnsSettings().domainNameLabelScope()); + Assertions.assertEquals("auhashsfwx", + model.properties().publicIPAddressConfiguration().properties().ipTags().get(0).ipTagType()); + Assertions.assertEquals("owzxcu", + model.properties().publicIPAddressConfiguration().properties().ipTags().get(0).tag()); + Assertions.assertEquals("vyhzceuojgjrwj", + model.properties().publicIPAddressConfiguration().properties().publicIPPrefix().id()); + Assertions.assertEquals(IPVersions.IPV6, + model.properties().publicIPAddressConfiguration().properties().publicIPAddressVersion()); + Assertions.assertEquals(PublicIPAllocationMethod.DYNAMIC, + model.properties().publicIPAddressConfiguration().properties().publicIPAllocationMethod()); + Assertions.assertEquals(PublicIPAddressSkuName.BASIC, + model.properties().publicIPAddressConfiguration().sku().name()); + Assertions.assertEquals(PublicIPAddressSkuTier.REGIONAL, + model.properties().publicIPAddressConfiguration().sku().tier()); + Assertions.assertEquals("x", model.properties().publicIPAddressConfiguration().tags().get("it")); + Assertions.assertEquals(IPVersions.IPV4, model.properties().privateIPAddressVersion()); + Assertions.assertEquals("nhjdauw", model.properties().applicationSecurityGroups().get(0).id()); + Assertions.assertEquals("xujznbmpowu", model.properties().applicationGatewayBackendAddressPools().get(0).id()); + Assertions.assertEquals("obbc", 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/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachinePublicIPAddressConfigurationPropertiesTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachinePublicIPAddressConfigurationPropertiesTests.java new file mode 100644 index 000000000000..37c7de7830ed --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachinePublicIPAddressConfigurationPropertiesTests.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.computebulkactions.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.DeleteOptions; +import com.azure.resourcemanager.computebulkactions.models.DomainNameLabelScopeTypes; +import com.azure.resourcemanager.computebulkactions.models.IPVersions; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAllocationMethod; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineIpTag; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressConfigurationProperties; +import com.azure.resourcemanager.computebulkactions.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\":1990032205,\"deleteOption\":\"Detach\",\"dnsSettings\":{\"domainNameLabel\":\"hzxct\",\"domainNameLabelScope\":\"ResourceGroupReuse\"},\"ipTags\":[{\"ipTagType\":\"moizpos\",\"tag\":\"grcfb\"},{\"ipTagType\":\"rmfqjhhkxbpvj\",\"tag\":\"jhxxjyn\"}],\"publicIPPrefix\":{\"id\":\"ivkrtsw\"},\"publicIPAddressVersion\":\"IPv4\",\"publicIPAllocationMethod\":\"Static\"}") + .toObject(VirtualMachinePublicIPAddressConfigurationProperties.class); + Assertions.assertEquals(1990032205, model.idleTimeoutInMinutes()); + Assertions.assertEquals(DeleteOptions.DETACH, model.deleteOption()); + Assertions.assertEquals("hzxct", model.dnsSettings().domainNameLabel()); + Assertions.assertEquals(DomainNameLabelScopeTypes.RESOURCE_GROUP_REUSE, + model.dnsSettings().domainNameLabelScope()); + Assertions.assertEquals("moizpos", model.ipTags().get(0).ipTagType()); + Assertions.assertEquals("grcfb", model.ipTags().get(0).tag()); + Assertions.assertEquals("ivkrtsw", model.publicIPPrefix().id()); + Assertions.assertEquals(IPVersions.IPV4, model.publicIPAddressVersion()); + Assertions.assertEquals(PublicIPAllocationMethod.STATIC, model.publicIPAllocationMethod()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualMachinePublicIPAddressConfigurationProperties model + = new VirtualMachinePublicIPAddressConfigurationProperties().withIdleTimeoutInMinutes(1990032205) + .withDeleteOption(DeleteOptions.DETACH) + .withDnsSettings( + new VirtualMachinePublicIPAddressDnsSettingsConfiguration().withDomainNameLabel("hzxct") + .withDomainNameLabelScope(DomainNameLabelScopeTypes.RESOURCE_GROUP_REUSE)) + .withIpTags(Arrays.asList(new VirtualMachineIpTag().withIpTagType("moizpos").withTag("grcfb"), + new VirtualMachineIpTag().withIpTagType("rmfqjhhkxbpvj").withTag("jhxxjyn"))) + .withPublicIPPrefix(new SubResource().withId("ivkrtsw")) + .withPublicIPAddressVersion(IPVersions.IPV4) + .withPublicIPAllocationMethod(PublicIPAllocationMethod.STATIC); + model = BinaryData.fromObject(model).toObject(VirtualMachinePublicIPAddressConfigurationProperties.class); + Assertions.assertEquals(1990032205, model.idleTimeoutInMinutes()); + Assertions.assertEquals(DeleteOptions.DETACH, model.deleteOption()); + Assertions.assertEquals("hzxct", model.dnsSettings().domainNameLabel()); + Assertions.assertEquals(DomainNameLabelScopeTypes.RESOURCE_GROUP_REUSE, + model.dnsSettings().domainNameLabelScope()); + Assertions.assertEquals("moizpos", model.ipTags().get(0).ipTagType()); + Assertions.assertEquals("grcfb", model.ipTags().get(0).tag()); + Assertions.assertEquals("ivkrtsw", model.publicIPPrefix().id()); + Assertions.assertEquals(IPVersions.IPV4, model.publicIPAddressVersion()); + Assertions.assertEquals(PublicIPAllocationMethod.STATIC, model.publicIPAllocationMethod()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachinePublicIPAddressConfigurationTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachinePublicIPAddressConfigurationTests.java new file mode 100644 index 000000000000..908e6d2b21c3 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachinePublicIPAddressConfigurationTests.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.DeleteOptions; +import com.azure.resourcemanager.computebulkactions.models.DomainNameLabelScopeTypes; +import com.azure.resourcemanager.computebulkactions.models.IPVersions; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSku; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSkuName; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAddressSkuTier; +import com.azure.resourcemanager.computebulkactions.models.PublicIPAllocationMethod; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachineIpTag; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressConfiguration; +import com.azure.resourcemanager.computebulkactions.models.VirtualMachinePublicIPAddressConfigurationProperties; +import com.azure.resourcemanager.computebulkactions.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\":\"jpkiidzyexznelix\",\"properties\":{\"idleTimeoutInMinutes\":417791826,\"deleteOption\":\"Detach\",\"dnsSettings\":{\"domainNameLabel\":\"lhbnxkna\",\"domainNameLabelScope\":\"NoReuse\"},\"ipTags\":[{\"ipTagType\":\"ggdtpnapnyiro\",\"tag\":\"hpigv\"}],\"publicIPPrefix\":{\"id\":\"lgqg\"},\"publicIPAddressVersion\":\"IPv6\",\"publicIPAllocationMethod\":\"Static\"},\"sku\":{\"name\":\"Basic\",\"tier\":\"Global\"},\"tags\":{\"wwncwzzhxgk\":\"n\",\"t\":\"rmgucnap\",\"fdygpfqbuaceopz\":\"oellwp\",\"opppcqeq\":\"qrhhu\"}}") + .toObject(VirtualMachinePublicIPAddressConfiguration.class); + Assertions.assertEquals("jpkiidzyexznelix", model.name()); + Assertions.assertEquals(417791826, model.properties().idleTimeoutInMinutes()); + Assertions.assertEquals(DeleteOptions.DETACH, model.properties().deleteOption()); + Assertions.assertEquals("lhbnxkna", model.properties().dnsSettings().domainNameLabel()); + Assertions.assertEquals(DomainNameLabelScopeTypes.NO_REUSE, + model.properties().dnsSettings().domainNameLabelScope()); + Assertions.assertEquals("ggdtpnapnyiro", model.properties().ipTags().get(0).ipTagType()); + Assertions.assertEquals("hpigv", model.properties().ipTags().get(0).tag()); + Assertions.assertEquals("lgqg", model.properties().publicIPPrefix().id()); + Assertions.assertEquals(IPVersions.IPV6, model.properties().publicIPAddressVersion()); + Assertions.assertEquals(PublicIPAllocationMethod.STATIC, model.properties().publicIPAllocationMethod()); + Assertions.assertEquals(PublicIPAddressSkuName.BASIC, model.sku().name()); + Assertions.assertEquals(PublicIPAddressSkuTier.GLOBAL, model.sku().tier()); + Assertions.assertEquals("n", model.tags().get("wwncwzzhxgk")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualMachinePublicIPAddressConfiguration model = new VirtualMachinePublicIPAddressConfiguration() + .withName("jpkiidzyexznelix") + .withProperties(new VirtualMachinePublicIPAddressConfigurationProperties() + .withIdleTimeoutInMinutes(417791826) + .withDeleteOption(DeleteOptions.DETACH) + .withDnsSettings( + new VirtualMachinePublicIPAddressDnsSettingsConfiguration().withDomainNameLabel("lhbnxkna") + .withDomainNameLabelScope(DomainNameLabelScopeTypes.NO_REUSE)) + .withIpTags(Arrays.asList(new VirtualMachineIpTag().withIpTagType("ggdtpnapnyiro").withTag("hpigv"))) + .withPublicIPPrefix(new SubResource().withId("lgqg")) + .withPublicIPAddressVersion(IPVersions.IPV6) + .withPublicIPAllocationMethod(PublicIPAllocationMethod.STATIC)) + .withSku( + new PublicIPAddressSku().withName(PublicIPAddressSkuName.BASIC).withTier(PublicIPAddressSkuTier.GLOBAL)) + .withTags(mapOf("wwncwzzhxgk", "n", "t", "rmgucnap", "fdygpfqbuaceopz", "oellwp", "opppcqeq", "qrhhu")); + model = BinaryData.fromObject(model).toObject(VirtualMachinePublicIPAddressConfiguration.class); + Assertions.assertEquals("jpkiidzyexznelix", model.name()); + Assertions.assertEquals(417791826, model.properties().idleTimeoutInMinutes()); + Assertions.assertEquals(DeleteOptions.DETACH, model.properties().deleteOption()); + Assertions.assertEquals("lhbnxkna", model.properties().dnsSettings().domainNameLabel()); + Assertions.assertEquals(DomainNameLabelScopeTypes.NO_REUSE, + model.properties().dnsSettings().domainNameLabelScope()); + Assertions.assertEquals("ggdtpnapnyiro", model.properties().ipTags().get(0).ipTagType()); + Assertions.assertEquals("hpigv", model.properties().ipTags().get(0).tag()); + Assertions.assertEquals("lgqg", model.properties().publicIPPrefix().id()); + Assertions.assertEquals(IPVersions.IPV6, model.properties().publicIPAddressVersion()); + Assertions.assertEquals(PublicIPAllocationMethod.STATIC, model.properties().publicIPAllocationMethod()); + Assertions.assertEquals(PublicIPAddressSkuName.BASIC, model.sku().name()); + Assertions.assertEquals(PublicIPAddressSkuTier.GLOBAL, model.sku().tier()); + Assertions.assertEquals("n", model.tags().get("wwncwzzhxgk")); + } + + // 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/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachinePublicIPAddressDnsSettingsConfigurationTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VirtualMachinePublicIPAddressDnsSettingsConfigurationTests.java new file mode 100644 index 000000000000..43e97aa04651 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.DomainNameLabelScopeTypes; +import com.azure.resourcemanager.computebulkactions.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\":\"szjfauvjfdxxivet\",\"domainNameLabelScope\":\"ResourceGroupReuse\"}") + .toObject(VirtualMachinePublicIPAddressDnsSettingsConfiguration.class); + Assertions.assertEquals("szjfauvjfdxxivet", 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("szjfauvjfdxxivet") + .withDomainNameLabelScope(DomainNameLabelScopeTypes.RESOURCE_GROUP_REUSE); + model = BinaryData.fromObject(model).toObject(VirtualMachinePublicIPAddressDnsSettingsConfiguration.class); + Assertions.assertEquals("szjfauvjfdxxivet", model.domainNameLabel()); + Assertions.assertEquals(DomainNameLabelScopeTypes.RESOURCE_GROUP_REUSE, model.domainNameLabelScope()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VmSizeProfileTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/VmSizeProfileTests.java new file mode 100644 index 000000000000..eb404e940acc --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":\"basyy\",\"rank\":893627335}").toObject(VmSizeProfile.class); + Assertions.assertEquals("basyy", model.name()); + Assertions.assertEquals(893627335, model.rank()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VmSizeProfile model = new VmSizeProfile().withName("basyy").withRank(893627335); + model = BinaryData.fromObject(model).toObject(VmSizeProfile.class); + Assertions.assertEquals("basyy", model.name()); + Assertions.assertEquals(893627335, model.rank()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/WinRMConfigurationTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/WinRMConfigurationTests.java new file mode 100644 index 000000000000..6b01ce91289b --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/WinRMConfigurationTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.ProtocolTypes; +import com.azure.resourcemanager.computebulkactions.models.WinRMConfiguration; +import com.azure.resourcemanager.computebulkactions.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\":\"jampmngnzscxaqw\"},{\"protocol\":\"Https\",\"certificateUrl\":\"cbonqvpk\"}]}") + .toObject(WinRMConfiguration.class); + Assertions.assertEquals(ProtocolTypes.HTTPS, model.listeners().get(0).protocol()); + Assertions.assertEquals("jampmngnzscxaqw", 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("jampmngnzscxaqw"), + new WinRMListener().withProtocol(ProtocolTypes.HTTPS).withCertificateUrl("cbonqvpk"))); + model = BinaryData.fromObject(model).toObject(WinRMConfiguration.class); + Assertions.assertEquals(ProtocolTypes.HTTPS, model.listeners().get(0).protocol()); + Assertions.assertEquals("jampmngnzscxaqw", model.listeners().get(0).certificateUrl()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/WinRMListenerTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/WinRMListenerTests.java new file mode 100644 index 000000000000..039f39cc4286 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/WinRMListenerTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.ProtocolTypes; +import com.azure.resourcemanager.computebulkactions.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\":\"Https\",\"certificateUrl\":\"njeaseipheofloke\"}") + .toObject(WinRMListener.class); + Assertions.assertEquals(ProtocolTypes.HTTPS, model.protocol()); + Assertions.assertEquals("njeaseipheofloke", model.certificateUrl()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WinRMListener model + = new WinRMListener().withProtocol(ProtocolTypes.HTTPS).withCertificateUrl("njeaseipheofloke"); + model = BinaryData.fromObject(model).toObject(WinRMListener.class); + Assertions.assertEquals(ProtocolTypes.HTTPS, model.protocol()); + Assertions.assertEquals("njeaseipheofloke", model.certificateUrl()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/WindowsConfigurationTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/WindowsConfigurationTests.java new file mode 100644 index 000000000000..fe5845419ef5 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/WindowsConfigurationTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.AdditionalUnattendContent; +import com.azure.resourcemanager.computebulkactions.models.AdditionalUnattendContentComponentName; +import com.azure.resourcemanager.computebulkactions.models.AdditionalUnattendContentPassName; +import com.azure.resourcemanager.computebulkactions.models.PatchSettings; +import com.azure.resourcemanager.computebulkactions.models.ProtocolTypes; +import com.azure.resourcemanager.computebulkactions.models.SettingNames; +import com.azure.resourcemanager.computebulkactions.models.WinRMConfiguration; +import com.azure.resourcemanager.computebulkactions.models.WinRMListener; +import com.azure.resourcemanager.computebulkactions.models.WindowsConfiguration; +import com.azure.resourcemanager.computebulkactions.models.WindowsPatchAssessmentMode; +import com.azure.resourcemanager.computebulkactions.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.computebulkactions.models.WindowsVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.computebulkactions.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\":true,\"enableAutomaticUpdates\":false,\"timeZone\":\"fvm\",\"additionalUnattendContent\":[{\"passName\":\"OobeSystem\",\"componentName\":\"Microsoft-Windows-Shell-Setup\",\"settingName\":\"AutoLogon\",\"content\":\"v\"}],\"patchSettings\":{\"patchMode\":\"AutomaticByOS\",\"enableHotpatching\":false,\"assessmentMode\":\"ImageDefault\",\"automaticByPlatformSettings\":{\"rebootSetting\":\"Never\",\"bypassPlatformSafetyChecksOnUserSchedule\":true}},\"winRM\":{\"listeners\":[{\"protocol\":\"Https\",\"certificateUrl\":\"vccfw\"}]}}") + .toObject(WindowsConfiguration.class); + Assertions.assertTrue(model.provisionVMAgent()); + Assertions.assertFalse(model.enableAutomaticUpdates()); + Assertions.assertEquals("fvm", 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.AUTO_LOGON, model.additionalUnattendContent().get(0).settingName()); + Assertions.assertEquals("v", model.additionalUnattendContent().get(0).content()); + Assertions.assertEquals(WindowsVMGuestPatchMode.AUTOMATIC_BY_OS, model.patchSettings().patchMode()); + Assertions.assertFalse(model.patchSettings().enableHotpatching()); + Assertions.assertEquals(WindowsPatchAssessmentMode.IMAGE_DEFAULT, model.patchSettings().assessmentMode()); + Assertions.assertEquals(WindowsVMGuestPatchAutomaticByPlatformRebootSetting.NEVER, + model.patchSettings().automaticByPlatformSettings().rebootSetting()); + Assertions + .assertTrue(model.patchSettings().automaticByPlatformSettings().bypassPlatformSafetyChecksOnUserSchedule()); + Assertions.assertEquals(ProtocolTypes.HTTPS, model.winRM().listeners().get(0).protocol()); + Assertions.assertEquals("vccfw", model.winRM().listeners().get(0).certificateUrl()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WindowsConfiguration model = new WindowsConfiguration().withProvisionVMAgent(true) + .withEnableAutomaticUpdates(false) + .withTimeZone("fvm") + .withAdditionalUnattendContent(Arrays + .asList(new AdditionalUnattendContent().withPassName(AdditionalUnattendContentPassName.OOBE_SYSTEM) + .withComponentName(AdditionalUnattendContentComponentName.MICROSOFT_WINDOWS_SHELL_SETUP) + .withSettingName(SettingNames.AUTO_LOGON) + .withContent("v"))) + .withPatchSettings(new PatchSettings().withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_OS) + .withEnableHotpatching(false) + .withAssessmentMode(WindowsPatchAssessmentMode.IMAGE_DEFAULT) + .withAutomaticByPlatformSettings(new WindowsVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting(WindowsVMGuestPatchAutomaticByPlatformRebootSetting.NEVER) + .withBypassPlatformSafetyChecksOnUserSchedule(true))) + .withWinRM(new WinRMConfiguration().withListeners( + Arrays.asList(new WinRMListener().withProtocol(ProtocolTypes.HTTPS).withCertificateUrl("vccfw")))); + model = BinaryData.fromObject(model).toObject(WindowsConfiguration.class); + Assertions.assertTrue(model.provisionVMAgent()); + Assertions.assertFalse(model.enableAutomaticUpdates()); + Assertions.assertEquals("fvm", 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.AUTO_LOGON, model.additionalUnattendContent().get(0).settingName()); + Assertions.assertEquals("v", model.additionalUnattendContent().get(0).content()); + Assertions.assertEquals(WindowsVMGuestPatchMode.AUTOMATIC_BY_OS, model.patchSettings().patchMode()); + Assertions.assertFalse(model.patchSettings().enableHotpatching()); + Assertions.assertEquals(WindowsPatchAssessmentMode.IMAGE_DEFAULT, model.patchSettings().assessmentMode()); + Assertions.assertEquals(WindowsVMGuestPatchAutomaticByPlatformRebootSetting.NEVER, + model.patchSettings().automaticByPlatformSettings().rebootSetting()); + Assertions + .assertTrue(model.patchSettings().automaticByPlatformSettings().bypassPlatformSafetyChecksOnUserSchedule()); + Assertions.assertEquals(ProtocolTypes.HTTPS, model.winRM().listeners().get(0).protocol()); + Assertions.assertEquals("vccfw", model.winRM().listeners().get(0).certificateUrl()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/WindowsVMGuestPatchAutomaticByPlatformSettingsTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/WindowsVMGuestPatchAutomaticByPlatformSettingsTests.java new file mode 100644 index 000000000000..0eb58406ad6f --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.computebulkactions.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\":\"Never\",\"bypassPlatformSafetyChecksOnUserSchedule\":false}") + .toObject(WindowsVMGuestPatchAutomaticByPlatformSettings.class); + Assertions.assertEquals(WindowsVMGuestPatchAutomaticByPlatformRebootSetting.NEVER, model.rebootSetting()); + Assertions.assertFalse(model.bypassPlatformSafetyChecksOnUserSchedule()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WindowsVMGuestPatchAutomaticByPlatformSettings model = new WindowsVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting(WindowsVMGuestPatchAutomaticByPlatformRebootSetting.NEVER) + .withBypassPlatformSafetyChecksOnUserSchedule(false); + model = BinaryData.fromObject(model).toObject(WindowsVMGuestPatchAutomaticByPlatformSettings.class); + Assertions.assertEquals(WindowsVMGuestPatchAutomaticByPlatformRebootSetting.NEVER, model.rebootSetting()); + Assertions.assertFalse(model.bypassPlatformSafetyChecksOnUserSchedule()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ZoneAllocationPolicyTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ZoneAllocationPolicyTests.java new file mode 100644 index 000000000000..a4e2facfc100 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ZoneAllocationPolicyTests.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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.models.ZoneAllocationPolicy; +import com.azure.resourcemanager.computebulkactions.models.ZoneDistributionStrategy; +import com.azure.resourcemanager.computebulkactions.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\":\"BestEffortBalanced\",\"zonePreferences\":[{\"zone\":\"owwquuvxz\",\"rank\":1447033048},{\"zone\":\"vithh\",\"rank\":176578322},{\"zone\":\"nosggbhcoh\",\"rank\":1492751876},{\"zone\":\"sjnkal\",\"rank\":391766197}]}") + .toObject(ZoneAllocationPolicy.class); + Assertions.assertEquals(ZoneDistributionStrategy.BEST_EFFORT_BALANCED, model.distributionStrategy()); + Assertions.assertEquals("owwquuvxz", model.zonePreferences().get(0).zone()); + Assertions.assertEquals(1447033048, model.zonePreferences().get(0).rank()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ZoneAllocationPolicy model + = new ZoneAllocationPolicy().withDistributionStrategy(ZoneDistributionStrategy.BEST_EFFORT_BALANCED) + .withZonePreferences(Arrays.asList(new ZonePreference().withZone("owwquuvxz").withRank(1447033048), + new ZonePreference().withZone("vithh").withRank(176578322), + new ZonePreference().withZone("nosggbhcoh").withRank(1492751876), + new ZonePreference().withZone("sjnkal").withRank(391766197))); + model = BinaryData.fromObject(model).toObject(ZoneAllocationPolicy.class); + Assertions.assertEquals(ZoneDistributionStrategy.BEST_EFFORT_BALANCED, model.distributionStrategy()); + Assertions.assertEquals("owwquuvxz", model.zonePreferences().get(0).zone()); + Assertions.assertEquals(1447033048, model.zonePreferences().get(0).rank()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ZonePreferenceTests.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/generated/ZonePreferenceTests.java new file mode 100644 index 000000000000..a3aaa2121d0b --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/test/java/com/azure/resourcemanager/computebulkactions/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.computebulkactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computebulkactions.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\":\"iiswacffgdkzze\",\"rank\":1140088528}").toObject(ZonePreference.class); + Assertions.assertEquals("iiswacffgdkzze", model.zone()); + Assertions.assertEquals(1140088528, model.rank()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ZonePreference model = new ZonePreference().withZone("iiswacffgdkzze").withRank(1140088528); + model = BinaryData.fromObject(model).toObject(ZonePreference.class); + Assertions.assertEquals("iiswacffgdkzze", model.zone()); + Assertions.assertEquals(1140088528, model.rank()); + } +} diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/tsp-location.yaml b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/tsp-location.yaml new file mode 100644 index 000000000000..da057969e2e6 --- /dev/null +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/computebulkactions/ComputeBulkActions.Management +commit: 96e89b58d95282fc014f19db8e0d41d4d8608838 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/computebulkactions/ci.yml b/sdk/computebulkactions/ci.yml new file mode 100644 index 000000000000..157176508836 --- /dev/null +++ b/sdk/computebulkactions/ci.yml @@ -0,0 +1,46 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/computebulkactions/ci.yml + - sdk/computebulkactions/azure-resourcemanager-computebulkactions/ + exclude: + - sdk/computebulkactions/pom.xml + - sdk/computebulkactions/azure-resourcemanager-computebulkactions/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computebulkactions/ci.yml + - sdk/computebulkactions/azure-resourcemanager-computebulkactions/ + exclude: + - sdk/computebulkactions/pom.xml + - sdk/computebulkactions/azure-resourcemanager-computebulkactions/pom.xml + +parameters: + - name: release_azureresourcemanagercomputebulkactions + displayName: azure-resourcemanager-computebulkactions + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: computebulkactions + Artifacts: + - name: azure-resourcemanager-computebulkactions + groupId: com.azure.resourcemanager + safeName: azureresourcemanagercomputebulkactions + releaseInBatch: ${{ parameters.release_azureresourcemanagercomputebulkactions }} diff --git a/sdk/computebulkactions/pom.xml b/sdk/computebulkactions/pom.xml new file mode 100644 index 000000000000..347746d9bd02 --- /dev/null +++ b/sdk/computebulkactions/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-computebulkactions-service + pom + 1.0.0 + + + azure-resourcemanager-computebulkactions + +