diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/CHANGELOG.md b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/CHANGELOG.md index 2613ba9e9ea4..372b334b7ec7 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/CHANGELOG.md +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/CHANGELOG.md @@ -1,14 +1,382 @@ # Release History -## 1.3.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2025-04-30) -### Features Added +- Azure Resource Manager DesktopVirtualization client library for Java. This package contains Microsoft Azure SDK for DesktopVirtualization Management SDK. Package tag package-preview-2024-11-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.ResourceIdentityType` was removed + +#### `models.ResourceModelWithAllowedPropertySetPlan` was removed + +#### `models.Identity` was removed + +#### `models.ScalingScheduleDaysOfWeekItem` was removed + +#### `models.ResourceModelWithAllowedPropertySetIdentity` was removed + +#### `models.ResourceModelWithAllowedPropertySetSku` was removed + +#### `models.ScalingPlanPersonalSchedule$DefinitionStages` was modified + +* Required stage 2, 3, 4, 5, 6 was added + +#### `models.ScalingPlanPooledSchedule$DefinitionStages` was modified + +* Required stage 2, 3, 4, 5, 6, 7, 8 was added + +#### `models.ScalingPlanPooledSchedule$Definition` was modified + +* `withRampUpCapacityThresholdPct(java.lang.Integer)` was removed +* `withRampDownCapacityThresholdPct(java.lang.Integer)` was removed + +#### `models.Workspace` was modified + +* `models.ResourceModelWithAllowedPropertySetSku sku()` -> `models.Sku sku()` +* `models.ResourceModelWithAllowedPropertySetPlan plan()` -> `models.Plan plan()` +* `models.ResourceModelWithAllowedPropertySetIdentity identity()` -> `models.ManagedServiceIdentity identity()` + +#### `models.ApplicationGroup` was modified + +* `models.ResourceModelWithAllowedPropertySetPlan plan()` -> `models.Plan plan()` +* `models.ResourceModelWithAllowedPropertySetIdentity identity()` -> `models.ManagedServiceIdentity identity()` +* `models.ResourceModelWithAllowedPropertySetSku sku()` -> `models.Sku sku()` + +#### `models.HostPool` was modified + +* `models.ResourceModelWithAllowedPropertySetPlan plan()` -> `models.Plan plan()` +* `models.ResourceModelWithAllowedPropertySetSku sku()` -> `models.Sku sku()` +* `models.ResourceModelWithAllowedPropertySetIdentity identity()` -> `models.ManagedServiceIdentity identity()` + +#### `models.ResourceModelWithAllowedPropertySet` was modified + +* `models.ResourceModelWithAllowedPropertySetIdentity identity()` -> `models.ManagedServiceIdentity identity()` +* `models.ResourceModelWithAllowedPropertySetSku sku()` -> `models.Sku sku()` +* `withSku(models.ResourceModelWithAllowedPropertySetSku)` was removed +* `withPlan(models.ResourceModelWithAllowedPropertySetPlan)` was removed +* `models.ResourceModelWithAllowedPropertySetPlan plan()` -> `models.Plan plan()` +* `withIdentity(models.ResourceModelWithAllowedPropertySetIdentity)` was removed + +#### `models.AppAttachPackages` was modified + +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `deleteByResourceGroupWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `deleteByResourceGroup(java.lang.String,java.lang.String)` was removed + +#### `models.ApplicationGroup$Definition` was modified + +* `withIdentity(models.ResourceModelWithAllowedPropertySetIdentity)` was removed +* `withSku(models.ResourceModelWithAllowedPropertySetSku)` was removed +* `withPlan(models.ResourceModelWithAllowedPropertySetPlan)` was removed + +#### `models.HostPool$Definition` was modified + +* `withIdentity(models.ResourceModelWithAllowedPropertySetIdentity)` was removed +* `withPlan(models.ResourceModelWithAllowedPropertySetPlan)` was removed +* `withSku(models.ResourceModelWithAllowedPropertySetSku)` was removed + +#### `models.ScalingPlanPooledSchedule` was modified + +* `java.lang.Integer rampUpCapacityThresholdPct()` -> `int rampUpCapacityThresholdPct()` +* `java.lang.Integer rampDownCapacityThresholdPct()` -> `int rampDownCapacityThresholdPct()` + +#### `models.SessionHosts` was modified + +* `list(java.lang.String,java.lang.String,java.lang.Integer,java.lang.Boolean,java.lang.Integer,com.azure.core.util.Context)` was removed + +#### `models.ScalingPlan` was modified + +* `models.ResourceModelWithAllowedPropertySetPlan plan()` -> `models.Plan plan()` +* `models.ResourceModelWithAllowedPropertySetIdentity identity()` -> `models.ManagedServiceIdentity identity()` +* `models.ResourceModelWithAllowedPropertySetSku sku()` -> `models.Sku sku()` + +#### `models.ScalingPlan$Definition` was modified + +* `withIdentity(models.ResourceModelWithAllowedPropertySetIdentity)` was removed +* `withPlan(models.ResourceModelWithAllowedPropertySetPlan)` was removed +* `withSku(models.ResourceModelWithAllowedPropertySetSku)` was removed + +#### `models.Workspace$Definition` was modified + +* `withPlan(models.ResourceModelWithAllowedPropertySetPlan)` was removed +* `withIdentity(models.ResourceModelWithAllowedPropertySetIdentity)` was removed +* `withSku(models.ResourceModelWithAllowedPropertySetSku)` was removed + +### Features Added + +* `models.SessionHostManagementList` was added + +* `models.VirtualMachineDiskType` was added + +* `models.MarketplaceInfoPatchProperties` was added + +* `models.ActiveDirectoryInfoProperties` was added + +* `models.DiskInfoProperties` was added + +* `models.SessionHostConfigurations` was added + +* `models.UserAssignedIdentity` was added + +* `models.AzureActiveDirectoryInfoProperties` was added + +* `models.SessionHostConfigurationList` was added + +* `models.SessionHostManagementsUpdateStatus` was added + +* `models.SessionHostManagementUpdateStatus` was added + +* `models.PublicUdp` was added + +* `models.DomainInfoPatchProperties` was added + +* `models.ImageInfoPatchProperties` was added + +* `models.SessionHostManagementOperationProgress` was added + +* `models.KeyVaultCredentialsProperties` was added + +* `models.ManagedServiceIdentity` was added + +* `models.KeyVaultCredentialsPatchProperties` was added + +* `models.SessionHostConfiguration` was added + +* `models.SecurityInfoPatchProperties` was added + +* `models.BootDiagnosticsInfoProperties` was added + +* `models.ActiveSessionHostConfiguration` was added + +* `models.ControlSessionHostUpdates` was added + +* `models.DomainInfoProperties` was added + +* `models.ActiveSessionHostConfigurationList` was added + +* `models.CustomInfoPatchProperties` was added + +* `models.ManagedServiceIdentityType` was added + +* `models.ActiveSessionHostConfigurations` was added + +* `models.SessionHostConfigurationPatch` was added + +* `models.SessionHostManagementPatch` was added + +* `models.BootDiagnosticsInfoPatchProperties` was added + +* `models.DirectUdp` was added + +* `models.NetworkInfoPatchProperties` was added + +* `models.SessionHostManagement` was added + +* `models.MarketplaceInfoProperties` was added + +* `models.SecurityInfoProperties` was added + +* `models.SessionHostOperations` was added + +* `models.HostPoolUpdateAction` was added + +* `models.ScalingMethod` was added + +* `models.ManagedPrivateUdp` was added + +* `models.UpdateSessionHostsRequestBody` was added + +* `models.InitiateSessionHostUpdates` was added + +* `models.ProvisioningStateShc` was added + +* `models.HostPoolUpdateControlParameter` was added + +* `models.ImageInfoProperties` was added + +* `models.DiskInfoPatchProperties` was added + +* `models.HostPoolUpdateConfigurationProperties` was added + +* `models.NetworkInfoProperties` was added + +* `models.VirtualMachineSecurityType` was added + +* `models.ManagementType` was added + +* `models.SessionHostManagementUpdateStatusProperties` was added + +* `models.RelayUdp` was added + +* `models.ActiveDirectoryInfoPatchProperties` was added + +* `models.DomainJoinType` was added + +* `models.HostPoolUpdateConfigurationPatchProperties` was added + +* `models.CustomInfoProperties` was added + +* `models.SessionHostManagements` was added + +* `models.Type` was added + +* `models.CreateDeleteProperties` was added + +#### `models.ScalingPlanPooledSchedule$Definition` was modified + +* `withRampUpCapacityThresholdPct(int)` was added +* `withRampDownCapacityThresholdPct(int)` was added +* `withScalingMethod(models.ScalingMethod)` was added +* `withCreateDelete(models.CreateDeleteProperties)` was added + +#### `models.ScalingPlanPooledSchedule$Update` was modified + +* `withScalingMethod(models.ScalingMethod)` was added +* `withCreateDelete(models.CreateDeleteProperties)` was added + +#### `models.HostPool$Update` was modified + +* `withPublicUdp(models.PublicUdp)` was added +* `withRelayUdp(models.RelayUdp)` was added +* `withManagedPrivateUdp(models.ManagedPrivateUdp)` was added +* `withDirectUdp(models.DirectUdp)` was added + +#### `models.AppAttachPackagePatch` was modified + +* `tags()` was added +* `withTags(java.util.Map)` was added + +#### `models.AppAttachPackagePatchProperties` was modified + +* `withCustomData(java.lang.String)` was added +* `packageLookbackUrl()` was added +* `customData()` was added +* `withPackageLookbackUrl(java.lang.String)` was added + +#### `models.ScalingSchedule` was modified + +* `scalingMethod()` was added +* `withCreateDelete(models.CreateDeleteProperties)` was added +* `withScalingMethod(models.ScalingMethod)` was added +* `createDelete()` was added + +#### `models.HostPool` was modified + +* `relayUdp()` was added +* `managementType()` was added +* `directUdp()` was added +* `managedPrivateUdp()` was added +* `publicUdp()` was added + +#### `models.HostPoolPatch` was modified + +* `publicUdp()` was added +* `managedPrivateUdp()` was added +* `relayUdp()` was added +* `withDirectUdp(models.DirectUdp)` was added +* `withPublicUdp(models.PublicUdp)` was added +* `withRelayUdp(models.RelayUdp)` was added +* `withManagedPrivateUdp(models.ManagedPrivateUdp)` was added +* `directUdp()` was added + +#### `models.ResourceModelWithAllowedPropertySet` was modified + +* `withIdentity(models.ManagedServiceIdentity)` was added +* `withPlan(models.Plan)` was added +* `withSku(models.Sku)` was added + +#### `models.HostPoolProperties` was modified + +* `managedPrivateUdp()` was added +* `managementType()` was added +* `publicUdp()` was added +* `directUdp()` was added +* `relayUdp()` was added + +#### `DesktopVirtualizationManager` was modified + +* `initiateSessionHostUpdates()` was added +* `sessionHostConfigurations()` was added +* `sessionHostManagementsUpdateStatus()` was added +* `controlSessionHostUpdates()` was added +* `sessionHostOperations()` was added +* `activeSessionHostConfigurations()` was added +* `sessionHostManagements()` was added + +#### `models.AppAttachPackages` was modified + +* `delete(java.lang.String,java.lang.String)` was added +* `deleteWithResponse(java.lang.String,java.lang.String,java.lang.Boolean,com.azure.core.util.Context)` was added +* `deleteByIdWithResponse(java.lang.String,java.lang.Boolean,com.azure.core.util.Context)` was added + +#### `models.AppAttachPackage$Update` was modified + +* `withTags(java.util.Map)` was added + +#### `models.AppAttachPackageProperties` was modified + +* `withPackageOwnerName(java.lang.String)` was added +* `packageOwnerName()` was added +* `customData()` was added +* `packageLookbackUrl()` was added +* `withPackageLookbackUrl(java.lang.String)` was added +* `withCustomData(java.lang.String)` was added + +#### `models.ScalingPlanPooledSchedulePatch` was modified + +* `createDelete()` was added +* `withScalingMethod(models.ScalingMethod)` was added +* `withCreateDelete(models.CreateDeleteProperties)` was added +* `namePropertiesName()` was added +* `scalingMethod()` was added + +#### `models.ApplicationGroup$Definition` was modified + +* `withSku(models.Sku)` was added +* `withPlan(models.Plan)` was added +* `withIdentity(models.ManagedServiceIdentity)` was added + +#### `models.HostPool$Definition` was modified + +* `withManagedPrivateUdp(models.ManagedPrivateUdp)` was added +* `withSku(models.Sku)` was added +* `withManagementType(models.ManagementType)` was added +* `withIdentity(models.ManagedServiceIdentity)` was added +* `withDirectUdp(models.DirectUdp)` was added +* `withPlan(models.Plan)` was added +* `withRelayUdp(models.RelayUdp)` was added +* `withPublicUdp(models.PublicUdp)` was added + +#### `models.ScalingPlanPooledSchedule` was modified + +* `namePropertiesName()` was added +* `createDelete()` was added +* `scalingMethod()` was added + +#### `models.SessionHost` was modified + +* `pendingSessions()` was added +* `lastSessionHostUpdateTime()` was added +* `disconnectedSessions()` was added +* `activeSessions()` was added +* `sessionHostConfiguration()` was added + +#### `models.SessionHosts` was modified + +* `list(java.lang.String,java.lang.String,java.lang.Integer,java.lang.Boolean,java.lang.Integer,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.ScalingPlan$Definition` was modified + +* `withPlan(models.Plan)` was added +* `withIdentity(models.ManagedServiceIdentity)` was added +* `withSku(models.Sku)` was added + +#### `models.Workspace$Definition` was modified -### Other Changes +* `withSku(models.Sku)` was added +* `withPlan(models.Plan)` was added +* `withIdentity(models.ManagedServiceIdentity)` was added ## 1.2.0 (2024-09-25) diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/README.md b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/README.md index e24bec575a81..4b1e9701feab 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/README.md +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/README.md @@ -2,7 +2,7 @@ Azure Resource Manager DesktopVirtualization client library for Java. -This package contains Microsoft Azure SDK for DesktopVirtualization Management SDK. Package tag package-2024-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for DesktopVirtualization Management SDK. Package tag package-preview-2024-11-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 @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ DesktopVirtualizationManager manager = DesktopVirtualizationManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [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/desktopvirtualization/azure-resourcemanager-desktopvirtualization/SAMPLE.md b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/SAMPLE.md index 904b9a25fb83..2adbbd01db65 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/SAMPLE.md +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/SAMPLE.md @@ -1,6 +1,11 @@ # Code snippets and samples +## ActiveSessionHostConfigurations + +- [Get](#activesessionhostconfigurations_get) +- [ListByHostPool](#activesessionhostconfigurations_listbyhostpool) + ## AppAttachPackage - [CreateOrUpdate](#appattachpackage_createorupdate) @@ -31,6 +36,10 @@ - [List](#applications_list) - [Update](#applications_update) +## ControlSessionHostUpdate + +- [Post](#controlsessionhostupdate_post) + ## Desktops - [Get](#desktops_get) @@ -48,6 +57,10 @@ - [RetrieveRegistrationToken](#hostpools_retrieveregistrationtoken) - [Update](#hostpools_update) +## InitiateSessionHostUpdate + +- [Post](#initiatesessionhostupdate_post) + ## MsixImages - [Expand](#msiximages_expand) @@ -106,6 +119,28 @@ - [ListByResourceGroup](#scalingplans_listbyresourcegroup) - [Update](#scalingplans_update) +## SessionHostConfigurations + +- [CreateOrUpdate](#sessionhostconfigurations_createorupdate) +- [Get](#sessionhostconfigurations_get) +- [ListByHostPool](#sessionhostconfigurations_listbyhostpool) +- [Update](#sessionhostconfigurations_update) + +## SessionHostManagements + +- [CreateOrUpdate](#sessionhostmanagements_createorupdate) +- [Get](#sessionhostmanagements_get) +- [ListByHostPool](#sessionhostmanagements_listbyhostpool) +- [Update](#sessionhostmanagements_update) + +## SessionHostManagementsUpdateStatus + +- [Get](#sessionhostmanagementsupdatestatus_get) + +## SessionHostOperation + +- [RetryProvisioning](#sessionhostoperation_retryprovisioning) + ## SessionHosts - [Delete](#sessionhosts_delete) @@ -134,228 +169,183 @@ - [List](#workspaces_list) - [ListByResourceGroup](#workspaces_listbyresourcegroup) - [Update](#workspaces_update) -### AppAttachPackage_CreateOrUpdate +### ActiveSessionHostConfigurations_Get ```java -import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageInfoProperties; -import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageProperties; -import com.azure.resourcemanager.desktopvirtualization.models.FailHealthCheckOnStagingFailure; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; -import java.time.OffsetDateTime; -import java.util.Arrays; - /** - * Samples for AppAttachPackage CreateOrUpdate. + * Samples for ApplicationGroups GetByResourceGroup. */ -public final class AppAttachPackageCreateOrUpdateSamples { +public final class ApplicationGroupsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackage_Create.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ApplicationGroup_Get.json */ /** - * Sample code: AppAttachPackage_Create. + * Sample code: ApplicationGroup_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - appAttachPackageCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.appAttachPackages() - .define("msixpackagefullname") - .withRegion("southcentralus") - .withExistingResourceGroup("resourceGroup1") - .withProperties(new AppAttachPackageProperties() - .withImage(new AppAttachPackageInfoProperties().withPackageAlias("msixpackagealias") - .withImagePath("imagepath") - .withPackageName("MsixPackageName") - .withPackageFamilyName("MsixPackage_FamilyName") - .withPackageFullName("MsixPackage_FullName") - .withDisplayName("displayname") - .withPackageRelativePath("packagerelativepath") - .withIsRegularRegistration(false) - .withIsActive(false) - .withPackageDependencies( - Arrays.asList(new MsixPackageDependencies().withDependencyName("MsixPackage_Dependency_Name") - .withPublisher("MsixPackage_Dependency_Publisher") - .withMinVersion("packageDep_version"))) - .withVersion("packageversion") - .withLastUpdated(OffsetDateTime.parse("2008-09-22T14:01:54.9571247Z")) - .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("AppId") - .withDescription("PackageApplicationDescription") - .withAppUserModelId("AppUserModelId") - .withFriendlyName("FriendlyName") - .withIconImageName("Iconimagename") - .withRawIcon("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()) - .withRawPng("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()))) - .withCertificateName("certName") - .withCertificateExpiry(OffsetDateTime.parse("2023-01-02T17:18:19.1234567Z"))) - .withHostPoolReferences(Arrays.asList()) - .withKeyVaultUrl("fakeTokenPlaceholder") - .withFailHealthCheckOnStagingFailure(FailHealthCheckOnStagingFailure.NEEDS_ASSISTANCE)) - .create(); + applicationGroupGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applicationGroups() + .getByResourceGroupWithResponse("resourceGroup1", "applicationGroup1", com.azure.core.util.Context.NONE); } } ``` -### AppAttachPackage_Delete +### ActiveSessionHostConfigurations_ListByHostPool ```java -/** - * Samples for AppAttachPackage Delete. - */ -public final class AppAttachPackageDeleteSamples { - /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackage_Delete.json - */ - /** - * Sample code: AppAttachPackage_Delete. - * - * @param manager Entry point to DesktopVirtualizationManager. - */ - public static void - appAttachPackageDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.appAttachPackages() - .deleteByResourceGroupWithResponse("resourceGroup1", "packagefullname", com.azure.core.util.Context.NONE); - } -} -``` - -### AppAttachPackage_GetByResourceGroup +import com.azure.resourcemanager.desktopvirtualization.models.ActiveDirectoryInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.BootDiagnosticsInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.CustomInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DiskInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DomainInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ImageInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.KeyVaultCredentialsPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.MarketplaceInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.NetworkInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SecurityInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostConfigurationPatch; +import com.azure.resourcemanager.desktopvirtualization.models.Type; +import com.azure.resourcemanager.desktopvirtualization.models.VirtualMachineDiskType; +import com.azure.resourcemanager.desktopvirtualization.models.VirtualMachineSecurityType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; -```java /** - * Samples for AppAttachPackage GetByResourceGroup. + * Samples for SessionHostConfigurations Update. */ -public final class AppAttachPackageGetByResourceGroupSamples { +public final class SessionHostConfigurationsUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackage_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostConfigurations_Update.json */ /** - * Sample code: AppAttachPackage_Get. + * Sample code: SessionHostConfigurations_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - appAttachPackageGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.appAttachPackages() - .getByResourceGroupWithResponse("resourceGroup1", "packagefullname", com.azure.core.util.Context.NONE); + public static void sessionHostConfigurationsUpdate( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostConfigurations() + .update("resourceGroup1", "hostPool1", new SessionHostConfigurationPatch() + .withFriendlyName("Second Version, Updated Location") + .withVmTags(mapOf("Department", "myDepartment", "Team", "myTeam")) + .withVmLocation("eastus2") + .withVmResourceGroup("myResourceGroup") + .withVmNamePrefix("westus2-vm") + .withAvailabilityZones(Arrays.asList(1, 3)) + .withNetworkInfo(new NetworkInfoPatchProperties().withSubnetId( + "/subscriptions/.../resourceGroups/.../providers/Microsoft.Network/virtualNetworks/.../subnets/subnet1") + .withSecurityGroupId( + "/subscriptions/.../resourceGroups/.../provider s/Microsoft.Network/networkSecurityGroups/nsg1")) + .withVmSizeId("Standard_D2s_v3") + .withDiskInfo(new DiskInfoPatchProperties().withType(VirtualMachineDiskType.STANDARD_LRS)) + .withCustomConfigurationScriptUrl("https://storageaccountname.blob.core.windows.net/blobcontainer/file") + .withImageInfo(new ImageInfoPatchProperties().withImageType(Type.MARKETPLACE) + .withMarketplaceInfo(new MarketplaceInfoPatchProperties().withOffer("Windows-10") + .withPublisher("MicrosoftWindowsDesktop") + .withSku("19h2-ent") + .withExactVersion("2019.0.20190115")) + .withCustomInfo(new CustomInfoPatchProperties().withResourceId( + "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.Compute/images/imageName"))) + .withDomainInfo(new DomainInfoPatchProperties() + .withActiveDirectoryInfo(new ActiveDirectoryInfoPatchProperties().withDomainCredentials( + new KeyVaultCredentialsPatchProperties().withUsernameKeyVaultSecretUri("fakeTokenPlaceholder") + .withPasswordKeyVaultSecretUri("fakeTokenPlaceholder")))) + .withSecurityInfo(new SecurityInfoPatchProperties().withType(VirtualMachineSecurityType.TRUSTED_LAUNCH) + .withSecureBootEnabled(true) + .withVTpmEnabled(true)) + .withVmAdminCredentials( + new KeyVaultCredentialsPatchProperties().withUsernameKeyVaultSecretUri("fakeTokenPlaceholder") + .withPasswordKeyVaultSecretUri("fakeTokenPlaceholder")) + .withBootDiagnosticsInfo(new BootDiagnosticsInfoPatchProperties().withEnabled(true) + .withStorageUri("https://myStorageAccountName.blob.core.windows.net")), + com.azure.core.util.Context.NONE); } -} -``` - -### AppAttachPackage_List -```java -/** - * Samples for AppAttachPackage List. - */ -public final class AppAttachPackageListSamples { - /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackage_ListBySubscription.json - */ - /** - * Sample code: AppAttachPackage_ListBySubscription. - * - * @param manager Entry point to DesktopVirtualizationManager. - */ - public static void appAttachPackageListBySubscription( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.appAttachPackages().list("HostPoolName eq 'hostpool1'", 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; } } ``` -### AppAttachPackage_ListByResourceGroup +### AppAttachPackage_CreateOrUpdate ```java /** - * Samples for AppAttachPackage ListByResourceGroup. + * Samples for UserSessions Disconnect. */ -public final class AppAttachPackageListByResourceGroupSamples { +public final class UserSessionsDisconnectSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackage_ListByResourceGroup.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/UserSession_Disconnect_Post.json */ /** - * Sample code: AppAttachPackage_ListByResourceGroup. + * Sample code: UserSession_Disconnect_Post. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void appAttachPackageListByResourceGroup( + public static void userSessionDisconnectPost( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.appAttachPackages() - .listByResourceGroup("resourceGroup1", "HostPoolName eq 'hostpool1'", com.azure.core.util.Context.NONE); + manager.userSessions() + .disconnectWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", + com.azure.core.util.Context.NONE); } } ``` -### AppAttachPackage_Update +### AppAttachPackage_Delete ```java -import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackage; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.UpdateSessionHostsRequestBody; +import java.time.OffsetDateTime; /** - * Samples for AppAttachPackage Update. + * Samples for InitiateSessionHostUpdate Post. */ -public final class AppAttachPackageUpdateSamples { +public final class InitiateSessionHostUpdatePostSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackage_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostManagements_UpdateSessionHosts_Post.json */ /** - * Sample code: AppAttachPackage_Update. + * Sample code: HostPools_Update_Post. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - appAttachPackageUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - AppAttachPackage resource = manager.appAttachPackages() - .getByResourceGroupWithResponse("resourceGroup1", "msixpackagefullname", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().apply(); - } -} -``` - -### AppAttachPackageInfo_ImportMethod - -```java -import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageArchitectures; -import com.azure.resourcemanager.desktopvirtualization.models.ImportPackageInfoRequest; - -/** - * Samples for AppAttachPackageInfo ImportMethod. - */ -public final class AppAttachPackageInfoImportMethodSamples { - /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackageInfo_Import_Post.json - */ - /** - * Sample code: AppAttachPackageInfo_Import. - * - * @param manager Entry point to DesktopVirtualizationManager. - */ - public static void appAttachPackageInfoImport( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.appAttachPackageInfoes() - .importMethod("resourceGroup1", "hostpool1", new ImportPackageInfoRequest().withPath("imagepath") - .withPackageArchitecture(AppAttachPackageArchitectures.X64), com.azure.core.util.Context.NONE); + hostPoolsUpdatePost(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.initiateSessionHostUpdates() + .postWithResponse("resourceGroup1", "hostPool1", + new UpdateSessionHostsRequestBody() + .withScheduledDateTime(OffsetDateTime.parse("2008-09-22T14:01:54.9571247Z")) + .withScheduledDateTimeZone("Alaskan Standard Time") + .withUpdate(new HostPoolUpdateConfigurationPatchProperties().withDeleteOriginalVm(true) + .withMaxVmsRemoved(4) + .withLogOffDelayMinutes(10) + .withLogOffMessage("logging off for hostpool update")), + com.azure.core.util.Context.NONE); } } ``` -### ApplicationGroups_CreateOrUpdate +### AppAttachPackage_GetByResourceGroup ```java import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupType; @@ -368,8 +358,8 @@ import java.util.Map; public final class ApplicationGroupsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ApplicationGroup_Create.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ApplicationGroup_Create.json */ /** * Sample code: ApplicationGroup_Create. @@ -406,138 +396,148 @@ public final class ApplicationGroupsCreateOrUpdateSamples { } ``` -### ApplicationGroups_Delete +### AppAttachPackage_List ```java +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackage; + /** - * Samples for ApplicationGroups Delete. + * Samples for MsixPackages Update. */ -public final class ApplicationGroupsDeleteSamples { +public final class MsixPackagesUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ApplicationGroup_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/MsixPackage_Update.json */ /** - * Sample code: ApplicationGroup_Delete. + * Sample code: MSIXPackage_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - applicationGroupDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.applicationGroups() - .deleteByResourceGroupWithResponse("resourceGroup1", "applicationGroup1", com.azure.core.util.Context.NONE); + mSIXPackageUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + MsixPackage resource = manager.msixPackages() + .getWithResponse("resourceGroup1", "hostpool1", "msixpackagefullname", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withIsActive(true).withIsRegularRegistration(false).withDisplayName("displayname").apply(); } } ``` -### ApplicationGroups_GetByResourceGroup +### AppAttachPackage_ListByResourceGroup ```java /** - * Samples for ApplicationGroups GetByResourceGroup. + * Samples for Applications Delete. */ -public final class ApplicationGroupsGetByResourceGroupSamples { +public final class ApplicationsDeleteSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ApplicationGroup_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Application_Delete.json */ /** - * Sample code: ApplicationGroup_Get. + * Sample code: Application_Delete. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - applicationGroupGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.applicationGroups() - .getByResourceGroupWithResponse("resourceGroup1", "applicationGroup1", com.azure.core.util.Context.NONE); + applicationDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applications() + .deleteWithResponse("resourceGroup1", "applicationGroup1", "application1", + com.azure.core.util.Context.NONE); } } ``` -### ApplicationGroups_List +### AppAttachPackage_Update ```java /** - * Samples for ApplicationGroups List. + * Samples for ScalingPlanPersonalSchedules Get. */ -public final class ApplicationGroupsListSamples { +public final class ScalingPlanPersonalSchedulesGetSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ApplicationGroup_ListBySubscription.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPersonalSchedule_Get.json */ /** - * Sample code: ApplicationGroup_List. + * Sample code: ScalingPlanPersonalSchedules_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - applicationGroupList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.applicationGroups().list("applicationGroupType eq 'RailApplication'", com.azure.core.util.Context.NONE); + public static void scalingPlanPersonalSchedulesGet( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlanPersonalSchedules() + .getWithResponse("resourceGroup1", "PersonalScalingPlan1", "PersonalScalingPlanSchedule", + com.azure.core.util.Context.NONE); } } ``` -### ApplicationGroups_ListByResourceGroup +### AppAttachPackageInfo_ImportMethod ```java +import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolReference; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolType; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingSchedule; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; +import com.azure.resourcemanager.desktopvirtualization.models.Time; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for ApplicationGroups ListByResourceGroup. + * Samples for ScalingPlans Create. */ -public final class ApplicationGroupsListByResourceGroupSamples { +public final class ScalingPlansCreateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ApplicationGroup_ListByResourceGroup.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlan_Create.json */ /** - * Sample code: ApplicationGroup_ListByResourceGroup. - * - * @param manager Entry point to DesktopVirtualizationManager. - */ - public static void applicationGroupListByResourceGroup( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.applicationGroups() - .listByResourceGroup("resourceGroup1", "applicationGroupType eq 'RailApplication'", 10, true, 0, - com.azure.core.util.Context.NONE); - } -} -``` - -### ApplicationGroups_Update - -```java -import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroup; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for ApplicationGroups Update. - */ -public final class ApplicationGroupsUpdateSamples { - /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ApplicationGroup_Update.json - */ - /** - * Sample code: ApplicationGroups_Update. + * Sample code: ScalingPlans_Create. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - applicationGroupsUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - ApplicationGroup resource = manager.applicationGroups() - .getByResourceGroupWithResponse("resourceGroup1", "applicationGroup1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() + scalingPlansCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlans() + .define("scalingPlan1") + .withRegion("centralus") + .withExistingResourceGroup("resourceGroup1") + .withTimeZone("Central Standard Time") .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withDescription("des1") - .withFriendlyName("friendly") - .withShowInFeed(true) - .apply(); + .withDescription("Description of Scaling Plan") + .withFriendlyName("Scaling Plan 1") + .withHostPoolType(ScalingHostPoolType.POOLED) + .withExclusionTag("value") + .withSchedules(Arrays.asList(new ScalingSchedule().withName("schedule1") + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, + DayOfWeek.THURSDAY, DayOfWeek.FRIDAY)) + .withRampUpStartTime(new Time().withHour(6).withMinute(0)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpMinimumHostsPct(20) + .withRampUpCapacityThresholdPct(80) + .withPeakStartTime(new Time().withHour(8).withMinute(0)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownStartTime(new Time().withHour(18).withMinute(0)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownMinimumHostsPct(20) + .withRampDownCapacityThresholdPct(50) + .withRampDownForceLogoffUsers(true) + .withRampDownWaitTimeMinutes(30) + .withRampDownNotificationMessage("message") + .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST))) + .withHostPoolReferences(Arrays.asList(new ScalingHostPoolReference().withHostPoolArmPath( + "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1") + .withScalingPlanEnabled(true))) + .create(); } // Use "Map.of" if available @@ -554,250 +554,212 @@ public final class ApplicationGroupsUpdateSamples { } ``` -### Applications_CreateOrUpdate +### ApplicationGroups_CreateOrUpdate ```java -import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; - -/** - * Samples for Applications CreateOrUpdate. - */ -public final class ApplicationsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Application_Create.json - */ - /** - * Sample code: Application_Create. - * - * @param manager Entry point to DesktopVirtualizationManager. - */ - public static void - applicationCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.applications() - .define("application1") - .withExistingApplicationGroup("resourceGroup1", "applicationGroup1") - .withCommandLineSetting(CommandLineSetting.ALLOW) - .withDescription("des1") - .withFriendlyName("friendly") - .withFilePath("path") - .withCommandLineArguments("arguments") - .withShowInPortal(true) - .withIconPath("icon") - .withIconIndex(1) - .create(); - } -} -``` - -### Applications_Delete +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlan; -```java /** - * Samples for Applications Delete. + * Samples for ScalingPlans Update. */ -public final class ApplicationsDeleteSamples { +public final class ScalingPlansUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Application_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlan_Update.json */ /** - * Sample code: Application_Delete. + * Sample code: ScalingPlans_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - applicationDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.applications() - .deleteWithResponse("resourceGroup1", "applicationGroup1", "application1", - com.azure.core.util.Context.NONE); + scalingPlansUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + ScalingPlan resource = manager.scalingPlans() + .getByResourceGroupWithResponse("resourceGroup1", "scalingPlan1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); } } ``` -### Applications_Get +### ApplicationGroups_Delete ```java /** - * Samples for Applications Get. + * Samples for Workspaces GetByResourceGroup. */ -public final class ApplicationsGetSamples { +public final class WorkspacesGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Application_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Workspace_Get.json */ /** - * Sample code: Application_Get. + * Sample code: Workspace_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - applicationGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.applications() - .getWithResponse("resourceGroup1", "applicationGroup1", "application1", com.azure.core.util.Context.NONE); + workspaceGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.workspaces() + .getByResourceGroupWithResponse("resourceGroup1", "workspace1", com.azure.core.util.Context.NONE); } } ``` -### Applications_List +### ApplicationGroups_GetByResourceGroup ```java /** - * Samples for Applications List. + * Samples for AppAttachPackage ListByResourceGroup. */ -public final class ApplicationsListSamples { +public final class AppAttachPackageListByResourceGroupSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Application_List.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/AppAttachPackage_ListByResourceGroup.json */ /** - * Sample code: Applications_List. + * Sample code: AppAttachPackage_ListByResourceGroup. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - applicationsList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.applications() - .list("resourceGroup1", "applicationGroup1", 10, true, 0, com.azure.core.util.Context.NONE); + public static void appAttachPackageListByResourceGroup( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.appAttachPackages() + .listByResourceGroup("resourceGroup1", "HostPoolName eq 'hostpool1'", com.azure.core.util.Context.NONE); } } ``` -### Applications_Update +### ApplicationGroups_List ```java -import com.azure.resourcemanager.desktopvirtualization.models.Application; -import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; -import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; - /** - * Samples for Applications Update. + * Samples for ApplicationGroups ListByResourceGroup. */ -public final class ApplicationsUpdateSamples { +public final class ApplicationGroupsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Application_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ApplicationGroup_ListByResourceGroup.json */ /** - * Sample code: Application_Update. + * Sample code: ApplicationGroup_ListByResourceGroup. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - applicationUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - Application resource = manager.applications() - .getWithResponse("resourceGroup1", "applicationGroup1", "application1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withDescription("des1") - .withFriendlyName("friendly") - .withFilePath("path") - .withCommandLineSetting(CommandLineSetting.ALLOW) - .withCommandLineArguments("arguments") - .withShowInPortal(true) - .withIconPath("icon") - .withIconIndex(1) - .withApplicationType(RemoteApplicationType.IN_BUILT) - .apply(); + public static void applicationGroupListByResourceGroup( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applicationGroups() + .listByResourceGroup("resourceGroup1", "applicationGroupType eq 'RailApplication'", 10, true, 0, + com.azure.core.util.Context.NONE); } } ``` -### Desktops_Get +### ApplicationGroups_ListByResourceGroup ```java /** - * Samples for Desktops Get. + * Samples for ScalingPlanPersonalSchedules Delete. */ -public final class DesktopsGetSamples { +public final class ScalingPlanPersonalSchedulesDeleteSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Desktop_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPersonalSchedule_Delete.json */ /** - * Sample code: Desktop_Get. + * Sample code: ScalingPlanPersonalSchedules_Delete. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - desktopGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.desktops() - .getWithResponse("resourceGroup1", "applicationGroup1", "SessionDesktop", com.azure.core.util.Context.NONE); + public static void scalingPlanPersonalSchedulesDelete( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlanPersonalSchedules() + .deleteWithResponse("resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", + com.azure.core.util.Context.NONE); } } ``` -### Desktops_List +### ApplicationGroups_Update ```java /** - * Samples for Desktops List. + * Samples for SessionHostOperation RetryProvisioning. */ -public final class DesktopsListSamples { +public final class SessionHostOperationRetryProvisioningSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Desktop_List.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHost_RetryProvisioning_Post.json */ /** - * Sample code: Desktop_List. + * Sample code: SessionHost_RetryProvisioning_Post. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - desktopList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.desktops().list("resourceGroup1", "applicationGroup1", 10, true, 0, com.azure.core.util.Context.NONE); + public static void sessionHostRetryProvisioningPost( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostOperations() + .retryProvisioningWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", + com.azure.core.util.Context.NONE); } } ``` -### Desktops_Update +### Applications_CreateOrUpdate ```java -import com.azure.resourcemanager.desktopvirtualization.models.DesktopPatch; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementPatch; /** - * Samples for Desktops Update. + * Samples for SessionHostManagements Update. */ -public final class DesktopsUpdateSamples { +public final class SessionHostManagementsUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Desktop_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostManagements_Update.json */ /** - * Sample code: Desktop_Update. + * Sample code: SessionHostManagements_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - desktopUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.desktops() - .updateWithResponse("resourceGroup1", "applicationGroup1", "SessionDesktop", - new DesktopPatch().withDescription("des1").withFriendlyName("friendly"), + public static void sessionHostManagementsUpdate( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostManagements() + .updateWithResponse("resourceGroup1", "hostPool1", + new SessionHostManagementPatch().withScheduledDateTimeZone("Alaskan Standard Time") + .withUpdate(new HostPoolUpdateConfigurationPatchProperties().withDeleteOriginalVm(true) + .withMaxVmsRemoved(4) + .withLogOffDelayMinutes(10) + .withLogOffMessage("logging off for hostpool update")), com.azure.core.util.Context.NONE); } } ``` -### HostPools_CreateOrUpdate +### Applications_Delete ```java -import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationInfoInner; -import com.azure.resourcemanager.desktopvirtualization.models.AgentUpdateProperties; +import com.azure.resourcemanager.desktopvirtualization.models.AgentUpdatePatchProperties; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.HostPoolType; +import com.azure.resourcemanager.desktopvirtualization.models.DirectUdp; +import com.azure.resourcemanager.desktopvirtualization.models.HostPool; import com.azure.resourcemanager.desktopvirtualization.models.LoadBalancerType; -import com.azure.resourcemanager.desktopvirtualization.models.MaintenanceWindowProperties; +import com.azure.resourcemanager.desktopvirtualization.models.MaintenanceWindowPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedPrivateUdp; import com.azure.resourcemanager.desktopvirtualization.models.PersonalDesktopAssignmentType; -import com.azure.resourcemanager.desktopvirtualization.models.PreferredAppGroupType; +import com.azure.resourcemanager.desktopvirtualization.models.PublicUdp; +import com.azure.resourcemanager.desktopvirtualization.models.RegistrationInfoPatch; import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenOperation; +import com.azure.resourcemanager.desktopvirtualization.models.RelayUdp; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostComponentUpdateType; import com.azure.resourcemanager.desktopvirtualization.models.SsoSecretType; import java.time.OffsetDateTime; @@ -806,35 +768,33 @@ import java.util.HashMap; import java.util.Map; /** - * Samples for HostPools CreateOrUpdate. + * Samples for HostPools Update. */ -public final class HostPoolsCreateOrUpdateSamples { +public final class HostPoolsUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPool_Create.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/HostPool_Update.json */ /** - * Sample code: HostPool_Create. + * Sample code: HostPool_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - hostPoolCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.hostPools() - .define("hostPool1") - .withRegion("centralus") - .withExistingResourceGroup("resourceGroup1") - .withHostPoolType(HostPoolType.POOLED) - .withLoadBalancerType(LoadBalancerType.BREADTH_FIRST) - .withPreferredAppGroupType(PreferredAppGroupType.DESKTOP) + hostPoolUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + HostPool resource = manager.hostPools() + .getByResourceGroupWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("tag1", "value1", "tag2", "value2")) .withFriendlyName("friendly") .withDescription("des1") - .withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType.AUTOMATIC) .withMaxSessionLimit(999999) + .withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType.AUTOMATIC) + .withLoadBalancerType(LoadBalancerType.BREADTH_FIRST) .withRegistrationInfo( - new RegistrationInfoInner().withExpirationTime(OffsetDateTime.parse("2020-10-01T14:01:54.9571247Z")) + new RegistrationInfoPatch().withExpirationTime(OffsetDateTime.parse("2020-10-01T15:01:54.9571247Z")) .withRegistrationTokenOperation(RegistrationTokenOperation.UPDATE)) .withVmTemplate("{json:json}") .withSsoadfsAuthority("https://adfs") @@ -842,13 +802,18 @@ public final class HostPoolsCreateOrUpdateSamples { .withSsoClientSecretKeyVaultPath("https://keyvault/secret") .withSsoSecretType(SsoSecretType.SHARED_KEY) .withStartVMOnConnect(false) - .withAgentUpdate(new AgentUpdateProperties().withType(SessionHostComponentUpdateType.SCHEDULED) - .withUseSessionHostLocalTime(false) - .withMaintenanceWindowTimeZone("Alaskan Standard Time") - .withMaintenanceWindows( - Arrays.asList(new MaintenanceWindowProperties().withHour(7).withDayOfWeek(DayOfWeek.FRIDAY), - new MaintenanceWindowProperties().withHour(8).withDayOfWeek(DayOfWeek.SATURDAY)))) - .create(); + .withAgentUpdate( + new AgentUpdatePatchProperties().withType(SessionHostComponentUpdateType.SCHEDULED) + .withUseSessionHostLocalTime(false) + .withMaintenanceWindowTimeZone("Alaskan Standard Time") + .withMaintenanceWindows(Arrays.asList( + new MaintenanceWindowPatchProperties().withHour(7).withDayOfWeek(DayOfWeek.FRIDAY), + new MaintenanceWindowPatchProperties().withHour(8).withDayOfWeek(DayOfWeek.SATURDAY)))) + .withManagedPrivateUdp(ManagedPrivateUdp.ENABLED) + .withDirectUdp(DirectUdp.ENABLED) + .withPublicUdp(PublicUdp.ENABLED) + .withRelayUdp(RelayUdp.ENABLED) + .apply(); } // Use "Map.of" if available @@ -865,592 +830,666 @@ public final class HostPoolsCreateOrUpdateSamples { } ``` -### HostPools_Delete +### Applications_Get ```java +import com.azure.resourcemanager.desktopvirtualization.models.Workspace; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for HostPools Delete. + * Samples for Workspaces Update. */ -public final class HostPoolsDeleteSamples { +public final class WorkspacesUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPool_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Workspace_Update.json */ /** - * Sample code: HostPool_Delete. + * Sample code: Workspace_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - hostPoolDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.hostPools().deleteWithResponse("resourceGroup1", "hostPool1", true, com.azure.core.util.Context.NONE); + workspaceUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + Workspace resource = manager.workspaces() + .getByResourceGroupWithResponse("resourceGroup1", "workspace1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withDescription("des1") + .withFriendlyName("friendly") + .apply(); + } + + // 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; } } ``` -### HostPools_GetByResourceGroup +### Applications_List ```java /** - * Samples for HostPools GetByResourceGroup. + * Samples for PrivateEndpointConnections ListByWorkspace. */ -public final class HostPoolsGetByResourceGroupSamples { +public final class PrivateEndpointConnectionsListByWorkspaceSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPool_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/PrivateEndpointConnection_ListByWorkspace.json */ /** - * Sample code: HostPool_Get. + * Sample code: PrivateEndpointConnection_ListByWorkspace. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - hostPoolGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.hostPools() - .getByResourceGroupWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); + public static void privateEndpointConnectionListByWorkspace( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.privateEndpointConnections() + .listByWorkspace("resourceGroup1", "workspace1", com.azure.core.util.Context.NONE); } } ``` -### HostPools_List +### Applications_Update ```java +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageProperties; +import com.azure.resourcemanager.desktopvirtualization.models.FailHealthCheckOnStagingFailure; +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; +import java.time.OffsetDateTime; +import java.util.Arrays; + /** - * Samples for HostPools List. + * Samples for AppAttachPackage CreateOrUpdate. */ -public final class HostPoolsListSamples { +public final class AppAttachPackageCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPool_List.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/AppAttachPackage_Create.json */ /** - * Sample code: HostPool_List. + * Sample code: AppAttachPackage_Create. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - hostPoolList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.hostPools().list(10, true, 0, com.azure.core.util.Context.NONE); + appAttachPackageCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.appAttachPackages() + .define("msixpackagefullname") + .withRegion("southcentralus") + .withExistingResourceGroup("resourceGroup1") + .withProperties(new AppAttachPackageProperties() + .withImage(new AppAttachPackageInfoProperties().withPackageAlias("msixpackagealias") + .withImagePath("imagepath") + .withPackageName("MsixPackageName") + .withPackageFamilyName("MsixPackage_FamilyName") + .withPackageFullName("MsixPackage_FullName") + .withDisplayName("displayname") + .withPackageRelativePath("packagerelativepath") + .withIsRegularRegistration(false) + .withIsActive(false) + .withPackageDependencies( + Arrays.asList(new MsixPackageDependencies().withDependencyName("MsixPackage_Dependency_Name") + .withPublisher("MsixPackage_Dependency_Publisher") + .withMinVersion("packageDep_version"))) + .withVersion("packageversion") + .withLastUpdated(OffsetDateTime.parse("2008-09-22T14:01:54.9571247Z")) + .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("AppId") + .withDescription("PackageApplicationDescription") + .withAppUserModelId("AppUserModelId") + .withFriendlyName("FriendlyName") + .withIconImageName("Iconimagename") + .withRawIcon("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()) + .withRawPng("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()))) + .withCertificateName("certName") + .withCertificateExpiry(OffsetDateTime.parse("2023-01-02T17:18:19.1234567Z"))) + .withHostPoolReferences(Arrays.asList()) + .withKeyVaultUrl("fakeTokenPlaceholder") + .withFailHealthCheckOnStagingFailure(FailHealthCheckOnStagingFailure.NEEDS_ASSISTANCE) + .withPackageOwnerName("App Attach") + .withCustomData("")) + .create(); } } ``` -### HostPools_ListByResourceGroup +### ControlSessionHostUpdate_Post ```java /** - * Samples for HostPools ListByResourceGroup. + * Samples for SessionHostManagements ListByHostPool. */ -public final class HostPoolsListByResourceGroupSamples { +public final class SessionHostManagementsListByHostPoolSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPool_ListByResourceGroup.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostManagements_ListByHostPool.json */ /** - * Sample code: HostPool_ListByResourceGroup. + * Sample code: SessionHostConfigurations_ListByHostPool. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void hostPoolListByResourceGroup( + public static void sessionHostConfigurationsListByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.hostPools().listByResourceGroup("resourceGroup1", 10, true, 0, com.azure.core.util.Context.NONE); + manager.sessionHostManagements() + .listByHostPool("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); } } ``` -### HostPools_ListRegistrationTokens +### Desktops_Get ```java +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostConfigurationInner; +import com.azure.resourcemanager.desktopvirtualization.models.ActiveDirectoryInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.AzureActiveDirectoryInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.BootDiagnosticsInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.CustomInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DiskInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DomainInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DomainJoinType; +import com.azure.resourcemanager.desktopvirtualization.models.ImageInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.KeyVaultCredentialsProperties; +import com.azure.resourcemanager.desktopvirtualization.models.MarketplaceInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.NetworkInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SecurityInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.Type; +import com.azure.resourcemanager.desktopvirtualization.models.VirtualMachineDiskType; +import com.azure.resourcemanager.desktopvirtualization.models.VirtualMachineSecurityType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for HostPools ListRegistrationTokens. + * Samples for SessionHostConfigurations CreateOrUpdate. */ -public final class HostPoolsListRegistrationTokensSamples { +public final class SessionHostConfigurationsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPools_ListRegistrationToken_Post.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostConfigurations_Create.json */ /** - * Sample code: HostPools_ListRegistrationToken_Post. + * Sample code: SessionHostConfigurations_Create. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void hostPoolsListRegistrationTokenPost( + public static void sessionHostConfigurationsCreate( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.hostPools() - .listRegistrationTokensWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); + manager.sessionHostConfigurations() + .createOrUpdate("resourceGroup1", "hostPool1", new SessionHostConfigurationInner() + .withFriendlyName("InitialConfiguration") + .withVmTags(mapOf("Department", "myDepartment", "Team", "myTeam")) + .withVmLocation("eastus2") + .withVmResourceGroup("myResourceGroup") + .withVmNamePrefix("westus2-vm") + .withAvailabilityZones(Arrays.asList(1, 3)) + .withNetworkInfo(new NetworkInfoProperties().withSubnetId( + "/subscriptions/.../resourceGroups/.../providers/Microsoft.Network/virtualNetworks/.../subnets/subnet1") + .withSecurityGroupId( + "/subscriptions/.../resourceGroups/.../provider s/Microsoft.Network/networkSecurityGroups/nsg1")) + .withVmSizeId("Standard_D2s_v3") + .withDiskInfo(new DiskInfoProperties().withType(VirtualMachineDiskType.STANDARD_LRS)) + .withCustomConfigurationScriptUrl("https://storageaccountname.blob.core.windows.net/blobcontainer/file") + .withImageInfo(new ImageInfoProperties().withImageType(Type.MARKETPLACE) + .withMarketplaceInfo(new MarketplaceInfoProperties().withOffer("Windows-10") + .withPublisher("MicrosoftWindowsDesktop") + .withSku("19h2-ent") + .withExactVersion("2019.0.20190115")) + .withCustomInfo(new CustomInfoProperties().withResourceId( + "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.Compute/images/imageName"))) + .withDomainInfo(new DomainInfoProperties().withJoinType(DomainJoinType.ACTIVE_DIRECTORY) + .withActiveDirectoryInfo(new ActiveDirectoryInfoProperties() + .withDomainCredentials( + new KeyVaultCredentialsProperties().withUsernameKeyVaultSecretUri("fakeTokenPlaceholder") + .withPasswordKeyVaultSecretUri("fakeTokenPlaceholder")) + .withOuPath("OU=testOU,DC=domain,DC=Domain,DC=com") + .withDomainName("wvdarmtest1.net")) + .withAzureActiveDirectoryInfo(new AzureActiveDirectoryInfoProperties() + .withMdmProviderGuid("bdefabc0-95b4-48b3-b645-8a753a63c4fa"))) + .withSecurityInfo(new SecurityInfoProperties().withType(VirtualMachineSecurityType.TRUSTED_LAUNCH) + .withSecureBootEnabled(true) + .withVTpmEnabled(true)) + .withVmAdminCredentials( + new KeyVaultCredentialsProperties().withUsernameKeyVaultSecretUri("fakeTokenPlaceholder") + .withPasswordKeyVaultSecretUri("fakeTokenPlaceholder")) + .withBootDiagnosticsInfo(new BootDiagnosticsInfoProperties().withEnabled(true) + .withStorageUri("https://myStorageAccountName.blob.core.windows.net")), + 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; } } ``` -### HostPools_RetrieveRegistrationToken +### Desktops_List ```java /** - * Samples for HostPools RetrieveRegistrationToken. + * Samples for HostPools List. */ -public final class HostPoolsRetrieveRegistrationTokenSamples { +public final class HostPoolsListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPools_RetrieveRegistrationToken_Post.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/HostPool_List.json */ /** - * Sample code: HostPools_RetrieveRegistrationToken_Post. + * Sample code: HostPool_List. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void hostPoolsRetrieveRegistrationTokenPost( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.hostPools() - .retrieveRegistrationTokenWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); + public static void + hostPoolList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.hostPools().list(10, true, 0, com.azure.core.util.Context.NONE); } } ``` -### HostPools_Update +### Desktops_Update ```java -import com.azure.resourcemanager.desktopvirtualization.models.AgentUpdatePatchProperties; -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.HostPool; -import com.azure.resourcemanager.desktopvirtualization.models.LoadBalancerType; -import com.azure.resourcemanager.desktopvirtualization.models.MaintenanceWindowPatchProperties; -import com.azure.resourcemanager.desktopvirtualization.models.PersonalDesktopAssignmentType; -import com.azure.resourcemanager.desktopvirtualization.models.RegistrationInfoPatch; -import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenOperation; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostComponentUpdateType; -import com.azure.resourcemanager.desktopvirtualization.models.SsoSecretType; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for HostPools Update. + * Samples for Workspaces List. */ -public final class HostPoolsUpdateSamples { +public final class WorkspacesListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPool_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Workspace_ListBySubscription.json */ /** - * Sample code: HostPool_Update. + * Sample code: Workspace_ListBySubscription. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - hostPoolUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - HostPool resource = manager.hostPools() - .getByResourceGroupWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withFriendlyName("friendly") - .withDescription("des1") - .withMaxSessionLimit(999999) - .withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType.AUTOMATIC) - .withLoadBalancerType(LoadBalancerType.BREADTH_FIRST) - .withRegistrationInfo( - new RegistrationInfoPatch().withExpirationTime(OffsetDateTime.parse("2020-10-01T15:01:54.9571247Z")) - .withRegistrationTokenOperation(RegistrationTokenOperation.UPDATE)) - .withVmTemplate("{json:json}") - .withSsoadfsAuthority("https://adfs") - .withSsoClientId("client") - .withSsoClientSecretKeyVaultPath("https://keyvault/secret") - .withSsoSecretType(SsoSecretType.SHARED_KEY) - .withStartVMOnConnect(false) - .withAgentUpdate( - new AgentUpdatePatchProperties().withType(SessionHostComponentUpdateType.SCHEDULED) - .withUseSessionHostLocalTime(false) - .withMaintenanceWindowTimeZone("Alaskan Standard Time") - .withMaintenanceWindows(Arrays.asList( - new MaintenanceWindowPatchProperties().withHour(7).withDayOfWeek(DayOfWeek.FRIDAY), - new MaintenanceWindowPatchProperties().withHour(8).withDayOfWeek(DayOfWeek.SATURDAY)))) - .apply(); - } - - // 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; + public static void workspaceListBySubscription( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.workspaces().list(com.azure.core.util.Context.NONE); } } ``` -### MsixImages_Expand +### HostPools_CreateOrUpdate ```java -import com.azure.resourcemanager.desktopvirtualization.models.MsixImageUri; - /** - * Samples for MsixImages Expand. + * Samples for Applications Get. */ -public final class MsixImagesExpandSamples { +public final class ApplicationsGetSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * MsixImage_Expand_Post.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Application_Get.json */ /** - * Sample code: MsixImage_Expand. + * Sample code: Application_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - msixImageExpand(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.msixImages() - .expand("resourceGroup1", "hostpool1", new MsixImageUri().withUri("imagepath"), - com.azure.core.util.Context.NONE); + applicationGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applications() + .getWithResponse("resourceGroup1", "applicationGroup1", "application1", com.azure.core.util.Context.NONE); } } ``` -### MsixPackages_CreateOrUpdate +### HostPools_Delete ```java -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; -import java.time.OffsetDateTime; -import java.util.Arrays; - /** - * Samples for MsixPackages CreateOrUpdate. + * Samples for MsixPackages List. */ -public final class MsixPackagesCreateOrUpdateSamples { +public final class MsixPackagesListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * MsixPackage_Create.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/MsixPackage_List.json */ /** - * Sample code: MSIXPackage_Create. + * Sample code: MSIXPackage_List. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - mSIXPackageCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.msixPackages() - .define("msixpackagefullname") - .withExistingHostPool("resourceGroup1", "hostpool1") - .withImagePath("imagepath") - .withPackageName("MsixPackage_name") - .withPackageFamilyName("MsixPackage_FamilyName") - .withDisplayName("displayname") - .withPackageRelativePath("packagerelativepath") - .withIsRegularRegistration(false) - .withIsActive(false) - .withPackageDependencies( - Arrays.asList(new MsixPackageDependencies().withDependencyName("MsixTest_Dependency_Name") - .withPublisher("PublishedName") - .withMinVersion("version"))) - .withVersion("version") - .withLastUpdated(OffsetDateTime.parse("2008-09-22T14:01:54.9571247Z")) - .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("ApplicationId") - .withDescription("application-desc") - .withAppUserModelId("AppUserModelId") - .withFriendlyName("friendlyname") - .withIconImageName("Apptile") - .withRawIcon("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()) - .withRawPng("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()))) - .create(); + mSIXPackageList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.msixPackages().list("resourceGroup1", "hostpool1", 10, true, 0, com.azure.core.util.Context.NONE); } } ``` -### MsixPackages_Delete +### HostPools_GetByResourceGroup ```java /** - * Samples for MsixPackages Delete. + * Samples for PrivateEndpointConnections ListByHostPool. */ -public final class MsixPackagesDeleteSamples { +public final class PrivateEndpointConnectionsListByHostPoolSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * MsixPackage_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/PrivateEndpointConnection_ListByHostPool.json */ /** - * Sample code: MSIXPackage_Delete. + * Sample code: PrivateEndpointConnection_ListByHostPool. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - mSIXPackageDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.msixPackages() - .deleteWithResponse("resourceGroup1", "hostpool1", "packagefullname", com.azure.core.util.Context.NONE); + public static void privateEndpointConnectionListByHostPool( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.privateEndpointConnections() + .listByHostPool("resourceGroup1", "hostPool1", null, null, null, com.azure.core.util.Context.NONE); } } ``` -### MsixPackages_Get +### HostPools_List ```java +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageArchitectures; +import com.azure.resourcemanager.desktopvirtualization.models.ImportPackageInfoRequest; + /** - * Samples for MsixPackages Get. + * Samples for AppAttachPackageInfo ImportMethod. */ -public final class MsixPackagesGetSamples { +public final class AppAttachPackageInfoImportMethodSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * MsixPackage_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/AppAttachPackageInfo_Import_Post.json */ /** - * Sample code: MSIXPackage_Get. + * Sample code: AppAttachPackageInfo_Import. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - mSIXPackageGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.msixPackages() - .getWithResponse("resourceGroup1", "hostpool1", "packagefullname", com.azure.core.util.Context.NONE); + public static void appAttachPackageInfoImport( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.appAttachPackageInfoes() + .importMethod("resourceGroup1", "hostpool1", new ImportPackageInfoRequest().withPath("imagepath") + .withPackageArchitecture(AppAttachPackageArchitectures.X64), com.azure.core.util.Context.NONE); } } ``` -### MsixPackages_List +### HostPools_ListByResourceGroup ```java /** - * Samples for MsixPackages List. + * Samples for Desktops Get. */ -public final class MsixPackagesListSamples { +public final class DesktopsGetSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * MsixPackage_List.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Desktop_Get.json */ /** - * Sample code: MSIXPackage_List. + * Sample code: Desktop_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - mSIXPackageList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.msixPackages().list("resourceGroup1", "hostpool1", 10, true, 0, com.azure.core.util.Context.NONE); + desktopGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.desktops() + .getWithResponse("resourceGroup1", "applicationGroup1", "SessionDesktop", com.azure.core.util.Context.NONE); } } ``` -### MsixPackages_Update +### HostPools_ListRegistrationTokens ```java -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackage; - /** - * Samples for MsixPackages Update. + * Samples for HostPools GetByResourceGroup. */ -public final class MsixPackagesUpdateSamples { +public final class HostPoolsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * MsixPackage_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/HostPool_Get.json */ /** - * Sample code: MSIXPackage_Update. + * Sample code: HostPool_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - mSIXPackageUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - MsixPackage resource = manager.msixPackages() - .getWithResponse("resourceGroup1", "hostpool1", "msixpackagefullname", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withIsActive(true).withIsRegularRegistration(false).withDisplayName("displayname").apply(); + hostPoolGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.hostPools() + .getByResourceGroupWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); } } ``` -### Operations_List +### HostPools_RetrieveRegistrationToken ```java /** - * Samples for Operations List. + * Samples for PrivateEndpointConnections DeleteByHostPool. */ -public final class OperationsListSamples { +public final class PrivateEndpointConnectionsDeleteByHostPoolSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * OperationDescription_List.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/PrivateEndpointConnection_DeleteByHostPool.json */ /** - * Sample code: OperationDescription_List. + * Sample code: PrivateEndpointConnection_DeleteByHostPool. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - operationDescriptionList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + public static void privateEndpointConnectionDeleteByHostPool( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.privateEndpointConnections() + .deleteByHostPoolWithResponse("resourceGroup1", "hostPool1", + "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_DeleteByHostPool +### HostPools_Update ```java +import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroup; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for PrivateEndpointConnections DeleteByHostPool. + * Samples for ApplicationGroups Update. */ -public final class PrivateEndpointConnectionsDeleteByHostPoolSamples { +public final class ApplicationGroupsUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_DeleteByHostPool.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ApplicationGroup_Update.json */ /** - * Sample code: PrivateEndpointConnection_DeleteByHostPool. + * Sample code: ApplicationGroups_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionDeleteByHostPool( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.privateEndpointConnections() - .deleteByHostPoolWithResponse("resourceGroup1", "hostPool1", - "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", com.azure.core.util.Context.NONE); + public static void + applicationGroupsUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + ApplicationGroup resource = manager.applicationGroups() + .getByResourceGroupWithResponse("resourceGroup1", "applicationGroup1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withDescription("des1") + .withFriendlyName("friendly") + .withShowInFeed(true) + .apply(); + } + + // 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; } } ``` -### PrivateEndpointConnections_DeleteByWorkspace +### InitiateSessionHostUpdate_Post ```java /** - * Samples for PrivateEndpointConnections DeleteByWorkspace. + * Samples for SessionHosts Get. */ -public final class PrivateEndpointConnectionsDeleteByWorkspaceSamples { +public final class SessionHostsGetSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_DeleteByWorkspace.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHost_Get.json */ /** - * Sample code: PrivateEndpointConnection_DeleteByWorkspace. + * Sample code: SessionHost_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionDeleteByWorkspace( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.privateEndpointConnections() - .deleteByWorkspaceWithResponse("resourceGroup1", "workspace1", - "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", com.azure.core.util.Context.NONE); + public static void + sessionHostGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHosts() + .getWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", + com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_GetByHostPool +### MsixImages_Expand ```java /** - * Samples for PrivateEndpointConnections GetByHostPool. + * Samples for AppAttachPackage Delete. */ -public final class PrivateEndpointConnectionsGetByHostPoolSamples { +public final class AppAttachPackageDeleteSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_GetByHostPool.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/AppAttachPackage_Delete.json */ /** - * Sample code: PrivateEndpointConnection_GetByHostPool. + * Sample code: AppAttachPackage_Delete. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionGetByHostPool( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.privateEndpointConnections() - .getByHostPoolWithResponse("resourceGroup1", "hostPool1", "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", - com.azure.core.util.Context.NONE); + public static void + appAttachPackageDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.appAttachPackages() + .deleteWithResponse("resourceGroup1", "packagefullname", null, com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_GetByWorkspace +### MsixPackages_CreateOrUpdate ```java /** - * Samples for PrivateEndpointConnections GetByWorkspace. + * Samples for PrivateEndpointConnections DeleteByWorkspace. */ -public final class PrivateEndpointConnectionsGetByWorkspaceSamples { +public final class PrivateEndpointConnectionsDeleteByWorkspaceSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_GetByWorkspace.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/PrivateEndpointConnection_DeleteByWorkspace.json */ /** - * Sample code: PrivateEndpointConnection_GetByWorkspace. + * Sample code: PrivateEndpointConnection_DeleteByWorkspace. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionGetByWorkspace( + public static void privateEndpointConnectionDeleteByWorkspace( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.privateEndpointConnections() - .getByWorkspaceWithResponse("resourceGroup1", "workspace1", + .deleteByWorkspaceWithResponse("resourceGroup1", "workspace1", "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_ListByHostPool +### MsixPackages_Delete ```java /** - * Samples for PrivateEndpointConnections ListByHostPool. + * Samples for Workspaces ListByResourceGroup. */ -public final class PrivateEndpointConnectionsListByHostPoolSamples { +public final class WorkspacesListByResourceGroupSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_ListByHostPool.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Workspace_ListByResourceGroup.json */ /** - * Sample code: PrivateEndpointConnection_ListByHostPool. + * Sample code: Workspace_ListByResourceGroup. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionListByHostPool( + public static void workspaceListByResourceGroup( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.privateEndpointConnections() - .listByHostPool("resourceGroup1", "hostPool1", null, null, null, com.azure.core.util.Context.NONE); + manager.workspaces().listByResourceGroup("resourceGroup1", 10, true, 0, com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_ListByWorkspace +### MsixPackages_Get ```java /** - * Samples for PrivateEndpointConnections ListByWorkspace. + * Samples for Workspaces Delete. */ -public final class PrivateEndpointConnectionsListByWorkspaceSamples { +public final class WorkspacesDeleteSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_ListByWorkspace.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Workspace_Delete.json */ /** - * Sample code: PrivateEndpointConnection_ListByWorkspace. + * Sample code: Workspace_Delete. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionListByWorkspace( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.privateEndpointConnections() - .listByWorkspace("resourceGroup1", "workspace1", com.azure.core.util.Context.NONE); + public static void + workspaceDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.workspaces() + .deleteByResourceGroupWithResponse("resourceGroup1", "workspace1", com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_UpdateByHostPool +### MsixPackages_List ```java import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; @@ -1458,24 +1497,24 @@ import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointSer import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; /** - * Samples for PrivateEndpointConnections UpdateByHostPool. + * Samples for PrivateEndpointConnections UpdateByWorkspace. */ -public final class PrivateEndpointConnectionsUpdateByHostPoolSamples { +public final class PrivateEndpointConnectionsUpdateByWorkspaceSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_UpdateByHostPool.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/PrivateEndpointConnection_UpdateByWorkspace.json */ /** - * Sample code: PrivateEndpointConnection_UpdateByHostPool. + * Sample code: PrivateEndpointConnection_UpdateByWorkspace. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionUpdateByHostPool( + public static void privateEndpointConnectionUpdateByWorkspace( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.privateEndpointConnections() - .updateByHostPoolWithResponse("resourceGroup1", "hostPool1", - "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", + .updateByWorkspaceWithResponse("resourceGroup1", "workspace1", + "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", new PrivateEndpointConnection().withPrivateLinkServiceConnectionState( new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) .withDescription("Approved by admin@consoto.com") @@ -1485,7 +1524,7 @@ public final class PrivateEndpointConnectionsUpdateByHostPoolSamples { } ``` -### PrivateEndpointConnections_UpdateByWorkspace +### MsixPackages_Update ```java import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; @@ -1493,24 +1532,24 @@ import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointSer import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; /** - * Samples for PrivateEndpointConnections UpdateByWorkspace. + * Samples for PrivateEndpointConnections UpdateByHostPool. */ -public final class PrivateEndpointConnectionsUpdateByWorkspaceSamples { +public final class PrivateEndpointConnectionsUpdateByHostPoolSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_UpdateByWorkspace.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/PrivateEndpointConnection_UpdateByHostPool.json */ /** - * Sample code: PrivateEndpointConnection_UpdateByWorkspace. + * Sample code: PrivateEndpointConnection_UpdateByHostPool. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionUpdateByWorkspace( + public static void privateEndpointConnectionUpdateByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.privateEndpointConnections() - .updateByWorkspaceWithResponse("resourceGroup1", "workspace1", - "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", + .updateByHostPoolWithResponse("resourceGroup1", "hostPool1", + "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", new PrivateEndpointConnection().withPrivateLinkServiceConnectionState( new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) .withDescription("Approved by admin@consoto.com") @@ -1520,32 +1559,32 @@ public final class PrivateEndpointConnectionsUpdateByWorkspaceSamples { } ``` -### PrivateLinkResources_ListByHostPool +### Operations_List ```java /** - * Samples for PrivateLinkResources ListByHostPool. + * Samples for HostPools RetrieveRegistrationToken. */ -public final class PrivateLinkResourcesListByHostPoolSamples { +public final class HostPoolsRetrieveRegistrationTokenSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateLinkResources_ListByHostPool.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/HostPools_RetrieveRegistrationToken_Post.json */ /** - * Sample code: PrivateLinkResources_ListByHostPool. + * Sample code: HostPools_RetrieveRegistrationToken_Post. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateLinkResourcesListByHostPool( + public static void hostPoolsRetrieveRegistrationTokenPost( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.privateLinkResources() - .listByHostPool("resourceGroup1", "hostPool1", null, null, null, com.azure.core.util.Context.NONE); + manager.hostPools() + .retrieveRegistrationTokenWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); } } ``` -### PrivateLinkResources_ListByWorkspace +### PrivateEndpointConnections_DeleteByHostPool ```java /** @@ -1554,8 +1593,8 @@ public final class PrivateLinkResourcesListByHostPoolSamples { public final class PrivateLinkResourcesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateLinkResources_ListByWorkspace.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/PrivateLinkResources_ListByWorkspace.json */ /** * Sample code: PrivateLinkResources_ListByWorkspace. @@ -1570,615 +1609,1173 @@ public final class PrivateLinkResourcesListByWorkspaceSamples { } ``` -### ScalingPlanPersonalSchedules_Create +### PrivateEndpointConnections_DeleteByWorkspace ```java -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; -import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; -import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; -import com.azure.resourcemanager.desktopvirtualization.models.Time; -import java.util.Arrays; - /** - * Samples for ScalingPlanPersonalSchedules Create. + * Samples for SessionHosts List. */ -public final class ScalingPlanPersonalSchedulesCreateSamples { +public final class SessionHostsListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPersonalSchedule_Create.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHost_List.json */ /** - * Sample code: ScalingPlanPersonalSchedules_Create. + * Sample code: SessionHost_List. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlanPersonalSchedulesCreate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.scalingPlanPersonalSchedules() - .define("scalingPlanScheduleWeekdays1") - .withExistingScalingPlan("resourceGroup1", "scalingPlan1") - .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, - DayOfWeek.FRIDAY)) - .withRampUpStartTime(new Time().withHour(6).withMinute(0)) - .withRampUpAutoStartHosts(StartupBehavior.ALL) - .withRampUpStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withRampUpActionOnDisconnect(SessionHandlingOperation.NONE) - .withRampUpMinutesToWaitOnDisconnect(10) - .withRampUpActionOnLogoff(SessionHandlingOperation.NONE) - .withRampUpMinutesToWaitOnLogoff(10) - .withPeakStartTime(new Time().withHour(8).withMinute(0)) - .withPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withPeakMinutesToWaitOnDisconnect(10) - .withPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withPeakMinutesToWaitOnLogoff(10) - .withRampDownStartTime(new Time().withHour(18).withMinute(0)) - .withRampDownStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withRampDownActionOnDisconnect(SessionHandlingOperation.NONE) - .withRampDownMinutesToWaitOnDisconnect(10) - .withRampDownActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withRampDownMinutesToWaitOnLogoff(10) - .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) - .withOffPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withOffPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withOffPeakMinutesToWaitOnDisconnect(10) - .withOffPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withOffPeakMinutesToWaitOnLogoff(10) - .create(); + public static void + sessionHostList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHosts().list("resourceGroup1", "hostPool1", 10, true, 0, null, com.azure.core.util.Context.NONE); } } ``` -### ScalingPlanPersonalSchedules_Delete +### PrivateEndpointConnections_GetByHostPool ```java /** - * Samples for ScalingPlanPersonalSchedules Delete. + * Samples for ScalingPlans ListByResourceGroup. */ -public final class ScalingPlanPersonalSchedulesDeleteSamples { +public final class ScalingPlansListByResourceGroupSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPersonalSchedule_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlan_ListByResourceGroup.json */ /** - * Sample code: ScalingPlanPersonalSchedules_Delete. + * Sample code: ScalingPlans_ListByResourceGroup. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlanPersonalSchedulesDelete( + public static void scalingPlansListByResourceGroup( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.scalingPlanPersonalSchedules() - .deleteWithResponse("resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", - com.azure.core.util.Context.NONE); + manager.scalingPlans().listByResourceGroup("resourceGroup1", 10, true, 0, com.azure.core.util.Context.NONE); } } ``` -### ScalingPlanPersonalSchedules_Get +### PrivateEndpointConnections_GetByWorkspace ```java /** - * Samples for ScalingPlanPersonalSchedules Get. + * Samples for Desktops List. */ -public final class ScalingPlanPersonalSchedulesGetSamples { +public final class DesktopsListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPersonalSchedule_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Desktop_List.json */ /** - * Sample code: ScalingPlanPersonalSchedules_Get. + * Sample code: Desktop_List. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlanPersonalSchedulesGet( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.scalingPlanPersonalSchedules() - .getWithResponse("resourceGroup1", "PersonalScalingPlan1", "PersonalScalingPlanSchedule", - com.azure.core.util.Context.NONE); + public static void + desktopList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.desktops().list("resourceGroup1", "applicationGroup1", 10, true, 0, com.azure.core.util.Context.NONE); } } ``` -### ScalingPlanPersonalSchedules_List +### PrivateEndpointConnections_ListByHostPool ```java /** - * Samples for ScalingPlanPersonalSchedules List. + * Samples for Operations List. */ -public final class ScalingPlanPersonalSchedulesListSamples { +public final class OperationsListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPersonalSchedule_List.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/OperationDescription_List.json */ /** - * Sample code: ScalingPlanPersonalSchedules_List. + * Sample code: OperationDescription_List. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlanPersonalSchedulesList( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.scalingPlanPersonalSchedules() - .list("resourceGroup1", "scalingPlan", 10, true, 0, com.azure.core.util.Context.NONE); + public static void + operationDescriptionList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` -### ScalingPlanPersonalSchedules_Update +### PrivateEndpointConnections_ListByWorkspace ```java -import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedule; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; -import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; -import com.azure.resourcemanager.desktopvirtualization.models.Time; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateAction; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateControlParameter; /** - * Samples for ScalingPlanPersonalSchedules Update. + * Samples for ControlSessionHostUpdate Post. */ -public final class ScalingPlanPersonalSchedulesUpdateSamples { +public final class ControlSessionHostUpdatePostSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPersonalSchedule_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostManagements_ControlSessionHostUpdate_Post.json */ /** - * Sample code: ScalingPlanPersonalSchedules_Update. + * Sample code: SessionHostManagements_ControlUpdate_Post. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlanPersonalSchedulesUpdate( + public static void sessionHostManagementsControlUpdatePost( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - ScalingPlanPersonalSchedule resource = manager.scalingPlanPersonalSchedules() - .getWithResponse("resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withPeakStartTime(new Time().withHour(8).withMinute(0)) - .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withPeakMinutesToWaitOnDisconnect(10) - .withPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withPeakMinutesToWaitOnLogoff(10) - .withRampDownStartTime(new Time().withHour(18).withMinute(0)) - .withRampDownActionOnDisconnect(SessionHandlingOperation.NONE) - .withRampDownMinutesToWaitOnDisconnect(10) - .withRampDownActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withRampDownMinutesToWaitOnLogoff(10) - .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) - .withOffPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withOffPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withOffPeakMinutesToWaitOnDisconnect(10) - .withOffPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withOffPeakMinutesToWaitOnLogoff(10) - .apply(); + manager.controlSessionHostUpdates() + .post("resourceGroup1", "hostPool1", + new HostPoolUpdateControlParameter().withAction(HostPoolUpdateAction.START) + .withCancelMessage("Host pool update started"), + com.azure.core.util.Context.NONE); } } ``` -### ScalingPlanPooledSchedules_Create +### PrivateEndpointConnections_UpdateByHostPool ```java +import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationInfoInner; +import com.azure.resourcemanager.desktopvirtualization.models.AgentUpdateProperties; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; -import com.azure.resourcemanager.desktopvirtualization.models.Time; +import com.azure.resourcemanager.desktopvirtualization.models.DirectUdp; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolType; +import com.azure.resourcemanager.desktopvirtualization.models.LoadBalancerType; +import com.azure.resourcemanager.desktopvirtualization.models.MaintenanceWindowProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedPrivateUdp; +import com.azure.resourcemanager.desktopvirtualization.models.ManagementType; +import com.azure.resourcemanager.desktopvirtualization.models.PersonalDesktopAssignmentType; +import com.azure.resourcemanager.desktopvirtualization.models.PreferredAppGroupType; +import com.azure.resourcemanager.desktopvirtualization.models.PublicUdp; +import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenOperation; +import com.azure.resourcemanager.desktopvirtualization.models.RelayUdp; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostComponentUpdateType; +import com.azure.resourcemanager.desktopvirtualization.models.SsoSecretType; +import java.time.OffsetDateTime; import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; /** - * Samples for ScalingPlanPooledSchedules Create. + * Samples for HostPools CreateOrUpdate. */ -public final class ScalingPlanPooledSchedulesCreateSamples { +public final class HostPoolsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPooledSchedule_Create.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/HostPool_Create.json */ /** - * Sample code: ScalingPlanPooledSchedules_Create. + * Sample code: HostPool_Create. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlanPooledSchedulesCreate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.scalingPlanPooledSchedules() - .define("scalingPlanScheduleWeekdays1") - .withExistingScalingPlan("resourceGroup1", "scalingPlan1") - .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, - DayOfWeek.FRIDAY)) - .withRampUpStartTime(new Time().withHour(6).withMinute(0)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(20) - .withRampUpCapacityThresholdPct(80) - .withPeakStartTime(new Time().withHour(8).withMinute(0)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(18).withMinute(0)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(20) - .withRampDownCapacityThresholdPct(50) - .withRampDownForceLogoffUsers(true) - .withRampDownWaitTimeMinutes(30) - .withRampDownNotificationMessage("message") - .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + public static void + hostPoolCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.hostPools() + .define("hostPool1") + .withRegion("centralus") + .withExistingResourceGroup("resourceGroup1") + .withHostPoolType(HostPoolType.POOLED) + .withLoadBalancerType(LoadBalancerType.BREADTH_FIRST) + .withPreferredAppGroupType(PreferredAppGroupType.DESKTOP) + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withFriendlyName("friendly") + .withDescription("des1") + .withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType.AUTOMATIC) + .withMaxSessionLimit(999999) + .withRegistrationInfo( + new RegistrationInfoInner().withExpirationTime(OffsetDateTime.parse("2020-10-01T14:01:54.9571247Z")) + .withRegistrationTokenOperation(RegistrationTokenOperation.UPDATE)) + .withVmTemplate("{json:json}") + .withManagementType(ManagementType.AUTOMATED) + .withSsoadfsAuthority("https://adfs") + .withSsoClientId("client") + .withSsoClientSecretKeyVaultPath("https://keyvault/secret") + .withSsoSecretType(SsoSecretType.SHARED_KEY) + .withStartVMOnConnect(false) + .withAgentUpdate(new AgentUpdateProperties().withType(SessionHostComponentUpdateType.SCHEDULED) + .withUseSessionHostLocalTime(false) + .withMaintenanceWindowTimeZone("Alaskan Standard Time") + .withMaintenanceWindows( + Arrays.asList(new MaintenanceWindowProperties().withHour(7).withDayOfWeek(DayOfWeek.FRIDAY), + new MaintenanceWindowProperties().withHour(8).withDayOfWeek(DayOfWeek.SATURDAY)))) + .withManagedPrivateUdp(ManagedPrivateUdp.ENABLED) + .withDirectUdp(DirectUdp.ENABLED) + .withPublicUdp(PublicUdp.ENABLED) + .withRelayUdp(RelayUdp.ENABLED) .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; + } } ``` -### ScalingPlanPooledSchedules_Delete +### PrivateEndpointConnections_UpdateByWorkspace ```java /** - * Samples for ScalingPlanPooledSchedules Delete. + * Samples for PrivateEndpointConnections GetByHostPool. */ -public final class ScalingPlanPooledSchedulesDeleteSamples { +public final class PrivateEndpointConnectionsGetByHostPoolSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPooledSchedule_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/PrivateEndpointConnection_GetByHostPool.json */ /** - * Sample code: ScalingPlanPooledSchedules_Delete. + * Sample code: PrivateEndpointConnection_GetByHostPool. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlanPooledSchedulesDelete( + public static void privateEndpointConnectionGetByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.scalingPlanPooledSchedules() - .deleteWithResponse("resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", + manager.privateEndpointConnections() + .getByHostPoolWithResponse("resourceGroup1", "hostPool1", "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", com.azure.core.util.Context.NONE); } } ``` -### ScalingPlanPooledSchedules_Get +### PrivateLinkResources_ListByHostPool ```java +import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedule; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; +import com.azure.resourcemanager.desktopvirtualization.models.Time; +import java.util.Arrays; + /** - * Samples for ScalingPlanPooledSchedules Get. + * Samples for ScalingPlanPooledSchedules Update. */ -public final class ScalingPlanPooledSchedulesGetSamples { +public final class ScalingPlanPooledSchedulesUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPooledSchedule_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPooledSchedule_Update.json */ /** - * Sample code: ScalingPlanPooledSchedules_Get. + * Sample code: ScalingPlanPooledSchedules_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlanPooledSchedulesGet( + public static void scalingPlanPooledSchedulesUpdate( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.scalingPlanPooledSchedules() + ScalingPlanPooledSchedule resource = manager.scalingPlanPooledSchedules() .getWithResponse("resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", - com.azure.core.util.Context.NONE); + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, + DayOfWeek.FRIDAY)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpCapacityThresholdPct(80) + .withPeakStartTime(new Time().withHour(8).withMinute(0)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownMinimumHostsPct(20) + .withRampDownWaitTimeMinutes(30) + .apply(); } } ``` -### ScalingPlanPooledSchedules_List +### PrivateLinkResources_ListByWorkspace ```java /** - * Samples for ScalingPlanPooledSchedules List. + * Samples for SessionHostManagements Get. */ -public final class ScalingPlanPooledSchedulesListSamples { +public final class SessionHostManagementsGetSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPooledSchedule_List.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostManagements_Get.json */ /** - * Sample code: ScalingPlanPooledSchedules_List. + * Sample code: SessionHostManagements_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlanPooledSchedulesList( + public static void sessionHostManagementsGet( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.scalingPlanPooledSchedules() - .list("resourceGroup1", "scalingPlan1", 10, true, 0, com.azure.core.util.Context.NONE); + manager.sessionHostManagements() + .getWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); } } ``` -### ScalingPlanPooledSchedules_Update +### ScalingPlanPersonalSchedules_Create ```java -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedule; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; -import com.azure.resourcemanager.desktopvirtualization.models.Time; -import java.util.Arrays; - /** - * Samples for ScalingPlanPooledSchedules Update. + * Samples for ApplicationGroups Delete. */ -public final class ScalingPlanPooledSchedulesUpdateSamples { +public final class ApplicationGroupsDeleteSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPooledSchedule_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ApplicationGroup_Delete.json */ /** - * Sample code: ScalingPlanPooledSchedules_Update. + * Sample code: ApplicationGroup_Delete. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlanPooledSchedulesUpdate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - ScalingPlanPooledSchedule resource = manager.scalingPlanPooledSchedules() - .getWithResponse("resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, - DayOfWeek.FRIDAY)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpCapacityThresholdPct(80) - .withPeakStartTime(new Time().withHour(8).withMinute(0)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(20) - .withRampDownWaitTimeMinutes(30) - .apply(); + public static void + applicationGroupDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applicationGroups() + .deleteByResourceGroupWithResponse("resourceGroup1", "applicationGroup1", com.azure.core.util.Context.NONE); } } ``` -### ScalingPlans_Create +### ScalingPlanPersonalSchedules_Delete ```java -import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolReference; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolType; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingSchedule; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingScheduleDaysOfWeekItem; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; -import com.azure.resourcemanager.desktopvirtualization.models.Time; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackage; /** - * Samples for ScalingPlans Create. + * Samples for AppAttachPackage Update. */ -public final class ScalingPlansCreateSamples { +public final class AppAttachPackageUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_Create.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/AppAttachPackage_Update.json */ /** - * Sample code: ScalingPlans_Create. + * Sample code: AppAttachPackage_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - scalingPlansCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.scalingPlans() - .define("scalingPlan1") - .withRegion("centralus") - .withExistingResourceGroup("resourceGroup1") - .withTimeZone("Central Standard Time") - .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withDescription("Description of Scaling Plan") - .withFriendlyName("Scaling Plan 1") - .withHostPoolType(ScalingHostPoolType.POOLED) - .withExclusionTag("value") - .withSchedules(Arrays.asList(new ScalingSchedule().withName("schedule1") - .withDaysOfWeek(Arrays.asList(ScalingScheduleDaysOfWeekItem.MONDAY, - ScalingScheduleDaysOfWeekItem.TUESDAY, ScalingScheduleDaysOfWeekItem.WEDNESDAY, - ScalingScheduleDaysOfWeekItem.THURSDAY, ScalingScheduleDaysOfWeekItem.FRIDAY)) - .withRampUpStartTime(new Time().withHour(6).withMinute(0)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(20) - .withRampUpCapacityThresholdPct(80) - .withPeakStartTime(new Time().withHour(8).withMinute(0)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(18).withMinute(0)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(20) - .withRampDownCapacityThresholdPct(50) - .withRampDownForceLogoffUsers(true) - .withRampDownWaitTimeMinutes(30) - .withRampDownNotificationMessage("message") - .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST))) - .withHostPoolReferences(Arrays.asList(new ScalingHostPoolReference().withHostPoolArmPath( - "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1") - .withScalingPlanEnabled(true))) - .create(); + appAttachPackageUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + AppAttachPackage resource = manager.appAttachPackages() + .getByResourceGroupWithResponse("resourceGroup1", "msixpackagefullname", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); } +} +``` - // 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; +### ScalingPlanPersonalSchedules_Get + +```java +/** + * Samples for PrivateLinkResources ListByHostPool. + */ +public final class PrivateLinkResourcesListByHostPoolSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/PrivateLinkResources_ListByHostPool.json + */ + /** + * Sample code: PrivateLinkResources_ListByHostPool. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void privateLinkResourcesListByHostPool( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.privateLinkResources() + .listByHostPool("resourceGroup1", "hostPool1", null, null, null, com.azure.core.util.Context.NONE); } } ``` -### ScalingPlans_Delete +### ScalingPlanPersonalSchedules_List ```java /** - * Samples for ScalingPlans Delete. + * Samples for ScalingPlanPooledSchedules Get. */ -public final class ScalingPlansDeleteSamples { +public final class ScalingPlanPooledSchedulesGetSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPooledSchedule_Get.json */ /** - * Sample code: ScalingPlans_Delete. + * Sample code: ScalingPlanPooledSchedules_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - scalingPlansDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.scalingPlans() - .deleteByResourceGroupWithResponse("resourceGroup1", "scalingPlan1", com.azure.core.util.Context.NONE); + public static void scalingPlanPooledSchedulesGet( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlanPooledSchedules() + .getWithResponse("resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", + com.azure.core.util.Context.NONE); } } ``` -### ScalingPlans_GetByResourceGroup +### ScalingPlanPersonalSchedules_Update ```java /** - * Samples for ScalingPlans GetByResourceGroup. + * Samples for UserSessions Delete. */ -public final class ScalingPlansGetByResourceGroupSamples { +public final class UserSessionsDeleteSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/UserSession_Delete.json */ /** - * Sample code: ScalingPlans_Get. + * Sample code: UserSession_Delete. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - scalingPlansGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.scalingPlans() - .getByResourceGroupWithResponse("resourceGroup1", "scalingPlan1", com.azure.core.util.Context.NONE); + userSessionDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.userSessions() + .deleteWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", true, + com.azure.core.util.Context.NONE); } } ``` -### ScalingPlans_List +### ScalingPlanPooledSchedules_Create ```java /** - * Samples for ScalingPlans List. + * Samples for ActiveSessionHostConfigurations ListByHostPool. */ -public final class ScalingPlansListSamples { +public final class ActiveSessionHostConfigurationsListByHostPoolSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_ListBySubscription.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ActiveSessionHostConfigurations_ListByHostPool.json */ /** - * Sample code: ScalingPlans_ListBySubscription. + * Sample code: SessionHostConfigurations_ListByHostPool. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlansListBySubscription( + public static void sessionHostConfigurationsListByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.scalingPlans().list(10, true, 0, com.azure.core.util.Context.NONE); + manager.activeSessionHostConfigurations() + .listByHostPool("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); } } ``` -### ScalingPlans_ListByHostPool +### ScalingPlanPooledSchedules_Delete ```java +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatch; + /** - * Samples for ScalingPlans ListByHostPool. + * Samples for SessionHosts Update. */ -public final class ScalingPlansListByHostPoolSamples { +public final class SessionHostsUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_ListByHostPool.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHost_Update.json */ /** - * Sample code: ScalingPlan_ListByHostPool. + * Sample code: SessionHost_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlanListByHostPool( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.scalingPlans() - .listByHostPool("resourceGroup1", "hostPool1", 10, true, 0, com.azure.core.util.Context.NONE); + public static void + sessionHostUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHosts() + .updateWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", true, + new SessionHostPatch().withAllowNewSession(true) + .withAssignedUser("user1@microsoft.com") + .withFriendlyName("friendly"), + com.azure.core.util.Context.NONE); } } ``` -### ScalingPlans_ListByResourceGroup +### ScalingPlanPooledSchedules_Get ```java /** - * Samples for ScalingPlans ListByResourceGroup. + * Samples for ActiveSessionHostConfigurations Get. */ -public final class ScalingPlansListByResourceGroupSamples { +public final class ActiveSessionHostConfigurationsGetSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_ListByResourceGroup.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ActiveSessionHostConfigurations_Get.json */ /** - * Sample code: ScalingPlans_ListByResourceGroup. + * Sample code: SessionHostConfigurations_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlansListByResourceGroup( + public static void sessionHostConfigurationsGet( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.scalingPlans().listByResourceGroup("resourceGroup1", 10, true, 0, com.azure.core.util.Context.NONE); + manager.activeSessionHostConfigurations() + .getWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); } } ``` -### ScalingPlans_Update +### ScalingPlanPooledSchedules_List ```java -import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlan; - /** - * Samples for ScalingPlans Update. + * Samples for Applications List. */ -public final class ScalingPlansUpdateSamples { +public final class ApplicationsListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Application_List.json */ /** - * Sample code: ScalingPlans_Update. + * Sample code: Applications_List. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - scalingPlansUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - ScalingPlan resource = manager.scalingPlans() - .getByResourceGroupWithResponse("resourceGroup1", "scalingPlan1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().apply(); + applicationsList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applications() + .list("resourceGroup1", "applicationGroup1", 10, true, 0, com.azure.core.util.Context.NONE); } } ``` -### SessionHosts_Delete +### ScalingPlanPooledSchedules_Update ```java /** - * Samples for SessionHosts Delete. + * Samples for ScalingPlanPersonalSchedules List. */ -public final class SessionHostsDeleteSamples { +public final class ScalingPlanPersonalSchedulesListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * SessionHost_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPersonalSchedule_List.json */ /** - * Sample code: SessionHost_Delete. + * Sample code: ScalingPlanPersonalSchedules_List. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - sessionHostDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.sessionHosts() - .deleteWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", true, - com.azure.core.util.Context.NONE); + public static void scalingPlanPersonalSchedulesList( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlanPersonalSchedules() + .list("resourceGroup1", "scalingPlan", 10, true, 0, com.azure.core.util.Context.NONE); + } +} +``` + +### ScalingPlans_Create + +```java +/** + * Samples for ScalingPlanPooledSchedules List. + */ +public final class ScalingPlanPooledSchedulesListSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPooledSchedule_List.json + */ + /** + * Sample code: ScalingPlanPooledSchedules_List. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void scalingPlanPooledSchedulesList( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlanPooledSchedules() + .list("resourceGroup1", "scalingPlan1", 10, true, 0, com.azure.core.util.Context.NONE); + } +} +``` + +### ScalingPlans_Delete + +```java +/** + * Samples for ScalingPlans ListByHostPool. + */ +public final class ScalingPlansListByHostPoolSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlan_ListByHostPool.json + */ + /** + * Sample code: ScalingPlan_ListByHostPool. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void scalingPlanListByHostPool( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlans() + .listByHostPool("resourceGroup1", "hostPool1", 10, true, 0, com.azure.core.util.Context.NONE); + } +} +``` + +### ScalingPlans_GetByResourceGroup + +```java +import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; +import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; +import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; +import com.azure.resourcemanager.desktopvirtualization.models.Time; +import java.util.Arrays; + +/** + * Samples for ScalingPlanPersonalSchedules Create. + */ +public final class ScalingPlanPersonalSchedulesCreateSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPersonalSchedule_Create.json + */ + /** + * Sample code: ScalingPlanPersonalSchedules_Create. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void scalingPlanPersonalSchedulesCreate( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlanPersonalSchedules() + .define("scalingPlanScheduleWeekdays1") + .withExistingScalingPlan("resourceGroup1", "scalingPlan1") + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, + DayOfWeek.FRIDAY)) + .withRampUpStartTime(new Time().withHour(6).withMinute(0)) + .withPeakStartTime(new Time().withHour(8).withMinute(0)) + .withRampDownStartTime(new Time().withHour(18).withMinute(0)) + .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) + .withRampUpAutoStartHosts(StartupBehavior.ALL) + .withRampUpStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withRampUpActionOnDisconnect(SessionHandlingOperation.NONE) + .withRampUpMinutesToWaitOnDisconnect(10) + .withRampUpActionOnLogoff(SessionHandlingOperation.NONE) + .withRampUpMinutesToWaitOnLogoff(10) + .withPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) + .withPeakMinutesToWaitOnDisconnect(10) + .withPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withPeakMinutesToWaitOnLogoff(10) + .withRampDownStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withRampDownActionOnDisconnect(SessionHandlingOperation.NONE) + .withRampDownMinutesToWaitOnDisconnect(10) + .withRampDownActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withRampDownMinutesToWaitOnLogoff(10) + .withOffPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withOffPeakActionOnDisconnect(SessionHandlingOperation.NONE) + .withOffPeakMinutesToWaitOnDisconnect(10) + .withOffPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withOffPeakMinutesToWaitOnLogoff(10) + .create(); + } +} +``` + +### ScalingPlans_List + +```java +/** + * Samples for HostPools ListRegistrationTokens. + */ +public final class HostPoolsListRegistrationTokensSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/HostPools_ListRegistrationToken_Post.json + */ + /** + * Sample code: HostPools_ListRegistrationToken_Post. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void hostPoolsListRegistrationTokenPost( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.hostPools() + .listRegistrationTokensWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); + } +} +``` + +### ScalingPlans_ListByHostPool + +```java +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for MsixPackages CreateOrUpdate. + */ +public final class MsixPackagesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/MsixPackage_Create.json + */ + /** + * Sample code: MSIXPackage_Create. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void + mSIXPackageCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.msixPackages() + .define("msixpackagefullname") + .withExistingHostPool("resourceGroup1", "hostpool1") + .withImagePath("imagepath") + .withPackageName("MsixPackage_name") + .withPackageFamilyName("MsixPackage_FamilyName") + .withDisplayName("displayname") + .withPackageRelativePath("packagerelativepath") + .withIsRegularRegistration(false) + .withIsActive(false) + .withPackageDependencies( + Arrays.asList(new MsixPackageDependencies().withDependencyName("MsixTest_Dependency_Name") + .withPublisher("PublishedName") + .withMinVersion("version"))) + .withVersion("version") + .withLastUpdated(OffsetDateTime.parse("2008-09-22T14:01:54.9571247Z")) + .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("ApplicationId") + .withDescription("application-desc") + .withAppUserModelId("AppUserModelId") + .withFriendlyName("friendlyname") + .withIconImageName("Apptile") + .withRawIcon("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()) + .withRawPng("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()))) + .create(); + } +} +``` + +### ScalingPlans_ListByResourceGroup + +```java +/** + * Samples for ScalingPlans Delete. + */ +public final class ScalingPlansDeleteSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlan_Delete.json + */ + /** + * Sample code: ScalingPlans_Delete. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void + scalingPlansDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlans() + .deleteByResourceGroupWithResponse("resourceGroup1", "scalingPlan1", com.azure.core.util.Context.NONE); + } +} +``` + +### ScalingPlans_Update + +```java +/** + * Samples for ScalingPlans GetByResourceGroup. + */ +public final class ScalingPlansGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlan_Get.json + */ + /** + * Sample code: ScalingPlans_Get. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void + scalingPlansGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlans() + .getByResourceGroupWithResponse("resourceGroup1", "scalingPlan1", com.azure.core.util.Context.NONE); + } +} +``` + +### SessionHostConfigurations_CreateOrUpdate + +```java +/** + * Samples for UserSessions List. + */ +public final class UserSessionsListSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/UserSession_List.json + */ + /** + * Sample code: UserSession_List. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void + userSessionList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.userSessions() + .list("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", 10, true, 0, + com.azure.core.util.Context.NONE); + } +} +``` + +### SessionHostConfigurations_Get + +```java +import com.azure.resourcemanager.desktopvirtualization.models.MsixImageUri; + +/** + * Samples for MsixImages Expand. + */ +public final class MsixImagesExpandSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/MsixImage_Expand_Post.json + */ + /** + * Sample code: MsixImage_Expand. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void + msixImageExpand(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.msixImages() + .expand("resourceGroup1", "hostpool1", new MsixImageUri().withUri("imagepath"), + com.azure.core.util.Context.NONE); + } +} +``` + +### SessionHostConfigurations_ListByHostPool + +```java +/** + * Samples for SessionHostConfigurations Get. + */ +public final class SessionHostConfigurationsGetSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostConfigurations_Get.json + */ + /** + * Sample code: SessionHostConfigurations_Get. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostConfigurationsGet( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostConfigurations() + .getWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); + } +} +``` + +### SessionHostConfigurations_Update + +```java +import com.azure.resourcemanager.desktopvirtualization.models.Application; +import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; +import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; + +/** + * Samples for Applications Update. + */ +public final class ApplicationsUpdateSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Application_Update.json + */ + /** + * Sample code: Application_Update. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void + applicationUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + Application resource = manager.applications() + .getWithResponse("resourceGroup1", "applicationGroup1", "application1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withDescription("des1") + .withFriendlyName("friendly") + .withFilePath("path") + .withCommandLineSetting(CommandLineSetting.ALLOW) + .withCommandLineArguments("arguments") + .withShowInPortal(true) + .withIconPath("icon") + .withIconIndex(1) + .withApplicationType(RemoteApplicationType.IN_BUILT) + .apply(); + } +} +``` + +### SessionHostManagements_CreateOrUpdate + +```java +/** + * Samples for PrivateEndpointConnections GetByWorkspace. + */ +public final class PrivateEndpointConnectionsGetByWorkspaceSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/PrivateEndpointConnection_GetByWorkspace.json + */ + /** + * Sample code: PrivateEndpointConnection_GetByWorkspace. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void privateEndpointConnectionGetByWorkspace( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.privateEndpointConnections() + .getByWorkspaceWithResponse("resourceGroup1", "workspace1", + "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", com.azure.core.util.Context.NONE); + } +} +``` + +### SessionHostManagements_Get + +```java +import com.azure.resourcemanager.desktopvirtualization.models.SendMessage; + +/** + * Samples for UserSessions SendMessage. + */ +public final class UserSessionsSendMessageSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/UserSession_SendMessage_Post.json + */ + /** + * Sample code: UserSession_SendMessage_Post. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void userSessionSendMessagePost( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.userSessions() + .sendMessageWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", + new SendMessage().withMessageTitle("title").withMessageBody("body"), com.azure.core.util.Context.NONE); + } +} +``` + +### SessionHostManagements_ListByHostPool + +```java +/** + * Samples for AppAttachPackage List. + */ +public final class AppAttachPackageListSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/AppAttachPackage_ListBySubscription.json + */ + /** + * Sample code: AppAttachPackage_ListBySubscription. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void appAttachPackageListBySubscription( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.appAttachPackages().list("HostPoolName eq 'hostpool1'", com.azure.core.util.Context.NONE); + } +} +``` + +### SessionHostManagements_Update + +```java +/** + * Samples for ApplicationGroups List. + */ +public final class ApplicationGroupsListSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ApplicationGroup_ListBySubscription.json + */ + /** + * Sample code: ApplicationGroup_List. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void + applicationGroupList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applicationGroups().list("applicationGroupType eq 'RailApplication'", com.azure.core.util.Context.NONE); + } +} +``` + +### SessionHostManagementsUpdateStatus_Get + +```java +/** + * Samples for MsixPackages Delete. + */ +public final class MsixPackagesDeleteSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/MsixPackage_Delete.json + */ + /** + * Sample code: MSIXPackage_Delete. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void + mSIXPackageDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.msixPackages() + .deleteWithResponse("resourceGroup1", "hostpool1", "packagefullname", com.azure.core.util.Context.NONE); + } +} +``` + +### SessionHostOperation_RetryProvisioning + +```java +import com.azure.resourcemanager.desktopvirtualization.models.CreateDeleteProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingMethod; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; +import com.azure.resourcemanager.desktopvirtualization.models.Time; +import java.util.Arrays; + +/** + * Samples for ScalingPlanPooledSchedules Create. + */ +public final class ScalingPlanPooledSchedulesCreateSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPooledSchedule_CreateUsingCreateDelete.json + */ + /** + * Sample code: ScalingPlanPooledSchedule_CreateUsingCreateDelete. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void scalingPlanPooledScheduleCreateUsingCreateDelete( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlanPooledSchedules() + .define("scalingPlanScheduleWeekdays1") + .withExistingScalingPlan("resourceGroup1", "scalingPlan1") + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, + DayOfWeek.FRIDAY)) + .withRampUpStartTime(new Time().withHour(6).withMinute(0)) + .withRampUpCapacityThresholdPct(80) + .withPeakStartTime(new Time().withHour(8).withMinute(0)) + .withRampDownStartTime(new Time().withHour(18).withMinute(0)) + .withRampDownCapacityThresholdPct(50) + .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) + .withScalingMethod(ScalingMethod.CREATE_DELETE_POWER_MANAGE) + .withCreateDelete(new CreateDeleteProperties().withRampUpMaximumHostPoolSize(10) + .withRampUpMinimumHostPoolSize(5) + .withRampDownMaximumHostPoolSize(7) + .withRampDownMinimumHostPoolSize(2)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownForceLogoffUsers(true) + .withRampDownWaitTimeMinutes(30) + .withRampDownNotificationMessage("message") + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .create(); + } + + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPooledSchedule_Create.json + */ + /** + * Sample code: ScalingPlanPooledSchedules_Create. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void scalingPlanPooledSchedulesCreate( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlanPooledSchedules() + .define("scalingPlanScheduleWeekdays1") + .withExistingScalingPlan("resourceGroup1", "scalingPlan1") + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, + DayOfWeek.FRIDAY)) + .withRampUpStartTime(new Time().withHour(6).withMinute(0)) + .withRampUpCapacityThresholdPct(80) + .withPeakStartTime(new Time().withHour(8).withMinute(0)) + .withRampDownStartTime(new Time().withHour(18).withMinute(0)) + .withRampDownCapacityThresholdPct(50) + .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpMinimumHostsPct(20) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownMinimumHostsPct(20) + .withRampDownForceLogoffUsers(true) + .withRampDownWaitTimeMinutes(30) + .withRampDownNotificationMessage("message") + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .create(); + } +} +``` + +### SessionHosts_Delete + +```java +/** + * Samples for MsixPackages Get. + */ +public final class MsixPackagesGetSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/MsixPackage_Get.json + */ + /** + * Sample code: MSIXPackage_Get. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void + mSIXPackageGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.msixPackages() + .getWithResponse("resourceGroup1", "hostpool1", "packagefullname", com.azure.core.util.Context.NONE); } } ``` @@ -2187,24 +2784,23 @@ public final class SessionHostsDeleteSamples { ```java /** - * Samples for SessionHosts Get. + * Samples for SessionHostConfigurations ListByHostPool. */ -public final class SessionHostsGetSamples { +public final class SessionHostConfigurationsListByHostPoolSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * SessionHost_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostConfigurations_ListByHostPool.json */ /** - * Sample code: SessionHost_Get. + * Sample code: SessionHostConfigurations_ListByHostPool. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - sessionHostGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.sessionHosts() - .getWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", - com.azure.core.util.Context.NONE); + public static void sessionHostConfigurationsListByHostPool( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostConfigurations() + .listByHostPool("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); } } ``` @@ -2213,22 +2809,24 @@ public final class SessionHostsGetSamples { ```java /** - * Samples for SessionHosts List. + * Samples for UserSessions Get. */ -public final class SessionHostsListSamples { +public final class UserSessionsGetSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * SessionHost_List.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/UserSession_Get.json */ /** - * Sample code: SessionHost_List. + * Sample code: UserSession_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - sessionHostList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.sessionHosts().list("resourceGroup1", "hostPool1", 10, true, 0, com.azure.core.util.Context.NONE); + userSessionGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.userSessions() + .getWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", + com.azure.core.util.Context.NONE); } } ``` @@ -2236,30 +2834,49 @@ public final class SessionHostsListSamples { ### SessionHosts_Update ```java -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatch; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedule; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; +import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; +import com.azure.resourcemanager.desktopvirtualization.models.Time; /** - * Samples for SessionHosts Update. + * Samples for ScalingPlanPersonalSchedules Update. */ -public final class SessionHostsUpdateSamples { +public final class ScalingPlanPersonalSchedulesUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * SessionHost_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPersonalSchedule_Update.json */ /** - * Sample code: SessionHost_Update. + * Sample code: ScalingPlanPersonalSchedules_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - sessionHostUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.sessionHosts() - .updateWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", true, - new SessionHostPatch().withAllowNewSession(true) - .withAssignedUser("user1@microsoft.com") - .withFriendlyName("friendly"), - com.azure.core.util.Context.NONE); + public static void scalingPlanPersonalSchedulesUpdate( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + ScalingPlanPersonalSchedule resource = manager.scalingPlanPersonalSchedules() + .getWithResponse("resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withPeakStartTime(new Time().withHour(8).withMinute(0)) + .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) + .withPeakMinutesToWaitOnDisconnect(10) + .withPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withPeakMinutesToWaitOnLogoff(10) + .withRampDownStartTime(new Time().withHour(18).withMinute(0)) + .withRampDownActionOnDisconnect(SessionHandlingOperation.NONE) + .withRampDownMinutesToWaitOnDisconnect(10) + .withRampDownActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withRampDownMinutesToWaitOnLogoff(10) + .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) + .withOffPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withOffPeakActionOnDisconnect(SessionHandlingOperation.NONE) + .withOffPeakMinutesToWaitOnDisconnect(10) + .withOffPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withOffPeakMinutesToWaitOnLogoff(10) + .apply(); } } ``` @@ -2268,23 +2885,22 @@ public final class SessionHostsUpdateSamples { ```java /** - * Samples for StartMenuItems List. + * Samples for ScalingPlans List. */ -public final class StartMenuItemsListSamples { +public final class ScalingPlansListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * StartMenuItem_List.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlan_ListBySubscription.json */ /** - * Sample code: StartMenuItem_List. + * Sample code: ScalingPlans_ListBySubscription. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - startMenuItemList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.startMenuItems() - .list("resourceGroup1", "applicationGroup1", null, null, null, com.azure.core.util.Context.NONE); + public static void scalingPlansListBySubscription( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlans().list(10, true, 0, com.azure.core.util.Context.NONE); } } ``` @@ -2292,25 +2908,36 @@ public final class StartMenuItemsListSamples { ### UserSessions_Delete ```java +import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; + /** - * Samples for UserSessions Delete. + * Samples for Applications CreateOrUpdate. */ -public final class UserSessionsDeleteSamples { +public final class ApplicationsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * UserSession_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Application_Create.json */ /** - * Sample code: UserSession_Delete. + * Sample code: Application_Create. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - userSessionDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.userSessions() - .deleteWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", true, - com.azure.core.util.Context.NONE); + applicationCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applications() + .define("application1") + .withExistingApplicationGroup("resourceGroup1", "applicationGroup1") + .withCommandLineSetting(CommandLineSetting.ALLOW) + .withDescription("des1") + .withFriendlyName("friendly") + .withFilePath("path") + .withCommandLineArguments("arguments") + .withShowInPortal(true) + .withIconPath("icon") + .withIconIndex(1) + .create(); } } ``` @@ -2319,24 +2946,23 @@ public final class UserSessionsDeleteSamples { ```java /** - * Samples for UserSessions Disconnect. + * Samples for AppAttachPackage GetByResourceGroup. */ -public final class UserSessionsDisconnectSamples { +public final class AppAttachPackageGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * UserSession_Disconnect_Post.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/AppAttachPackage_Get.json */ /** - * Sample code: UserSession_Disconnect_Post. + * Sample code: AppAttachPackage_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void userSessionDisconnectPost( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.userSessions() - .disconnectWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", - com.azure.core.util.Context.NONE); + public static void + appAttachPackageGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.appAttachPackages() + .getByResourceGroupWithResponse("resourceGroup1", "packagefullname", com.azure.core.util.Context.NONE); } } ``` @@ -2345,24 +2971,22 @@ public final class UserSessionsDisconnectSamples { ```java /** - * Samples for UserSessions Get. + * Samples for HostPools ListByResourceGroup. */ -public final class UserSessionsGetSamples { +public final class HostPoolsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * UserSession_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/HostPool_ListByResourceGroup.json */ /** - * Sample code: UserSession_Get. + * Sample code: HostPool_ListByResourceGroup. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - userSessionGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.userSessions() - .getWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", - com.azure.core.util.Context.NONE); + public static void hostPoolListByResourceGroup( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.hostPools().listByResourceGroup("resourceGroup1", 10, true, 0, com.azure.core.util.Context.NONE); } } ``` @@ -2371,24 +2995,23 @@ public final class UserSessionsGetSamples { ```java /** - * Samples for UserSessions List. + * Samples for StartMenuItems List. */ -public final class UserSessionsListSamples { +public final class StartMenuItemsListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * UserSession_List.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/StartMenuItem_List.json */ /** - * Sample code: UserSession_List. + * Sample code: StartMenuItem_List. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - userSessionList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.userSessions() - .list("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", 10, true, 0, - com.azure.core.util.Context.NONE); + startMenuItemList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.startMenuItems() + .list("resourceGroup1", "applicationGroup1", null, null, null, com.azure.core.util.Context.NONE); } } ``` @@ -2397,25 +3020,22 @@ public final class UserSessionsListSamples { ```java /** - * Samples for UserSessions ListByHostPool. + * Samples for HostPools Delete. */ -public final class UserSessionsListByHostPoolSamples { +public final class HostPoolsDeleteSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * UserSession_ListByHostPool.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/HostPool_Delete.json */ /** - * Sample code: UserSession_ListByHostPool. + * Sample code: HostPool_Delete. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void userSessionListByHostPool( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.userSessions() - .listByHostPool("resourceGroup1", "hostPool1", - "userPrincipalName eq 'user1@microsoft.com' and state eq 'active'", 10, true, 0, - com.azure.core.util.Context.NONE); + public static void + hostPoolDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.hostPools().deleteWithResponse("resourceGroup1", "hostPool1", true, com.azure.core.util.Context.NONE); } } ``` @@ -2423,27 +3043,26 @@ public final class UserSessionsListByHostPoolSamples { ### UserSessions_SendMessage ```java -import com.azure.resourcemanager.desktopvirtualization.models.SendMessage; - /** - * Samples for UserSessions SendMessage. + * Samples for UserSessions ListByHostPool. */ -public final class UserSessionsSendMessageSamples { +public final class UserSessionsListByHostPoolSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * UserSession_SendMessage_Post.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/UserSession_ListByHostPool.json */ /** - * Sample code: UserSession_SendMessage_Post. + * Sample code: UserSession_ListByHostPool. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void userSessionSendMessagePost( + public static void userSessionListByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.userSessions() - .sendMessageWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", - new SendMessage().withMessageTitle("title").withMessageBody("body"), com.azure.core.util.Context.NONE); + .listByHostPool("resourceGroup1", "hostPool1", + "userPrincipalName eq 'user1@microsoft.com' and state eq 'active'", 10, true, 0, + com.azure.core.util.Context.NONE); } } ``` @@ -2460,8 +3079,8 @@ import java.util.Map; public final class WorkspacesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Workspace_Create.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Workspace_Create.json */ /** * Sample code: Workspace_Create. @@ -2498,23 +3117,24 @@ public final class WorkspacesCreateOrUpdateSamples { ```java /** - * Samples for Workspaces Delete. + * Samples for ScalingPlanPooledSchedules Delete. */ -public final class WorkspacesDeleteSamples { +public final class ScalingPlanPooledSchedulesDeleteSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Workspace_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPooledSchedule_Delete.json */ /** - * Sample code: Workspace_Delete. + * Sample code: ScalingPlanPooledSchedules_Delete. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - workspaceDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.workspaces() - .deleteByResourceGroupWithResponse("resourceGroup1", "workspace1", com.azure.core.util.Context.NONE); + public static void scalingPlanPooledSchedulesDelete( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlanPooledSchedules() + .deleteWithResponse("resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", + com.azure.core.util.Context.NONE); } } ``` @@ -2523,23 +3143,24 @@ public final class WorkspacesDeleteSamples { ```java /** - * Samples for Workspaces GetByResourceGroup. + * Samples for SessionHosts Delete. */ -public final class WorkspacesGetByResourceGroupSamples { +public final class SessionHostsDeleteSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Workspace_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHost_Delete.json */ /** - * Sample code: Workspace_Get. + * Sample code: SessionHost_Delete. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - workspaceGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.workspaces() - .getByResourceGroupWithResponse("resourceGroup1", "workspace1", com.azure.core.util.Context.NONE); + sessionHostDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHosts() + .deleteWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", true, + com.azure.core.util.Context.NONE); } } ``` @@ -2547,23 +3168,33 @@ public final class WorkspacesGetByResourceGroupSamples { ### Workspaces_List ```java +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationProperties; + /** - * Samples for Workspaces List. + * Samples for SessionHostManagements CreateOrUpdate. */ -public final class WorkspacesListSamples { +public final class SessionHostManagementsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Workspace_ListBySubscription.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostManagements_Create.json */ /** - * Sample code: Workspace_ListBySubscription. + * Sample code: SessionHostManagements_Create. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void workspaceListBySubscription( + public static void sessionHostManagementsCreate( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.workspaces().list(com.azure.core.util.Context.NONE); + manager.sessionHostManagements() + .createOrUpdateWithResponse("resourceGroup1", "hostPool1", + new SessionHostManagementInner().withScheduledDateTimeZone("Alaskan Standard Time") + .withUpdate(new HostPoolUpdateConfigurationProperties().withDeleteOriginalVm(true) + .withMaxVmsRemoved(4) + .withLogOffDelayMinutes(10) + .withLogOffMessage("logging off for hostpool update")), + com.azure.core.util.Context.NONE); } } ``` @@ -2571,23 +3202,28 @@ public final class WorkspacesListSamples { ### Workspaces_ListByResourceGroup ```java +import com.azure.resourcemanager.desktopvirtualization.models.DesktopPatch; + /** - * Samples for Workspaces ListByResourceGroup. + * Samples for Desktops Update. */ -public final class WorkspacesListByResourceGroupSamples { +public final class DesktopsUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Workspace_ListByResourceGroup.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Desktop_Update.json */ /** - * Sample code: Workspace_ListByResourceGroup. + * Sample code: Desktop_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void workspaceListByResourceGroup( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.workspaces().listByResourceGroup("resourceGroup1", 10, true, 0, com.azure.core.util.Context.NONE); + public static void + desktopUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.desktops() + .updateWithResponse("resourceGroup1", "applicationGroup1", "SessionDesktop", + new DesktopPatch().withDescription("des1").withFriendlyName("friendly"), + com.azure.core.util.Context.NONE); } } ``` @@ -2595,46 +3231,24 @@ public final class WorkspacesListByResourceGroupSamples { ### Workspaces_Update ```java -import com.azure.resourcemanager.desktopvirtualization.models.Workspace; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for Workspaces Update. + * Samples for SessionHostManagementsUpdateStatus Get. */ -public final class WorkspacesUpdateSamples { +public final class SessionHostManagementsUpdateStatusGetSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Workspace_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostManagements_UpdateStatus_Get.json */ /** - * Sample code: Workspace_Update. + * Sample code: SessionHostManagements_UpdateStatus_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - workspaceUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - Workspace resource = manager.workspaces() - .getByResourceGroupWithResponse("resourceGroup1", "workspace1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withDescription("des1") - .withFriendlyName("friendly") - .apply(); - } - - // 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; + public static void sessionHostManagementsUpdateStatusGet( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostManagementsUpdateStatus() + .getWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/pom.xml b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/pom.xml index 7b7583686d3d..b16d16bd07c2 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/pom.xml +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for DesktopVirtualization Management - This package contains Microsoft Azure SDK for DesktopVirtualization Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2024-04. + This package contains Microsoft Azure SDK for DesktopVirtualization Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-preview-2024-11-01-preview. https://github.com/Azure/azure-sdk-for-java @@ -45,13 +45,9 @@ UTF-8 0 0 + true - - com.azure - azure-json - 1.5.0 - com.azure azure-core @@ -62,6 +58,11 @@ azure-core-management 1.17.0 + + com.azure + azure-json + 1.5.0 + com.azure azure-core-test diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/DesktopVirtualizationManager.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/DesktopVirtualizationManager.java index 428b4c9465bc..503f879a57d3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/DesktopVirtualizationManager.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/DesktopVirtualizationManager.java @@ -11,26 +11,30 @@ 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.HttpLoggingPolicy; +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.http.policy.ArmChallengeAuthenticationPolicy; 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.desktopvirtualization.fluent.DesktopVirtualizationApiClient; +import com.azure.resourcemanager.desktopvirtualization.implementation.ActiveSessionHostConfigurationsImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.AppAttachPackageInfoesImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.AppAttachPackagesImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.ApplicationGroupsImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.ApplicationsImpl; -import com.azure.resourcemanager.desktopvirtualization.implementation.DesktopsImpl; +import com.azure.resourcemanager.desktopvirtualization.implementation.ControlSessionHostUpdatesImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.DesktopVirtualizationApiClientBuilder; +import com.azure.resourcemanager.desktopvirtualization.implementation.DesktopsImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.HostPoolsImpl; +import com.azure.resourcemanager.desktopvirtualization.implementation.InitiateSessionHostUpdatesImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.MsixImagesImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.MsixPackagesImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.OperationsImpl; @@ -39,16 +43,23 @@ import com.azure.resourcemanager.desktopvirtualization.implementation.ScalingPlanPersonalSchedulesImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.ScalingPlanPooledSchedulesImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.ScalingPlansImpl; +import com.azure.resourcemanager.desktopvirtualization.implementation.SessionHostConfigurationsImpl; +import com.azure.resourcemanager.desktopvirtualization.implementation.SessionHostManagementsImpl; +import com.azure.resourcemanager.desktopvirtualization.implementation.SessionHostManagementsUpdateStatusImpl; +import com.azure.resourcemanager.desktopvirtualization.implementation.SessionHostOperationsImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.SessionHostsImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.StartMenuItemsImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.UserSessionsImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.WorkspacesImpl; +import com.azure.resourcemanager.desktopvirtualization.models.ActiveSessionHostConfigurations; import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageInfoes; import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackages; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroups; import com.azure.resourcemanager.desktopvirtualization.models.Applications; +import com.azure.resourcemanager.desktopvirtualization.models.ControlSessionHostUpdates; import com.azure.resourcemanager.desktopvirtualization.models.Desktops; import com.azure.resourcemanager.desktopvirtualization.models.HostPools; +import com.azure.resourcemanager.desktopvirtualization.models.InitiateSessionHostUpdates; import com.azure.resourcemanager.desktopvirtualization.models.MsixImages; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackages; import com.azure.resourcemanager.desktopvirtualization.models.Operations; @@ -57,6 +68,10 @@ import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedules; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedules; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlans; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostConfigurations; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagements; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementsUpdateStatus; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostOperations; import com.azure.resourcemanager.desktopvirtualization.models.SessionHosts; import com.azure.resourcemanager.desktopvirtualization.models.StartMenuItems; import com.azure.resourcemanager.desktopvirtualization.models.UserSessions; @@ -65,6 +80,7 @@ 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; @@ -96,10 +112,24 @@ public final class DesktopVirtualizationManager { private HostPools hostPools; + private SessionHostManagements sessionHostManagements; + + private InitiateSessionHostUpdates initiateSessionHostUpdates; + + private ControlSessionHostUpdates controlSessionHostUpdates; + + private SessionHostManagementsUpdateStatus sessionHostManagementsUpdateStatus; + + private SessionHostConfigurations sessionHostConfigurations; + + private ActiveSessionHostConfigurations activeSessionHostConfigurations; + private UserSessions userSessions; private SessionHosts sessionHosts; + private SessionHostOperations sessionHostOperations; + private MsixPackages msixPackages; private AppAttachPackageInfoes appAttachPackageInfoes; @@ -161,6 +191,9 @@ public static Configurable configure() { */ 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-desktopvirtualization.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -268,12 +301,14 @@ public DesktopVirtualizationManager authenticate(TokenCredential credential, Azu 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.desktopvirtualization") .append("/") - .append("1.2.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -306,7 +341,7 @@ public DesktopVirtualizationManager authenticate(TokenCredential credential, Azu HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + 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())); @@ -466,6 +501,84 @@ public HostPools hostPools() { return hostPools; } + /** + * Gets the resource collection API of SessionHostManagements. + * + * @return Resource collection API of SessionHostManagements. + */ + public SessionHostManagements sessionHostManagements() { + if (this.sessionHostManagements == null) { + this.sessionHostManagements + = new SessionHostManagementsImpl(clientObject.getSessionHostManagements(), this); + } + return sessionHostManagements; + } + + /** + * Gets the resource collection API of InitiateSessionHostUpdates. + * + * @return Resource collection API of InitiateSessionHostUpdates. + */ + public InitiateSessionHostUpdates initiateSessionHostUpdates() { + if (this.initiateSessionHostUpdates == null) { + this.initiateSessionHostUpdates + = new InitiateSessionHostUpdatesImpl(clientObject.getInitiateSessionHostUpdates(), this); + } + return initiateSessionHostUpdates; + } + + /** + * Gets the resource collection API of ControlSessionHostUpdates. + * + * @return Resource collection API of ControlSessionHostUpdates. + */ + public ControlSessionHostUpdates controlSessionHostUpdates() { + if (this.controlSessionHostUpdates == null) { + this.controlSessionHostUpdates + = new ControlSessionHostUpdatesImpl(clientObject.getControlSessionHostUpdates(), this); + } + return controlSessionHostUpdates; + } + + /** + * Gets the resource collection API of SessionHostManagementsUpdateStatus. + * + * @return Resource collection API of SessionHostManagementsUpdateStatus. + */ + public SessionHostManagementsUpdateStatus sessionHostManagementsUpdateStatus() { + if (this.sessionHostManagementsUpdateStatus == null) { + this.sessionHostManagementsUpdateStatus = new SessionHostManagementsUpdateStatusImpl( + clientObject.getSessionHostManagementsUpdateStatus(), this); + } + return sessionHostManagementsUpdateStatus; + } + + /** + * Gets the resource collection API of SessionHostConfigurations. + * + * @return Resource collection API of SessionHostConfigurations. + */ + public SessionHostConfigurations sessionHostConfigurations() { + if (this.sessionHostConfigurations == null) { + this.sessionHostConfigurations + = new SessionHostConfigurationsImpl(clientObject.getSessionHostConfigurations(), this); + } + return sessionHostConfigurations; + } + + /** + * Gets the resource collection API of ActiveSessionHostConfigurations. + * + * @return Resource collection API of ActiveSessionHostConfigurations. + */ + public ActiveSessionHostConfigurations activeSessionHostConfigurations() { + if (this.activeSessionHostConfigurations == null) { + this.activeSessionHostConfigurations + = new ActiveSessionHostConfigurationsImpl(clientObject.getActiveSessionHostConfigurations(), this); + } + return activeSessionHostConfigurations; + } + /** * Gets the resource collection API of UserSessions. * @@ -490,6 +603,18 @@ public SessionHosts sessionHosts() { return sessionHosts; } + /** + * Gets the resource collection API of SessionHostOperations. + * + * @return Resource collection API of SessionHostOperations. + */ + public SessionHostOperations sessionHostOperations() { + if (this.sessionHostOperations == null) { + this.sessionHostOperations = new SessionHostOperationsImpl(clientObject.getSessionHostOperations(), this); + } + return sessionHostOperations; + } + /** * Gets the resource collection API of MsixPackages. It manages MsixPackage. * diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ActiveSessionHostConfigurationsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ActiveSessionHostConfigurationsClient.java new file mode 100644 index 000000000000..a27887cd250e --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ActiveSessionHostConfigurationsClient.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.ActiveSessionHostConfigurationInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ActiveSessionHostConfigurationsClient. + */ +public interface ActiveSessionHostConfigurationsClient { + /** + * Get the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, + String hostPoolName); + + /** + * Get the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String hostPoolName); + + /** + * Get the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context); + + /** + * Get the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ActiveSessionHostConfigurationInner get(String resourceGroupName, String hostPoolName); + + /** + * List activeSessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return activeSessionHostConfigurationList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName); + + /** + * List activeSessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return activeSessionHostConfigurationList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); + + /** + * List activeSessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return activeSessionHostConfigurationList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Context context); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/AppAttachPackagesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/AppAttachPackagesClient.java index acc2fd51b9c5..461aa2c54c42 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/AppAttachPackagesClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/AppAttachPackagesClient.java @@ -22,7 +22,7 @@ public interface AppAttachPackagesClient { * Get an app attach package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -36,7 +36,7 @@ Mono> getByResourceGroupWithResponseAsync(String * Get an app attach package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -49,7 +49,7 @@ Mono> getByResourceGroupWithResponseAsync(String * Get an app attach package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -64,7 +64,7 @@ Response getByResourceGroupWithResponse(String resourceGr * Get an app attach package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -77,7 +77,7 @@ Response getByResourceGroupWithResponse(String resourceGr * Create or update an App Attach package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @param appAttachPackage Object containing App Attach Package definitions. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -93,7 +93,7 @@ Mono> createOrUpdateWithResponseAsync(String res * Create or update an App Attach package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @param appAttachPackage Object containing App Attach Package definitions. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -108,7 +108,7 @@ Mono createOrUpdateAsync(String resourceGroupName, String * Create or update an App Attach package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @param appAttachPackage Object containing App Attach Package definitions. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -124,7 +124,7 @@ Response createOrUpdateWithResponse(String resourceGroupN * Create or update an App Attach package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @param appAttachPackage Object containing App Attach Package definitions. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -139,20 +139,21 @@ AppAttachPackageInner createOrUpdate(String resourceGroupName, String appAttachP * Remove an App Attach Package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. + * @param force Force flag to delete App Attach package. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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) - Mono> deleteWithResponseAsync(String resourceGroupName, String appAttachPackageName); + Mono> deleteWithResponseAsync(String resourceGroupName, String appAttachPackageName, Boolean force); /** * Remove an App Attach Package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -165,7 +166,8 @@ AppAttachPackageInner createOrUpdate(String resourceGroupName, String appAttachP * Remove an App Attach Package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. + * @param force Force flag to delete App Attach package. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -173,13 +175,14 @@ AppAttachPackageInner createOrUpdate(String resourceGroupName, String appAttachP * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String appAttachPackageName, Context context); + Response deleteWithResponse(String resourceGroupName, String appAttachPackageName, Boolean force, + Context context); /** * Remove an App Attach Package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -191,7 +194,7 @@ AppAttachPackageInner createOrUpdate(String resourceGroupName, String appAttachP * Update an App Attach Package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @param appAttachPackagePatch Object containing App Attach Package definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -207,7 +210,7 @@ Mono> updateWithResponseAsync(String resourceGro * Update an App Attach Package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -220,7 +223,7 @@ Mono> updateWithResponseAsync(String resourceGro * Update an App Attach Package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @param appAttachPackagePatch Object containing App Attach Package definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -236,7 +239,7 @@ Response updateWithResponse(String resourceGroupName, Str * Update an App Attach Package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -249,7 +252,8 @@ Response updateWithResponse(String resourceGroupName, Str * List App Attach packages in resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter expression. Valid properties for filtering are package name and host pool. + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, package owner + * name, and custom data. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -286,7 +290,8 @@ Response updateWithResponse(String resourceGroupName, Str * List App Attach packages in resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter expression. Valid properties for filtering are package name and host pool. + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, package owner + * name, and custom data. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -299,8 +304,8 @@ Response updateWithResponse(String resourceGroupName, Str /** * List App Attach packages in subscription. * - * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and resource - * group. + * @param filter OData filter expression. Valid properties for filtering are package name, resource group, host + * pool, package owner name, and custom data. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -332,8 +337,8 @@ Response updateWithResponse(String resourceGroupName, Str /** * List App Attach packages in subscription. * - * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and resource - * group. + * @param filter OData filter expression. Valid properties for filtering are package name, resource group, host + * pool, package owner name, and custom data. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ControlSessionHostUpdatesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ControlSessionHostUpdatesClient.java new file mode 100644 index 000000000000..1e74721a8943 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ControlSessionHostUpdatesClient.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateControlParameter; +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 ControlSessionHostUpdatesClient. + */ +public interface ControlSessionHostUpdatesClient { + /** + * Control update of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolUpdateControlParameter Object containing control action for hostpool update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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) + Mono>> postWithResponseAsync(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter); + + /** + * Control update of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolUpdateControlParameter Object containing control action for hostpool update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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) + PollerFlux, Void> beginPostAsync(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter); + + /** + * Control update of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolUpdateControlParameter Object containing control action for hostpool update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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> beginPost(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter); + + /** + * Control update of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolUpdateControlParameter Object containing control action for hostpool update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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> beginPost(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter, Context context); + + /** + * Control update of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolUpdateControlParameter Object containing control action for hostpool update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + Mono postAsync(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter); + + /** + * Control update of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolUpdateControlParameter Object containing control action for hostpool update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 post(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter); + + /** + * Control update of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolUpdateControlParameter Object containing control action for hostpool update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 post(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter, Context context); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopVirtualizationApiClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopVirtualizationApiClient.java index 12f17ea6865b..d65f7a7e412a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopVirtualizationApiClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopVirtualizationApiClient.java @@ -130,6 +130,48 @@ public interface DesktopVirtualizationApiClient { */ HostPoolsClient getHostPools(); + /** + * Gets the SessionHostManagementsClient object to access its operations. + * + * @return the SessionHostManagementsClient object. + */ + SessionHostManagementsClient getSessionHostManagements(); + + /** + * Gets the InitiateSessionHostUpdatesClient object to access its operations. + * + * @return the InitiateSessionHostUpdatesClient object. + */ + InitiateSessionHostUpdatesClient getInitiateSessionHostUpdates(); + + /** + * Gets the ControlSessionHostUpdatesClient object to access its operations. + * + * @return the ControlSessionHostUpdatesClient object. + */ + ControlSessionHostUpdatesClient getControlSessionHostUpdates(); + + /** + * Gets the SessionHostManagementsUpdateStatusClient object to access its operations. + * + * @return the SessionHostManagementsUpdateStatusClient object. + */ + SessionHostManagementsUpdateStatusClient getSessionHostManagementsUpdateStatus(); + + /** + * Gets the SessionHostConfigurationsClient object to access its operations. + * + * @return the SessionHostConfigurationsClient object. + */ + SessionHostConfigurationsClient getSessionHostConfigurations(); + + /** + * Gets the ActiveSessionHostConfigurationsClient object to access its operations. + * + * @return the ActiveSessionHostConfigurationsClient object. + */ + ActiveSessionHostConfigurationsClient getActiveSessionHostConfigurations(); + /** * Gets the UserSessionsClient object to access its operations. * @@ -144,6 +186,13 @@ public interface DesktopVirtualizationApiClient { */ SessionHostsClient getSessionHosts(); + /** + * Gets the SessionHostOperationsClient object to access its operations. + * + * @return the SessionHostOperationsClient object. + */ + SessionHostOperationsClient getSessionHostOperations(); + /** * Gets the MsixPackagesClient object to access its operations. * diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/InitiateSessionHostUpdatesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/InitiateSessionHostUpdatesClient.java new file mode 100644 index 000000000000..021bbe2d3ec6 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/InitiateSessionHostUpdatesClient.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.desktopvirtualization.models.UpdateSessionHostsRequestBody; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in InitiateSessionHostUpdatesClient. + */ +public interface InitiateSessionHostUpdatesClient { + /** + * Initiates a hostpool update or schedule an update for the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param updateSessionHostsRequestBody Object containing the definition for properties to be used in the + * sessionHostUpdate validation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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) + Mono> postWithResponseAsync(String resourceGroupName, String hostPoolName, + UpdateSessionHostsRequestBody updateSessionHostsRequestBody); + + /** + * Initiates a hostpool update or schedule an update for the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono postAsync(String resourceGroupName, String hostPoolName); + + /** + * Initiates a hostpool update or schedule an update for the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param updateSessionHostsRequestBody Object containing the definition for properties to be used in the + * sessionHostUpdate validation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response postWithResponse(String resourceGroupName, String hostPoolName, + UpdateSessionHostsRequestBody updateSessionHostsRequestBody, Context context); + + /** + * Initiates a hostpool update or schedule an update for the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void post(String resourceGroupName, String hostPoolName); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostConfigurationsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostConfigurationsClient.java new file mode 100644 index 000000000000..9cafb5d6478d --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostConfigurationsClient.java @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +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.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostConfigurationInner; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostConfigurationPatch; +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 SessionHostConfigurationsClient. + */ +public interface SessionHostConfigurationsClient { + /** + * Create or update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String hostPoolName, + SessionHostConfigurationInner sessionHostConfiguration); + + /** + * Create or update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, SessionHostConfigurationInner> beginCreateOrUpdateAsync( + String resourceGroupName, String hostPoolName, SessionHostConfigurationInner sessionHostConfiguration); + + /** + * Create or update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SessionHostConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String hostPoolName, SessionHostConfigurationInner sessionHostConfiguration); + + /** + * Create or update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SessionHostConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String hostPoolName, SessionHostConfigurationInner sessionHostConfiguration, + Context context); + + /** + * Create or update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createOrUpdateAsync(String resourceGroupName, String hostPoolName, + SessionHostConfigurationInner sessionHostConfiguration); + + /** + * Create or update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionHostConfigurationInner createOrUpdate(String resourceGroupName, String hostPoolName, + SessionHostConfigurationInner sessionHostConfiguration); + + /** + * Create or update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionHostConfigurationInner createOrUpdate(String resourceGroupName, String hostPoolName, + SessionHostConfigurationInner sessionHostConfiguration, Context context); + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + SessionHostConfigurationPatch sessionHostConfiguration); + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, SessionHostConfigurationInner> beginUpdateAsync( + String resourceGroupName, String hostPoolName, SessionHostConfigurationPatch sessionHostConfiguration); + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, SessionHostConfigurationInner> + beginUpdateAsync(String resourceGroupName, String hostPoolName); + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SessionHostConfigurationInner> + beginUpdate(String resourceGroupName, String hostPoolName); + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SessionHostConfigurationInner> beginUpdate( + String resourceGroupName, String hostPoolName, SessionHostConfigurationPatch sessionHostConfiguration, + Context context); + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String hostPoolName, + SessionHostConfigurationPatch sessionHostConfiguration); + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String hostPoolName); + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionHostConfigurationInner update(String resourceGroupName, String hostPoolName); + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionHostConfigurationInner update(String resourceGroupName, String hostPoolName, + SessionHostConfigurationPatch sessionHostConfiguration, Context context); + + /** + * Get a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostConfiguration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName); + + /** + * Get a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostConfiguration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String hostPoolName); + + /** + * Get a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostConfiguration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context); + + /** + * Get a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostConfiguration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionHostConfigurationInner get(String resourceGroupName, String hostPoolName); + + /** + * List sessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostConfigurationList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName); + + /** + * List sessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostConfigurationList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); + + /** + * List sessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostConfigurationList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Context context); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostManagementsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostManagementsClient.java new file mode 100644 index 000000000000..477712f2073b --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostManagementsClient.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementPatch; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SessionHostManagementsClient. + */ +public interface SessionHostManagementsClient { + /** + * Get a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostManagement along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName); + + /** + * Get a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostManagement on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String hostPoolName); + + /** + * Get a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostManagement along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context); + + /** + * Get a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostManagement. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionHostManagementInner get(String resourceGroupName, String hostPoolName); + + /** + * Create or update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostManagement Object containing SessionHostManagement definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String hostPoolName, SessionHostManagementInner sessionHostManagement); + + /** + * Create or update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostManagement Object containing SessionHostManagement definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createOrUpdateAsync(String resourceGroupName, String hostPoolName, + SessionHostManagementInner sessionHostManagement); + + /** + * Create or update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostManagement Object containing SessionHostManagement definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String hostPoolName, + SessionHostManagementInner sessionHostManagement, Context context); + + /** + * Create or update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostManagement Object containing SessionHostManagement definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionHostManagementInner createOrUpdate(String resourceGroupName, String hostPoolName, + SessionHostManagementInner sessionHostManagement); + + /** + * Update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostManagement Object containing SessionHostManagement definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + SessionHostManagementPatch sessionHostManagement); + + /** + * Update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String hostPoolName); + + /** + * Update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostManagement Object containing SessionHostManagement definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String hostPoolName, + SessionHostManagementPatch sessionHostManagement, Context context); + + /** + * Update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionHostManagementInner update(String resourceGroupName, String hostPoolName); + + /** + * List SessionHostManagements by hostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostManagementList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName); + + /** + * List SessionHostManagements by hostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostManagementList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); + + /** + * List SessionHostManagements by hostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostManagementList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Context context); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostManagementsUpdateStatusClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostManagementsUpdateStatusClient.java new file mode 100644 index 000000000000..35cfa3086c93 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostManagementsUpdateStatusClient.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementUpdateStatusInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SessionHostManagementsUpdateStatusClient. + */ +public interface SessionHostManagementsUpdateStatusClient { + /** + * Get the session host update status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host update status for a given hostpool along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, + String hostPoolName); + + /** + * Get the session host update status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host update status for a given hostpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String hostPoolName); + + /** + * Get the session host update status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host update status for a given hostpool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context); + + /** + * Get the session host update status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host update status for a given hostpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionHostManagementUpdateStatusInner get(String resourceGroupName, String hostPoolName); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostOperationsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostOperationsClient.java new file mode 100644 index 000000000000..863cb5b8e7d0 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostOperationsClient.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SessionHostOperationsClient. + */ +public interface SessionHostOperationsClient { + /** + * Retry provisioning on a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostname The name of the session host within the specified host pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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) + Mono> retryProvisioningWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname); + + /** + * Retry provisioning on a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostname The name of the session host within the specified host pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + Mono retryProvisioningAsync(String resourceGroupName, String hostPoolName, String sessionHostname); + + /** + * Retry provisioning on a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostname The name of the session host within the specified host pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response retryProvisioningWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Context context); + + /** + * Retry provisioning on a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostname The name of the session host within the specified host pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 retryProvisioning(String resourceGroupName, String hostPoolName, String sessionHostname); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostsClient.java index f4ef87604a59..ecc40e7b7731 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostsClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostsClient.java @@ -208,6 +208,7 @@ Response updateWithResponse(String resourceGroupName, String h * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. + * @param vmPath The path to the VM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -215,7 +216,7 @@ Response updateWithResponse(String resourceGroupName, String h */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip); + Boolean isDescending, Integer initialSkip, String vmPath); /** * List sessionHosts. @@ -251,6 +252,7 @@ PagedFlux listAsync(String resourceGroupName, String hostPoolN * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. + * @param vmPath The path to the VM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -259,5 +261,5 @@ PagedFlux listAsync(String resourceGroupName, String hostPoolN */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context); + Boolean isDescending, Integer initialSkip, String vmPath, Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ActiveSessionHostConfigurationInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ActiveSessionHostConfigurationInner.java new file mode 100644 index 000000000000..1ea70c67572d --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ActiveSessionHostConfigurationInner.java @@ -0,0 +1,540 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.models.BootDiagnosticsInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DiskInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DomainInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ImageInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.KeyVaultCredentialsProperties; +import com.azure.resourcemanager.desktopvirtualization.models.NetworkInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SecurityInfoProperties; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Represents a ActiveSessionHostConfiguration definition. This has all of the sessionHostConfiguration properties + * except provisioningState. + */ +@Fluent +public final class ActiveSessionHostConfigurationInner extends ProxyResource { + /* + * Detailed properties for SessionHostConfiguration + */ + private ActiveSessionHostConfigurationProperties innerProperties = new ActiveSessionHostConfigurationProperties(); + + /* + * 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 ActiveSessionHostConfigurationInner class. + */ + public ActiveSessionHostConfigurationInner() { + } + + /** + * Get the innerProperties property: Detailed properties for SessionHostConfiguration. + * + * @return the innerProperties value. + */ + private ActiveSessionHostConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * Get the version property: The timestamp of the last update. + * + * @return the version value. + */ + public OffsetDateTime version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Get the friendlyName property: Friendly name to describe this version of the SessionHostConfiguration. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Set the friendlyName property: Friendly name to describe this version of the SessionHostConfiguration. + * + * @param friendlyName the friendlyName value to set. + * @return the ActiveSessionHostConfigurationInner object itself. + */ + public ActiveSessionHostConfigurationInner withFriendlyName(String friendlyName) { + if (this.innerProperties() == null) { + this.innerProperties = new ActiveSessionHostConfigurationProperties(); + } + this.innerProperties().withFriendlyName(friendlyName); + return this; + } + + /** + * Get the vmTags property: Hashtable that lists key/value pair tags to apply to the VMs. + * + * @return the vmTags value. + */ + public Map vmTags() { + return this.innerProperties() == null ? null : this.innerProperties().vmTags(); + } + + /** + * Set the vmTags property: Hashtable that lists key/value pair tags to apply to the VMs. + * + * @param vmTags the vmTags value to set. + * @return the ActiveSessionHostConfigurationInner object itself. + */ + public ActiveSessionHostConfigurationInner withVmTags(Map vmTags) { + if (this.innerProperties() == null) { + this.innerProperties = new ActiveSessionHostConfigurationProperties(); + } + this.innerProperties().withVmTags(vmTags); + return this; + } + + /** + * Get the vmLocation property: The Location for the session host to be created in. It will default to the location + * of the hostpool if not provided. + * + * @return the vmLocation value. + */ + public String vmLocation() { + return this.innerProperties() == null ? null : this.innerProperties().vmLocation(); + } + + /** + * Set the vmLocation property: The Location for the session host to be created in. It will default to the location + * of the hostpool if not provided. + * + * @param vmLocation the vmLocation value to set. + * @return the ActiveSessionHostConfigurationInner object itself. + */ + public ActiveSessionHostConfigurationInner withVmLocation(String vmLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new ActiveSessionHostConfigurationProperties(); + } + this.innerProperties().withVmLocation(vmLocation); + return this; + } + + /** + * Get the vmResourceGroup property: The ResourceGroup for the session hosts to be created in. It will default to + * the ResourceGroup of the hostpool if not provided. + * + * @return the vmResourceGroup value. + */ + public String vmResourceGroup() { + return this.innerProperties() == null ? null : this.innerProperties().vmResourceGroup(); + } + + /** + * Set the vmResourceGroup property: The ResourceGroup for the session hosts to be created in. It will default to + * the ResourceGroup of the hostpool if not provided. + * + * @param vmResourceGroup the vmResourceGroup value to set. + * @return the ActiveSessionHostConfigurationInner object itself. + */ + public ActiveSessionHostConfigurationInner withVmResourceGroup(String vmResourceGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new ActiveSessionHostConfigurationProperties(); + } + this.innerProperties().withVmResourceGroup(vmResourceGroup); + return this; + } + + /** + * Get the vmNamePrefix property: The prefix that should be associated with session host names. + * + * @return the vmNamePrefix value. + */ + public String vmNamePrefix() { + return this.innerProperties() == null ? null : this.innerProperties().vmNamePrefix(); + } + + /** + * Set the vmNamePrefix property: The prefix that should be associated with session host names. + * + * @param vmNamePrefix the vmNamePrefix value to set. + * @return the ActiveSessionHostConfigurationInner object itself. + */ + public ActiveSessionHostConfigurationInner withVmNamePrefix(String vmNamePrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new ActiveSessionHostConfigurationProperties(); + } + this.innerProperties().withVmNamePrefix(vmNamePrefix); + return this; + } + + /** + * Get the availabilityZones property: Value for availability zones to be used by the session host. Should be from + * [1,2,3]. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.innerProperties() == null ? null : this.innerProperties().availabilityZones(); + } + + /** + * Set the availabilityZones property: Value for availability zones to be used by the session host. Should be from + * [1,2,3]. + * + * @param availabilityZones the availabilityZones value to set. + * @return the ActiveSessionHostConfigurationInner object itself. + */ + public ActiveSessionHostConfigurationInner withAvailabilityZones(List availabilityZones) { + if (this.innerProperties() == null) { + this.innerProperties = new ActiveSessionHostConfigurationProperties(); + } + this.innerProperties().withAvailabilityZones(availabilityZones); + return this; + } + + /** + * Get the networkInfo property: Network information. + * + * @return the networkInfo value. + */ + public NetworkInfoProperties networkInfo() { + return this.innerProperties() == null ? null : this.innerProperties().networkInfo(); + } + + /** + * Set the networkInfo property: Network information. + * + * @param networkInfo the networkInfo value to set. + * @return the ActiveSessionHostConfigurationInner object itself. + */ + public ActiveSessionHostConfigurationInner withNetworkInfo(NetworkInfoProperties networkInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new ActiveSessionHostConfigurationProperties(); + } + this.innerProperties().withNetworkInfo(networkInfo); + return this; + } + + /** + * Get the vmSizeId property: The id of the size of a virtual machine connected to a hostpool. Example: + * Standard_D2as_v6. + * + * @return the vmSizeId value. + */ + public String vmSizeId() { + return this.innerProperties() == null ? null : this.innerProperties().vmSizeId(); + } + + /** + * Set the vmSizeId property: The id of the size of a virtual machine connected to a hostpool. Example: + * Standard_D2as_v6. + * + * @param vmSizeId the vmSizeId value to set. + * @return the ActiveSessionHostConfigurationInner object itself. + */ + public ActiveSessionHostConfigurationInner withVmSizeId(String vmSizeId) { + if (this.innerProperties() == null) { + this.innerProperties = new ActiveSessionHostConfigurationProperties(); + } + this.innerProperties().withVmSizeId(vmSizeId); + return this; + } + + /** + * Get the diskInfo property: Disk information. + * + * @return the diskInfo value. + */ + public DiskInfoProperties diskInfo() { + return this.innerProperties() == null ? null : this.innerProperties().diskInfo(); + } + + /** + * Set the diskInfo property: Disk information. + * + * @param diskInfo the diskInfo value to set. + * @return the ActiveSessionHostConfigurationInner object itself. + */ + public ActiveSessionHostConfigurationInner withDiskInfo(DiskInfoProperties diskInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new ActiveSessionHostConfigurationProperties(); + } + this.innerProperties().withDiskInfo(diskInfo); + return this; + } + + /** + * Get the customConfigurationScriptUrl property: The uri to the storage blob containing the arm template to be run + * on the virtual machine after provisioning. + * + * @return the customConfigurationScriptUrl value. + */ + public String customConfigurationScriptUrl() { + return this.innerProperties() == null ? null : this.innerProperties().customConfigurationScriptUrl(); + } + + /** + * Set the customConfigurationScriptUrl property: The uri to the storage blob containing the arm template to be run + * on the virtual machine after provisioning. + * + * @param customConfigurationScriptUrl the customConfigurationScriptUrl value to set. + * @return the ActiveSessionHostConfigurationInner object itself. + */ + public ActiveSessionHostConfigurationInner withCustomConfigurationScriptUrl(String customConfigurationScriptUrl) { + if (this.innerProperties() == null) { + this.innerProperties = new ActiveSessionHostConfigurationProperties(); + } + this.innerProperties().withCustomConfigurationScriptUrl(customConfigurationScriptUrl); + return this; + } + + /** + * Get the imageInfo property: Image configurations of HostPool. + * + * @return the imageInfo value. + */ + public ImageInfoProperties imageInfo() { + return this.innerProperties() == null ? null : this.innerProperties().imageInfo(); + } + + /** + * Set the imageInfo property: Image configurations of HostPool. + * + * @param imageInfo the imageInfo value to set. + * @return the ActiveSessionHostConfigurationInner object itself. + */ + public ActiveSessionHostConfigurationInner withImageInfo(ImageInfoProperties imageInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new ActiveSessionHostConfigurationProperties(); + } + this.innerProperties().withImageInfo(imageInfo); + return this; + } + + /** + * Get the domainInfo property: Domain configurations of session hosts. + * + * @return the domainInfo value. + */ + public DomainInfoProperties domainInfo() { + return this.innerProperties() == null ? null : this.innerProperties().domainInfo(); + } + + /** + * Set the domainInfo property: Domain configurations of session hosts. + * + * @param domainInfo the domainInfo value to set. + * @return the ActiveSessionHostConfigurationInner object itself. + */ + public ActiveSessionHostConfigurationInner withDomainInfo(DomainInfoProperties domainInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new ActiveSessionHostConfigurationProperties(); + } + this.innerProperties().withDomainInfo(domainInfo); + return this; + } + + /** + * Get the securityInfo property: Security information. + * + * @return the securityInfo value. + */ + public SecurityInfoProperties securityInfo() { + return this.innerProperties() == null ? null : this.innerProperties().securityInfo(); + } + + /** + * Set the securityInfo property: Security information. + * + * @param securityInfo the securityInfo value to set. + * @return the ActiveSessionHostConfigurationInner object itself. + */ + public ActiveSessionHostConfigurationInner withSecurityInfo(SecurityInfoProperties securityInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new ActiveSessionHostConfigurationProperties(); + } + this.innerProperties().withSecurityInfo(securityInfo); + return this; + } + + /** + * Get the vmAdminCredentials property: Local Admin credentials for session hosts. + * + * @return the vmAdminCredentials value. + */ + public KeyVaultCredentialsProperties vmAdminCredentials() { + return this.innerProperties() == null ? null : this.innerProperties().vmAdminCredentials(); + } + + /** + * Set the vmAdminCredentials property: Local Admin credentials for session hosts. + * + * @param vmAdminCredentials the vmAdminCredentials value to set. + * @return the ActiveSessionHostConfigurationInner object itself. + */ + public ActiveSessionHostConfigurationInner + withVmAdminCredentials(KeyVaultCredentialsProperties vmAdminCredentials) { + if (this.innerProperties() == null) { + this.innerProperties = new ActiveSessionHostConfigurationProperties(); + } + this.innerProperties().withVmAdminCredentials(vmAdminCredentials); + return this; + } + + /** + * Get the bootDiagnosticsInfo property: Boot Diagnostics information. + * + * @return the bootDiagnosticsInfo value. + */ + public BootDiagnosticsInfoProperties bootDiagnosticsInfo() { + return this.innerProperties() == null ? null : this.innerProperties().bootDiagnosticsInfo(); + } + + /** + * Set the bootDiagnosticsInfo property: Boot Diagnostics information. + * + * @param bootDiagnosticsInfo the bootDiagnosticsInfo value to set. + * @return the ActiveSessionHostConfigurationInner object itself. + */ + public ActiveSessionHostConfigurationInner + withBootDiagnosticsInfo(BootDiagnosticsInfoProperties bootDiagnosticsInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new ActiveSessionHostConfigurationProperties(); + } + this.innerProperties().withBootDiagnosticsInfo(bootDiagnosticsInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model ActiveSessionHostConfigurationInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ActiveSessionHostConfigurationInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActiveSessionHostConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActiveSessionHostConfigurationInner 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 ActiveSessionHostConfigurationInner. + */ + public static ActiveSessionHostConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActiveSessionHostConfigurationInner deserializedActiveSessionHostConfigurationInner + = new ActiveSessionHostConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedActiveSessionHostConfigurationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedActiveSessionHostConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedActiveSessionHostConfigurationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedActiveSessionHostConfigurationInner.innerProperties + = ActiveSessionHostConfigurationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedActiveSessionHostConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedActiveSessionHostConfigurationInner; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ActiveSessionHostConfigurationProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ActiveSessionHostConfigurationProperties.java new file mode 100644 index 000000000000..3df2374cff84 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ActiveSessionHostConfigurationProperties.java @@ -0,0 +1,595 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.models.BootDiagnosticsInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DiskInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DomainInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ImageInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.KeyVaultCredentialsProperties; +import com.azure.resourcemanager.desktopvirtualization.models.NetworkInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SecurityInfoProperties; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Session host configurations of HostPool. + */ +@Fluent +public final class ActiveSessionHostConfigurationProperties + implements JsonSerializable { + /* + * The timestamp of the last update. + */ + private OffsetDateTime version; + + /* + * Friendly name to describe this version of the SessionHostConfiguration. + */ + private String friendlyName; + + /* + * Hashtable that lists key/value pair tags to apply to the VMs + */ + private Map vmTags; + + /* + * The Location for the session host to be created in. It will default to the location of the hostpool if not + * provided. + */ + private String vmLocation; + + /* + * The ResourceGroup for the session hosts to be created in. It will default to the ResourceGroup of the hostpool if + * not provided. + */ + private String vmResourceGroup; + + /* + * The prefix that should be associated with session host names + */ + private String vmNamePrefix; + + /* + * Value for availability zones to be used by the session host. Should be from [1,2,3]. + */ + private List availabilityZones; + + /* + * Network information. + */ + private NetworkInfoProperties networkInfo; + + /* + * The id of the size of a virtual machine connected to a hostpool. Example: Standard_D2as_v6 + */ + private String vmSizeId; + + /* + * Disk information. + */ + private DiskInfoProperties diskInfo; + + /* + * The uri to the storage blob containing the arm template to be run on the virtual machine after provisioning. + */ + private String customConfigurationScriptUrl; + + /* + * Image configurations of HostPool. + */ + private ImageInfoProperties imageInfo; + + /* + * Domain configurations of session hosts. + */ + private DomainInfoProperties domainInfo; + + /* + * Security information. + */ + private SecurityInfoProperties securityInfo; + + /* + * Local Admin credentials for session hosts. + */ + private KeyVaultCredentialsProperties vmAdminCredentials; + + /* + * Boot Diagnostics information. + */ + private BootDiagnosticsInfoProperties bootDiagnosticsInfo; + + /** + * Creates an instance of ActiveSessionHostConfigurationProperties class. + */ + public ActiveSessionHostConfigurationProperties() { + } + + /** + * Get the version property: The timestamp of the last update. + * + * @return the version value. + */ + public OffsetDateTime version() { + return this.version; + } + + /** + * Get the friendlyName property: Friendly name to describe this version of the SessionHostConfiguration. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name to describe this version of the SessionHostConfiguration. + * + * @param friendlyName the friendlyName value to set. + * @return the ActiveSessionHostConfigurationProperties object itself. + */ + public ActiveSessionHostConfigurationProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the vmTags property: Hashtable that lists key/value pair tags to apply to the VMs. + * + * @return the vmTags value. + */ + public Map vmTags() { + return this.vmTags; + } + + /** + * Set the vmTags property: Hashtable that lists key/value pair tags to apply to the VMs. + * + * @param vmTags the vmTags value to set. + * @return the ActiveSessionHostConfigurationProperties object itself. + */ + public ActiveSessionHostConfigurationProperties withVmTags(Map vmTags) { + this.vmTags = vmTags; + return this; + } + + /** + * Get the vmLocation property: The Location for the session host to be created in. It will default to the location + * of the hostpool if not provided. + * + * @return the vmLocation value. + */ + public String vmLocation() { + return this.vmLocation; + } + + /** + * Set the vmLocation property: The Location for the session host to be created in. It will default to the location + * of the hostpool if not provided. + * + * @param vmLocation the vmLocation value to set. + * @return the ActiveSessionHostConfigurationProperties object itself. + */ + public ActiveSessionHostConfigurationProperties withVmLocation(String vmLocation) { + this.vmLocation = vmLocation; + return this; + } + + /** + * Get the vmResourceGroup property: The ResourceGroup for the session hosts to be created in. It will default to + * the ResourceGroup of the hostpool if not provided. + * + * @return the vmResourceGroup value. + */ + public String vmResourceGroup() { + return this.vmResourceGroup; + } + + /** + * Set the vmResourceGroup property: The ResourceGroup for the session hosts to be created in. It will default to + * the ResourceGroup of the hostpool if not provided. + * + * @param vmResourceGroup the vmResourceGroup value to set. + * @return the ActiveSessionHostConfigurationProperties object itself. + */ + public ActiveSessionHostConfigurationProperties withVmResourceGroup(String vmResourceGroup) { + this.vmResourceGroup = vmResourceGroup; + return this; + } + + /** + * Get the vmNamePrefix property: The prefix that should be associated with session host names. + * + * @return the vmNamePrefix value. + */ + public String vmNamePrefix() { + return this.vmNamePrefix; + } + + /** + * Set the vmNamePrefix property: The prefix that should be associated with session host names. + * + * @param vmNamePrefix the vmNamePrefix value to set. + * @return the ActiveSessionHostConfigurationProperties object itself. + */ + public ActiveSessionHostConfigurationProperties withVmNamePrefix(String vmNamePrefix) { + this.vmNamePrefix = vmNamePrefix; + return this; + } + + /** + * Get the availabilityZones property: Value for availability zones to be used by the session host. Should be from + * [1,2,3]. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.availabilityZones; + } + + /** + * Set the availabilityZones property: Value for availability zones to be used by the session host. Should be from + * [1,2,3]. + * + * @param availabilityZones the availabilityZones value to set. + * @return the ActiveSessionHostConfigurationProperties object itself. + */ + public ActiveSessionHostConfigurationProperties withAvailabilityZones(List availabilityZones) { + this.availabilityZones = availabilityZones; + return this; + } + + /** + * Get the networkInfo property: Network information. + * + * @return the networkInfo value. + */ + public NetworkInfoProperties networkInfo() { + return this.networkInfo; + } + + /** + * Set the networkInfo property: Network information. + * + * @param networkInfo the networkInfo value to set. + * @return the ActiveSessionHostConfigurationProperties object itself. + */ + public ActiveSessionHostConfigurationProperties withNetworkInfo(NetworkInfoProperties networkInfo) { + this.networkInfo = networkInfo; + return this; + } + + /** + * Get the vmSizeId property: The id of the size of a virtual machine connected to a hostpool. Example: + * Standard_D2as_v6. + * + * @return the vmSizeId value. + */ + public String vmSizeId() { + return this.vmSizeId; + } + + /** + * Set the vmSizeId property: The id of the size of a virtual machine connected to a hostpool. Example: + * Standard_D2as_v6. + * + * @param vmSizeId the vmSizeId value to set. + * @return the ActiveSessionHostConfigurationProperties object itself. + */ + public ActiveSessionHostConfigurationProperties withVmSizeId(String vmSizeId) { + this.vmSizeId = vmSizeId; + return this; + } + + /** + * Get the diskInfo property: Disk information. + * + * @return the diskInfo value. + */ + public DiskInfoProperties diskInfo() { + return this.diskInfo; + } + + /** + * Set the diskInfo property: Disk information. + * + * @param diskInfo the diskInfo value to set. + * @return the ActiveSessionHostConfigurationProperties object itself. + */ + public ActiveSessionHostConfigurationProperties withDiskInfo(DiskInfoProperties diskInfo) { + this.diskInfo = diskInfo; + return this; + } + + /** + * Get the customConfigurationScriptUrl property: The uri to the storage blob containing the arm template to be run + * on the virtual machine after provisioning. + * + * @return the customConfigurationScriptUrl value. + */ + public String customConfigurationScriptUrl() { + return this.customConfigurationScriptUrl; + } + + /** + * Set the customConfigurationScriptUrl property: The uri to the storage blob containing the arm template to be run + * on the virtual machine after provisioning. + * + * @param customConfigurationScriptUrl the customConfigurationScriptUrl value to set. + * @return the ActiveSessionHostConfigurationProperties object itself. + */ + public ActiveSessionHostConfigurationProperties + withCustomConfigurationScriptUrl(String customConfigurationScriptUrl) { + this.customConfigurationScriptUrl = customConfigurationScriptUrl; + return this; + } + + /** + * Get the imageInfo property: Image configurations of HostPool. + * + * @return the imageInfo value. + */ + public ImageInfoProperties imageInfo() { + return this.imageInfo; + } + + /** + * Set the imageInfo property: Image configurations of HostPool. + * + * @param imageInfo the imageInfo value to set. + * @return the ActiveSessionHostConfigurationProperties object itself. + */ + public ActiveSessionHostConfigurationProperties withImageInfo(ImageInfoProperties imageInfo) { + this.imageInfo = imageInfo; + return this; + } + + /** + * Get the domainInfo property: Domain configurations of session hosts. + * + * @return the domainInfo value. + */ + public DomainInfoProperties domainInfo() { + return this.domainInfo; + } + + /** + * Set the domainInfo property: Domain configurations of session hosts. + * + * @param domainInfo the domainInfo value to set. + * @return the ActiveSessionHostConfigurationProperties object itself. + */ + public ActiveSessionHostConfigurationProperties withDomainInfo(DomainInfoProperties domainInfo) { + this.domainInfo = domainInfo; + return this; + } + + /** + * Get the securityInfo property: Security information. + * + * @return the securityInfo value. + */ + public SecurityInfoProperties securityInfo() { + return this.securityInfo; + } + + /** + * Set the securityInfo property: Security information. + * + * @param securityInfo the securityInfo value to set. + * @return the ActiveSessionHostConfigurationProperties object itself. + */ + public ActiveSessionHostConfigurationProperties withSecurityInfo(SecurityInfoProperties securityInfo) { + this.securityInfo = securityInfo; + return this; + } + + /** + * Get the vmAdminCredentials property: Local Admin credentials for session hosts. + * + * @return the vmAdminCredentials value. + */ + public KeyVaultCredentialsProperties vmAdminCredentials() { + return this.vmAdminCredentials; + } + + /** + * Set the vmAdminCredentials property: Local Admin credentials for session hosts. + * + * @param vmAdminCredentials the vmAdminCredentials value to set. + * @return the ActiveSessionHostConfigurationProperties object itself. + */ + public ActiveSessionHostConfigurationProperties + withVmAdminCredentials(KeyVaultCredentialsProperties vmAdminCredentials) { + this.vmAdminCredentials = vmAdminCredentials; + return this; + } + + /** + * Get the bootDiagnosticsInfo property: Boot Diagnostics information. + * + * @return the bootDiagnosticsInfo value. + */ + public BootDiagnosticsInfoProperties bootDiagnosticsInfo() { + return this.bootDiagnosticsInfo; + } + + /** + * Set the bootDiagnosticsInfo property: Boot Diagnostics information. + * + * @param bootDiagnosticsInfo the bootDiagnosticsInfo value to set. + * @return the ActiveSessionHostConfigurationProperties object itself. + */ + public ActiveSessionHostConfigurationProperties + withBootDiagnosticsInfo(BootDiagnosticsInfoProperties bootDiagnosticsInfo) { + this.bootDiagnosticsInfo = bootDiagnosticsInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vmNamePrefix() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property vmNamePrefix in model ActiveSessionHostConfigurationProperties")); + } + if (networkInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property networkInfo in model ActiveSessionHostConfigurationProperties")); + } else { + networkInfo().validate(); + } + if (vmSizeId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property vmSizeId in model ActiveSessionHostConfigurationProperties")); + } + if (diskInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property diskInfo in model ActiveSessionHostConfigurationProperties")); + } else { + diskInfo().validate(); + } + if (imageInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property imageInfo in model ActiveSessionHostConfigurationProperties")); + } else { + imageInfo().validate(); + } + if (domainInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property domainInfo in model ActiveSessionHostConfigurationProperties")); + } else { + domainInfo().validate(); + } + if (securityInfo() != null) { + securityInfo().validate(); + } + if (vmAdminCredentials() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property vmAdminCredentials in model ActiveSessionHostConfigurationProperties")); + } else { + vmAdminCredentials().validate(); + } + if (bootDiagnosticsInfo() != null) { + bootDiagnosticsInfo().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ActiveSessionHostConfigurationProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vmNamePrefix", this.vmNamePrefix); + jsonWriter.writeJsonField("networkInfo", this.networkInfo); + jsonWriter.writeStringField("vmSizeId", this.vmSizeId); + jsonWriter.writeJsonField("diskInfo", this.diskInfo); + jsonWriter.writeJsonField("imageInfo", this.imageInfo); + jsonWriter.writeJsonField("domainInfo", this.domainInfo); + jsonWriter.writeJsonField("vmAdminCredentials", this.vmAdminCredentials); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeMapField("vmTags", this.vmTags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("vmLocation", this.vmLocation); + jsonWriter.writeStringField("vmResourceGroup", this.vmResourceGroup); + jsonWriter.writeArrayField("availabilityZones", this.availabilityZones, + (writer, element) -> writer.writeInt(element)); + jsonWriter.writeStringField("customConfigurationScriptUrl", this.customConfigurationScriptUrl); + jsonWriter.writeJsonField("securityInfo", this.securityInfo); + jsonWriter.writeJsonField("bootDiagnosticsInfo", this.bootDiagnosticsInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActiveSessionHostConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActiveSessionHostConfigurationProperties 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 ActiveSessionHostConfigurationProperties. + */ + public static ActiveSessionHostConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActiveSessionHostConfigurationProperties deserializedActiveSessionHostConfigurationProperties + = new ActiveSessionHostConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmNamePrefix".equals(fieldName)) { + deserializedActiveSessionHostConfigurationProperties.vmNamePrefix = reader.getString(); + } else if ("networkInfo".equals(fieldName)) { + deserializedActiveSessionHostConfigurationProperties.networkInfo + = NetworkInfoProperties.fromJson(reader); + } else if ("vmSizeId".equals(fieldName)) { + deserializedActiveSessionHostConfigurationProperties.vmSizeId = reader.getString(); + } else if ("diskInfo".equals(fieldName)) { + deserializedActiveSessionHostConfigurationProperties.diskInfo = DiskInfoProperties.fromJson(reader); + } else if ("imageInfo".equals(fieldName)) { + deserializedActiveSessionHostConfigurationProperties.imageInfo + = ImageInfoProperties.fromJson(reader); + } else if ("domainInfo".equals(fieldName)) { + deserializedActiveSessionHostConfigurationProperties.domainInfo + = DomainInfoProperties.fromJson(reader); + } else if ("vmAdminCredentials".equals(fieldName)) { + deserializedActiveSessionHostConfigurationProperties.vmAdminCredentials + = KeyVaultCredentialsProperties.fromJson(reader); + } else if ("version".equals(fieldName)) { + deserializedActiveSessionHostConfigurationProperties.version = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("friendlyName".equals(fieldName)) { + deserializedActiveSessionHostConfigurationProperties.friendlyName = reader.getString(); + } else if ("vmTags".equals(fieldName)) { + Map vmTags = reader.readMap(reader1 -> reader1.getString()); + deserializedActiveSessionHostConfigurationProperties.vmTags = vmTags; + } else if ("vmLocation".equals(fieldName)) { + deserializedActiveSessionHostConfigurationProperties.vmLocation = reader.getString(); + } else if ("vmResourceGroup".equals(fieldName)) { + deserializedActiveSessionHostConfigurationProperties.vmResourceGroup = reader.getString(); + } else if ("availabilityZones".equals(fieldName)) { + List availabilityZones = reader.readArray(reader1 -> reader1.getInt()); + deserializedActiveSessionHostConfigurationProperties.availabilityZones = availabilityZones; + } else if ("customConfigurationScriptUrl".equals(fieldName)) { + deserializedActiveSessionHostConfigurationProperties.customConfigurationScriptUrl + = reader.getString(); + } else if ("securityInfo".equals(fieldName)) { + deserializedActiveSessionHostConfigurationProperties.securityInfo + = SecurityInfoProperties.fromJson(reader); + } else if ("bootDiagnosticsInfo".equals(fieldName)) { + deserializedActiveSessionHostConfigurationProperties.bootDiagnosticsInfo + = BootDiagnosticsInfoProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedActiveSessionHostConfigurationProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupInner.java index 0ebffdecc946..7b7c756c4bdb 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupInner.java @@ -11,10 +11,10 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupType; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedServiceIdentity; +import com.azure.resourcemanager.desktopvirtualization.models.Plan; import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySet; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku; +import com.azure.resourcemanager.desktopvirtualization.models.Sku; import java.io.IOException; import java.util.Map; @@ -146,7 +146,7 @@ public ApplicationGroupInner withKind(String kind) { * {@inheritDoc} */ @Override - public ApplicationGroupInner withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { + public ApplicationGroupInner withIdentity(ManagedServiceIdentity identity) { super.withIdentity(identity); return this; } @@ -155,7 +155,7 @@ public ApplicationGroupInner withIdentity(ResourceModelWithAllowedPropertySetIde * {@inheritDoc} */ @Override - public ApplicationGroupInner withSku(ResourceModelWithAllowedPropertySetSku sku) { + public ApplicationGroupInner withSku(Sku sku) { super.withSku(sku); return this; } @@ -164,7 +164,7 @@ public ApplicationGroupInner withSku(ResourceModelWithAllowedPropertySetSku sku) * {@inheritDoc} */ @Override - public ApplicationGroupInner withPlan(ResourceModelWithAllowedPropertySetPlan plan) { + public ApplicationGroupInner withPlan(Plan plan) { super.withPlan(plan); return this; } @@ -407,13 +407,11 @@ public static ApplicationGroupInner fromJson(JsonReader jsonReader) throws IOExc } else if ("etag".equals(fieldName)) { deserializedApplicationGroupInner.etag = reader.getString(); } else if ("identity".equals(fieldName)) { - deserializedApplicationGroupInner - .withIdentity(ResourceModelWithAllowedPropertySetIdentity.fromJson(reader)); + deserializedApplicationGroupInner.withIdentity(ManagedServiceIdentity.fromJson(reader)); } else if ("sku".equals(fieldName)) { - deserializedApplicationGroupInner.withSku(ResourceModelWithAllowedPropertySetSku.fromJson(reader)); + deserializedApplicationGroupInner.withSku(Sku.fromJson(reader)); } else if ("plan".equals(fieldName)) { - deserializedApplicationGroupInner - .withPlan(ResourceModelWithAllowedPropertySetPlan.fromJson(reader)); + deserializedApplicationGroupInner.withPlan(Plan.fromJson(reader)); } else if ("systemData".equals(fieldName)) { deserializedApplicationGroupInner.systemData = SystemData.fromJson(reader); } else if ("properties".equals(fieldName)) { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ExpandMsixImageInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ExpandMsixImageInner.java index e5d7fce17dc0..8b0785898d82 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ExpandMsixImageInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ExpandMsixImageInner.java @@ -333,7 +333,7 @@ public ExpandMsixImageInner withPackageDependencies(List packageDependencies; /* - * Package version found in the appxmanifest.xml. + * Package Version found in the appxmanifest.xml. */ private String version; @@ -306,7 +306,7 @@ public ExpandMsixImageProperties withPackageDependencies(List privateEndpointConnections() { return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); } + /** + * Get the managedPrivateUdp property: Default: AVD-wide settings are used to determine connection availability, + * Enabled: UDP will attempt this connection type when making connections. This means that this connection is + * possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP + * will not attempt this connection type when making connections. + * + * @return the managedPrivateUdp value. + */ + public ManagedPrivateUdp managedPrivateUdp() { + return this.innerProperties() == null ? null : this.innerProperties().managedPrivateUdp(); + } + + /** + * Set the managedPrivateUdp property: Default: AVD-wide settings are used to determine connection availability, + * Enabled: UDP will attempt this connection type when making connections. This means that this connection is + * possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP + * will not attempt this connection type when making connections. + * + * @param managedPrivateUdp the managedPrivateUdp value to set. + * @return the HostPoolInner object itself. + */ + public HostPoolInner withManagedPrivateUdp(ManagedPrivateUdp managedPrivateUdp) { + if (this.innerProperties() == null) { + this.innerProperties = new HostPoolPropertiesInner(); + } + this.innerProperties().withManagedPrivateUdp(managedPrivateUdp); + return this; + } + + /** + * Get the directUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: + * UDP will attempt this connection type when making connections. This means that this connection is possible, but + * is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not + * attempt this connection type when making connections. + * + * @return the directUdp value. + */ + public DirectUdp directUdp() { + return this.innerProperties() == null ? null : this.innerProperties().directUdp(); + } + + /** + * Set the directUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: + * UDP will attempt this connection type when making connections. This means that this connection is possible, but + * is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not + * attempt this connection type when making connections. + * + * @param directUdp the directUdp value to set. + * @return the HostPoolInner object itself. + */ + public HostPoolInner withDirectUdp(DirectUdp directUdp) { + if (this.innerProperties() == null) { + this.innerProperties = new HostPoolPropertiesInner(); + } + this.innerProperties().withDirectUdp(directUdp); + return this; + } + + /** + * Get the publicUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: + * UDP will attempt this connection type when making connections. This means that this connection is possible, but + * is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not + * attempt this connection type when making connections. + * + * @return the publicUdp value. + */ + public PublicUdp publicUdp() { + return this.innerProperties() == null ? null : this.innerProperties().publicUdp(); + } + + /** + * Set the publicUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: + * UDP will attempt this connection type when making connections. This means that this connection is possible, but + * is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not + * attempt this connection type when making connections. + * + * @param publicUdp the publicUdp value to set. + * @return the HostPoolInner object itself. + */ + public HostPoolInner withPublicUdp(PublicUdp publicUdp) { + if (this.innerProperties() == null) { + this.innerProperties = new HostPoolPropertiesInner(); + } + this.innerProperties().withPublicUdp(publicUdp); + return this; + } + + /** + * Get the relayUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: UDP + * will attempt this connection type when making connections. This means that this connection is possible, but is + * not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt + * this connection type when making connections. + * + * @return the relayUdp value. + */ + public RelayUdp relayUdp() { + return this.innerProperties() == null ? null : this.innerProperties().relayUdp(); + } + + /** + * Set the relayUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: UDP + * will attempt this connection type when making connections. This means that this connection is possible, but is + * not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt + * this connection type when making connections. + * + * @param relayUdp the relayUdp value to set. + * @return the HostPoolInner object itself. + */ + public HostPoolInner withRelayUdp(RelayUdp relayUdp) { + if (this.innerProperties() == null) { + this.innerProperties = new HostPoolPropertiesInner(); + } + this.innerProperties().withRelayUdp(relayUdp); + return this; + } + /** * Validates the instance. * @@ -764,12 +912,11 @@ public static HostPoolInner fromJson(JsonReader jsonReader) throws IOException { } else if ("etag".equals(fieldName)) { deserializedHostPoolInner.etag = reader.getString(); } else if ("identity".equals(fieldName)) { - deserializedHostPoolInner - .withIdentity(ResourceModelWithAllowedPropertySetIdentity.fromJson(reader)); + deserializedHostPoolInner.withIdentity(ManagedServiceIdentity.fromJson(reader)); } else if ("sku".equals(fieldName)) { - deserializedHostPoolInner.withSku(ResourceModelWithAllowedPropertySetSku.fromJson(reader)); + deserializedHostPoolInner.withSku(Sku.fromJson(reader)); } else if ("plan".equals(fieldName)) { - deserializedHostPoolInner.withPlan(ResourceModelWithAllowedPropertySetPlan.fromJson(reader)); + deserializedHostPoolInner.withPlan(Plan.fromJson(reader)); } else if ("systemData".equals(fieldName)) { deserializedHostPoolInner.systemData = SystemData.fromJson(reader); } else if ("properties".equals(fieldName)) { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolPatchProperties.java index 170daf5df4b8..3a554918d65b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolPatchProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolPatchProperties.java @@ -10,11 +10,15 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.AgentUpdatePatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DirectUdp; import com.azure.resourcemanager.desktopvirtualization.models.HostpoolPublicNetworkAccess; import com.azure.resourcemanager.desktopvirtualization.models.LoadBalancerType; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedPrivateUdp; import com.azure.resourcemanager.desktopvirtualization.models.PersonalDesktopAssignmentType; import com.azure.resourcemanager.desktopvirtualization.models.PreferredAppGroupType; +import com.azure.resourcemanager.desktopvirtualization.models.PublicUdp; import com.azure.resourcemanager.desktopvirtualization.models.RegistrationInfoPatch; +import com.azure.resourcemanager.desktopvirtualization.models.RelayUdp; import com.azure.resourcemanager.desktopvirtualization.models.SsoSecretType; import java.io.IOException; @@ -64,7 +68,8 @@ public final class HostPoolPatchProperties implements JsonSerializable privateEndpointConnections; + /* + * Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this + * connection type when making connections. This means that this connection is possible, but is not guaranteed, as + * there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection + * type when making connections + */ + private ManagedPrivateUdp managedPrivateUdp; + + /* + * Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this + * connection type when making connections. This means that this connection is possible, but is not guaranteed, as + * there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection + * type when making connections + */ + private DirectUdp directUdp; + + /* + * Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this + * connection type when making connections. This means that this connection is possible, but is not guaranteed, as + * there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection + * type when making connections + */ + private PublicUdp publicUdp; + + /* + * Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this + * connection type when making connections. This means that this connection is possible, but is not guaranteed, as + * there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection + * type when making connections + */ + private RelayUdp relayUdp; + /** * Creates an instance of HostPoolPropertiesInner class. */ @@ -344,7 +387,8 @@ public HostPoolPropertiesInner withValidationEnvironment(Boolean validationEnvir } /** - * Get the registrationInfo property: The registration info of HostPool. + * Get the registrationInfo property: The registration info of HostPool. This is not returned on GET. In order to + * get the registration token use the retrieveRegistrationToken or listRegistrationTokens POST calls. * * @return the registrationInfo value. */ @@ -353,7 +397,8 @@ public RegistrationInfoInner registrationInfo() { } /** - * Set the registrationInfo property: The registration info of HostPool. + * Set the registrationInfo property: The registration info of HostPool. This is not returned on GET. In order to + * get the registration token use the retrieveRegistrationToken or listRegistrationTokens POST calls. * * @param registrationInfo the registrationInfo value to set. * @return the HostPoolPropertiesInner object itself. @@ -383,6 +428,28 @@ public HostPoolPropertiesInner withVmTemplate(String vmTemplate) { return this; } + /** + * Get the managementType property: The type of management for this hostpool, Automated or Standard. The default + * value is Automated. + * + * @return the managementType value. + */ + public ManagementType managementType() { + return this.managementType; + } + + /** + * Set the managementType property: The type of management for this hostpool, Automated or Standard. The default + * value is Automated. + * + * @param managementType the managementType value to set. + * @return the HostPoolPropertiesInner object itself. + */ + public HostPoolPropertiesInner withManagementType(ManagementType managementType) { + this.managementType = managementType; + return this; + } + /** * Get the applicationGroupReferences property: List of applicationGroup links. * @@ -588,6 +655,110 @@ public List privateEndpointConnections() { return this.privateEndpointConnections; } + /** + * Get the managedPrivateUdp property: Default: AVD-wide settings are used to determine connection availability, + * Enabled: UDP will attempt this connection type when making connections. This means that this connection is + * possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP + * will not attempt this connection type when making connections. + * + * @return the managedPrivateUdp value. + */ + public ManagedPrivateUdp managedPrivateUdp() { + return this.managedPrivateUdp; + } + + /** + * Set the managedPrivateUdp property: Default: AVD-wide settings are used to determine connection availability, + * Enabled: UDP will attempt this connection type when making connections. This means that this connection is + * possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP + * will not attempt this connection type when making connections. + * + * @param managedPrivateUdp the managedPrivateUdp value to set. + * @return the HostPoolPropertiesInner object itself. + */ + public HostPoolPropertiesInner withManagedPrivateUdp(ManagedPrivateUdp managedPrivateUdp) { + this.managedPrivateUdp = managedPrivateUdp; + return this; + } + + /** + * Get the directUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: + * UDP will attempt this connection type when making connections. This means that this connection is possible, but + * is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not + * attempt this connection type when making connections. + * + * @return the directUdp value. + */ + public DirectUdp directUdp() { + return this.directUdp; + } + + /** + * Set the directUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: + * UDP will attempt this connection type when making connections. This means that this connection is possible, but + * is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not + * attempt this connection type when making connections. + * + * @param directUdp the directUdp value to set. + * @return the HostPoolPropertiesInner object itself. + */ + public HostPoolPropertiesInner withDirectUdp(DirectUdp directUdp) { + this.directUdp = directUdp; + return this; + } + + /** + * Get the publicUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: + * UDP will attempt this connection type when making connections. This means that this connection is possible, but + * is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not + * attempt this connection type when making connections. + * + * @return the publicUdp value. + */ + public PublicUdp publicUdp() { + return this.publicUdp; + } + + /** + * Set the publicUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: + * UDP will attempt this connection type when making connections. This means that this connection is possible, but + * is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not + * attempt this connection type when making connections. + * + * @param publicUdp the publicUdp value to set. + * @return the HostPoolPropertiesInner object itself. + */ + public HostPoolPropertiesInner withPublicUdp(PublicUdp publicUdp) { + this.publicUdp = publicUdp; + return this; + } + + /** + * Get the relayUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: UDP + * will attempt this connection type when making connections. This means that this connection is possible, but is + * not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt + * this connection type when making connections. + * + * @return the relayUdp value. + */ + public RelayUdp relayUdp() { + return this.relayUdp; + } + + /** + * Set the relayUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: UDP + * will attempt this connection type when making connections. This means that this connection is possible, but is + * not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt + * this connection type when making connections. + * + * @param relayUdp the relayUdp value to set. + * @return the HostPoolPropertiesInner object itself. + */ + public HostPoolPropertiesInner withRelayUdp(RelayUdp relayUdp) { + this.relayUdp = relayUdp; + return this; + } + /** * Validates the instance. * @@ -643,6 +814,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeBooleanField("validationEnvironment", this.validationEnvironment); jsonWriter.writeJsonField("registrationInfo", this.registrationInfo); jsonWriter.writeStringField("vmTemplate", this.vmTemplate); + jsonWriter.writeStringField("managementType", + this.managementType == null ? null : this.managementType.toString()); jsonWriter.writeStringField("ssoadfsAuthority", this.ssoadfsAuthority); jsonWriter.writeStringField("ssoClientId", this.ssoClientId); jsonWriter.writeStringField("ssoClientSecretKeyVaultPath", this.ssoClientSecretKeyVaultPath); @@ -651,6 +824,11 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("publicNetworkAccess", this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); jsonWriter.writeJsonField("agentUpdate", this.agentUpdate); + jsonWriter.writeStringField("managedPrivateUDP", + this.managedPrivateUdp == null ? null : this.managedPrivateUdp.toString()); + jsonWriter.writeStringField("directUDP", this.directUdp == null ? null : this.directUdp.toString()); + jsonWriter.writeStringField("publicUDP", this.publicUdp == null ? null : this.publicUdp.toString()); + jsonWriter.writeStringField("relayUDP", this.relayUdp == null ? null : this.relayUdp.toString()); return jsonWriter.writeEndObject(); } @@ -700,6 +878,8 @@ public static HostPoolPropertiesInner fromJson(JsonReader jsonReader) throws IOE deserializedHostPoolPropertiesInner.registrationInfo = RegistrationInfoInner.fromJson(reader); } else if ("vmTemplate".equals(fieldName)) { deserializedHostPoolPropertiesInner.vmTemplate = reader.getString(); + } else if ("managementType".equals(fieldName)) { + deserializedHostPoolPropertiesInner.managementType = ManagementType.fromString(reader.getString()); } else if ("applicationGroupReferences".equals(fieldName)) { List applicationGroupReferences = reader.readArray(reader1 -> reader1.getString()); deserializedHostPoolPropertiesInner.applicationGroupReferences = applicationGroupReferences; @@ -727,6 +907,15 @@ public static HostPoolPropertiesInner fromJson(JsonReader jsonReader) throws IOE List privateEndpointConnections = reader.readArray(reader1 -> PrivateEndpointConnection.fromJson(reader1)); deserializedHostPoolPropertiesInner.privateEndpointConnections = privateEndpointConnections; + } else if ("managedPrivateUDP".equals(fieldName)) { + deserializedHostPoolPropertiesInner.managedPrivateUdp + = ManagedPrivateUdp.fromString(reader.getString()); + } else if ("directUDP".equals(fieldName)) { + deserializedHostPoolPropertiesInner.directUdp = DirectUdp.fromString(reader.getString()); + } else if ("publicUDP".equals(fieldName)) { + deserializedHostPoolPropertiesInner.publicUdp = PublicUdp.fromString(reader.getString()); + } else if ("relayUDP".equals(fieldName)) { + deserializedHostPoolPropertiesInner.relayUdp = RelayUdp.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageInner.java index 35af92687897..10dca45a49dd 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageInner.java @@ -288,7 +288,7 @@ public MsixPackageInner withPackageDependencies(List pa } /** - * Get the version property: Package version found in the appxmanifest.xml. + * Get the version property: Package Version found in the appxmanifest.xml. * * @return the version value. */ @@ -297,7 +297,7 @@ public String version() { } /** - * Set the version property: Package version found in the appxmanifest.xml. + * Set the version property: Package Version found in the appxmanifest.xml. * * @param version the version value to set. * @return the MsixPackageInner object itself. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageProperties.java index e2f6d8ce77b1..06ba27f0e46d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageProperties.java @@ -63,7 +63,7 @@ public final class MsixPackageProperties implements JsonSerializable packageDependencies; /* - * Package version found in the appxmanifest.xml. + * Package Version found in the appxmanifest.xml. */ private String version; @@ -246,7 +246,7 @@ public MsixPackageProperties withPackageDependencies(List { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanInner.java index 0bb60c207fb4..a8fcb7a8b470 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanInner.java @@ -10,13 +10,13 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedServiceIdentity; +import com.azure.resourcemanager.desktopvirtualization.models.Plan; import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySet; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku; import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolReference; import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolType; import com.azure.resourcemanager.desktopvirtualization.models.ScalingSchedule; +import com.azure.resourcemanager.desktopvirtualization.models.Sku; import java.io.IOException; import java.util.List; import java.util.Map; @@ -151,7 +151,7 @@ public ScalingPlanInner withKind(String kind) { * {@inheritDoc} */ @Override - public ScalingPlanInner withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { + public ScalingPlanInner withIdentity(ManagedServiceIdentity identity) { super.withIdentity(identity); return this; } @@ -160,7 +160,7 @@ public ScalingPlanInner withIdentity(ResourceModelWithAllowedPropertySetIdentity * {@inheritDoc} */ @Override - public ScalingPlanInner withSku(ResourceModelWithAllowedPropertySetSku sku) { + public ScalingPlanInner withSku(Sku sku) { super.withSku(sku); return this; } @@ -169,7 +169,7 @@ public ScalingPlanInner withSku(ResourceModelWithAllowedPropertySetSku sku) { * {@inheritDoc} */ @Override - public ScalingPlanInner withPlan(ResourceModelWithAllowedPropertySetPlan plan) { + public ScalingPlanInner withPlan(Plan plan) { super.withPlan(plan); return this; } @@ -317,7 +317,7 @@ public ScalingPlanInner withExclusionTag(String exclusionTag) { } /** - * Get the schedules property: List of ScalingPlanPooledSchedule definitions. + * Get the schedules property: List of Pooled ScalingSchedule definitions. * * @return the schedules value. */ @@ -326,7 +326,7 @@ public List schedules() { } /** - * Set the schedules property: List of ScalingPlanPooledSchedule definitions. + * Set the schedules property: List of Pooled ScalingSchedule definitions. * * @param schedules the schedules value to set. * @return the ScalingPlanInner object itself. @@ -440,12 +440,11 @@ public static ScalingPlanInner fromJson(JsonReader jsonReader) throws IOExceptio } else if ("etag".equals(fieldName)) { deserializedScalingPlanInner.etag = reader.getString(); } else if ("identity".equals(fieldName)) { - deserializedScalingPlanInner - .withIdentity(ResourceModelWithAllowedPropertySetIdentity.fromJson(reader)); + deserializedScalingPlanInner.withIdentity(ManagedServiceIdentity.fromJson(reader)); } else if ("sku".equals(fieldName)) { - deserializedScalingPlanInner.withSku(ResourceModelWithAllowedPropertySetSku.fromJson(reader)); + deserializedScalingPlanInner.withSku(Sku.fromJson(reader)); } else if ("plan".equals(fieldName)) { - deserializedScalingPlanInner.withPlan(ResourceModelWithAllowedPropertySetPlan.fromJson(reader)); + deserializedScalingPlanInner.withPlan(Plan.fromJson(reader)); } else if ("systemData".equals(fieldName)) { deserializedScalingPlanInner.systemData = SystemData.fromJson(reader); } else if ("properties".equals(fieldName)) { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPatchProperties.java index ee719f82bc8f..93c62fee5f92 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPatchProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPatchProperties.java @@ -40,7 +40,7 @@ public final class ScalingPlanPatchProperties implements JsonSerializable schedules; @@ -136,7 +136,7 @@ public ScalingPlanPatchProperties withExclusionTag(String exclusionTag) { } /** - * Get the schedules property: List of ScalingSchedule definitions. + * Get the schedules property: List Pooled ScalingSchedule definitions. * * @return the schedules value. */ @@ -145,7 +145,7 @@ public List schedules() { } /** - * Set the schedules property: List of ScalingSchedule definitions. + * Set the schedules property: List Pooled ScalingSchedule definitions. * * @param schedules the schedules value to set. * @return the ScalingPlanPatchProperties object itself. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalSchedulePatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalSchedulePatchProperties.java new file mode 100644 index 000000000000..012b99615313 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalSchedulePatchProperties.java @@ -0,0 +1,909 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent.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 com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; +import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; +import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; +import com.azure.resourcemanager.desktopvirtualization.models.Time; +import java.io.IOException; +import java.util.List; + +/** + * A ScalingPlanPersonalSchedule. + */ +@Fluent +public final class ScalingPlanPersonalSchedulePatchProperties + implements JsonSerializable { + /* + * Set of days of the week on which this schedule is active. + */ + private List daysOfWeek; + + /* + * Starting time for ramp up period. + */ + private Time rampUpStartTime; + + /* + * The desired startup behavior during the ramp up period for personal vms in the hostpool. + */ + private StartupBehavior rampUpAutoStartHosts; + + /* + * The desired configuration of Start VM On Connect for the hostpool during the ramp up phase. If this is disabled, + * session hosts must be turned on using rampUpAutoStartHosts or by turning them on manually. + */ + private SetStartVMOnConnect rampUpStartVMOnConnect; + + /* + * Action to be taken after a user disconnect during the ramp up period. + */ + private SessionHandlingOperation rampUpActionOnDisconnect; + + /* + * The time in minutes to wait before performing the desired session handling action when a user disconnects during + * the ramp up period. + */ + private Integer rampUpMinutesToWaitOnDisconnect; + + /* + * Action to be taken after a logoff during the ramp up period. + */ + private SessionHandlingOperation rampUpActionOnLogoff; + + /* + * The time in minutes to wait before performing the desired session handling action when a user logs off during the + * ramp up period. + */ + private Integer rampUpMinutesToWaitOnLogoff; + + /* + * Starting time for peak period. + */ + private Time peakStartTime; + + /* + * The desired configuration of Start VM On Connect for the hostpool during the peak phase. + */ + private SetStartVMOnConnect peakStartVMOnConnect; + + /* + * Action to be taken after a user disconnect during the peak period. + */ + private SessionHandlingOperation peakActionOnDisconnect; + + /* + * The time in minutes to wait before performing the desired session handling action when a user disconnects during + * the peak period. + */ + private Integer peakMinutesToWaitOnDisconnect; + + /* + * Action to be taken after a logoff during the peak period. + */ + private SessionHandlingOperation peakActionOnLogoff; + + /* + * The time in minutes to wait before performing the desired session handling action when a user logs off during the + * peak period. + */ + private Integer peakMinutesToWaitOnLogoff; + + /* + * Starting time for ramp down period. + */ + private Time rampDownStartTime; + + /* + * The desired configuration of Start VM On Connect for the hostpool during the ramp down phase. + */ + private SetStartVMOnConnect rampDownStartVMOnConnect; + + /* + * Action to be taken after a user disconnect during the ramp down period. + */ + private SessionHandlingOperation rampDownActionOnDisconnect; + + /* + * The time in minutes to wait before performing the desired session handling action when a user disconnects during + * the ramp down period. + */ + private Integer rampDownMinutesToWaitOnDisconnect; + + /* + * Action to be taken after a logoff during the ramp down period. + */ + private SessionHandlingOperation rampDownActionOnLogoff; + + /* + * The time in minutes to wait before performing the desired session handling action when a user logs off during the + * ramp down period. + */ + private Integer rampDownMinutesToWaitOnLogoff; + + /* + * Starting time for off-peak period. + */ + private Time offPeakStartTime; + + /* + * The desired configuration of Start VM On Connect for the hostpool during the off-peak phase. + */ + private SetStartVMOnConnect offPeakStartVMOnConnect; + + /* + * Action to be taken after a user disconnect during the off-peak period. + */ + private SessionHandlingOperation offPeakActionOnDisconnect; + + /* + * The time in minutes to wait before performing the desired session handling action when a user disconnects during + * the off-peak period. + */ + private Integer offPeakMinutesToWaitOnDisconnect; + + /* + * Action to be taken after a logoff during the off-peak period. + */ + private SessionHandlingOperation offPeakActionOnLogoff; + + /* + * The time in minutes to wait before performing the desired session handling action when a user logs off during the + * off-peak period. + */ + private Integer offPeakMinutesToWaitOnLogoff; + + /** + * Creates an instance of ScalingPlanPersonalSchedulePatchProperties class. + */ + public ScalingPlanPersonalSchedulePatchProperties() { + } + + /** + * Get the daysOfWeek property: Set of days of the week on which this schedule is active. + * + * @return the daysOfWeek value. + */ + public List daysOfWeek() { + return this.daysOfWeek; + } + + /** + * Set the daysOfWeek property: Set of days of the week on which this schedule is active. + * + * @param daysOfWeek the daysOfWeek value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties withDaysOfWeek(List daysOfWeek) { + this.daysOfWeek = daysOfWeek; + return this; + } + + /** + * Get the rampUpStartTime property: Starting time for ramp up period. + * + * @return the rampUpStartTime value. + */ + public Time rampUpStartTime() { + return this.rampUpStartTime; + } + + /** + * Set the rampUpStartTime property: Starting time for ramp up period. + * + * @param rampUpStartTime the rampUpStartTime value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties withRampUpStartTime(Time rampUpStartTime) { + this.rampUpStartTime = rampUpStartTime; + return this; + } + + /** + * Get the rampUpAutoStartHosts property: The desired startup behavior during the ramp up period for personal vms in + * the hostpool. + * + * @return the rampUpAutoStartHosts value. + */ + public StartupBehavior rampUpAutoStartHosts() { + return this.rampUpAutoStartHosts; + } + + /** + * Set the rampUpAutoStartHosts property: The desired startup behavior during the ramp up period for personal vms in + * the hostpool. + * + * @param rampUpAutoStartHosts the rampUpAutoStartHosts value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties withRampUpAutoStartHosts(StartupBehavior rampUpAutoStartHosts) { + this.rampUpAutoStartHosts = rampUpAutoStartHosts; + return this; + } + + /** + * Get the rampUpStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool during + * the ramp up phase. If this is disabled, session hosts must be turned on using rampUpAutoStartHosts or by turning + * them on manually. + * + * @return the rampUpStartVMOnConnect value. + */ + public SetStartVMOnConnect rampUpStartVMOnConnect() { + return this.rampUpStartVMOnConnect; + } + + /** + * Set the rampUpStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool during + * the ramp up phase. If this is disabled, session hosts must be turned on using rampUpAutoStartHosts or by turning + * them on manually. + * + * @param rampUpStartVMOnConnect the rampUpStartVMOnConnect value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties + withRampUpStartVMOnConnect(SetStartVMOnConnect rampUpStartVMOnConnect) { + this.rampUpStartVMOnConnect = rampUpStartVMOnConnect; + return this; + } + + /** + * Get the rampUpActionOnDisconnect property: Action to be taken after a user disconnect during the ramp up period. + * + * @return the rampUpActionOnDisconnect value. + */ + public SessionHandlingOperation rampUpActionOnDisconnect() { + return this.rampUpActionOnDisconnect; + } + + /** + * Set the rampUpActionOnDisconnect property: Action to be taken after a user disconnect during the ramp up period. + * + * @param rampUpActionOnDisconnect the rampUpActionOnDisconnect value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties + withRampUpActionOnDisconnect(SessionHandlingOperation rampUpActionOnDisconnect) { + this.rampUpActionOnDisconnect = rampUpActionOnDisconnect; + return this; + } + + /** + * Get the rampUpMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired + * session handling action when a user disconnects during the ramp up period. + * + * @return the rampUpMinutesToWaitOnDisconnect value. + */ + public Integer rampUpMinutesToWaitOnDisconnect() { + return this.rampUpMinutesToWaitOnDisconnect; + } + + /** + * Set the rampUpMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired + * session handling action when a user disconnects during the ramp up period. + * + * @param rampUpMinutesToWaitOnDisconnect the rampUpMinutesToWaitOnDisconnect value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties + withRampUpMinutesToWaitOnDisconnect(Integer rampUpMinutesToWaitOnDisconnect) { + this.rampUpMinutesToWaitOnDisconnect = rampUpMinutesToWaitOnDisconnect; + return this; + } + + /** + * Get the rampUpActionOnLogoff property: Action to be taken after a logoff during the ramp up period. + * + * @return the rampUpActionOnLogoff value. + */ + public SessionHandlingOperation rampUpActionOnLogoff() { + return this.rampUpActionOnLogoff; + } + + /** + * Set the rampUpActionOnLogoff property: Action to be taken after a logoff during the ramp up period. + * + * @param rampUpActionOnLogoff the rampUpActionOnLogoff value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties + withRampUpActionOnLogoff(SessionHandlingOperation rampUpActionOnLogoff) { + this.rampUpActionOnLogoff = rampUpActionOnLogoff; + return this; + } + + /** + * Get the rampUpMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session + * handling action when a user logs off during the ramp up period. + * + * @return the rampUpMinutesToWaitOnLogoff value. + */ + public Integer rampUpMinutesToWaitOnLogoff() { + return this.rampUpMinutesToWaitOnLogoff; + } + + /** + * Set the rampUpMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session + * handling action when a user logs off during the ramp up period. + * + * @param rampUpMinutesToWaitOnLogoff the rampUpMinutesToWaitOnLogoff value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties + withRampUpMinutesToWaitOnLogoff(Integer rampUpMinutesToWaitOnLogoff) { + this.rampUpMinutesToWaitOnLogoff = rampUpMinutesToWaitOnLogoff; + return this; + } + + /** + * Get the peakStartTime property: Starting time for peak period. + * + * @return the peakStartTime value. + */ + public Time peakStartTime() { + return this.peakStartTime; + } + + /** + * Set the peakStartTime property: Starting time for peak period. + * + * @param peakStartTime the peakStartTime value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties withPeakStartTime(Time peakStartTime) { + this.peakStartTime = peakStartTime; + return this; + } + + /** + * Get the peakStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool during + * the peak phase. + * + * @return the peakStartVMOnConnect value. + */ + public SetStartVMOnConnect peakStartVMOnConnect() { + return this.peakStartVMOnConnect; + } + + /** + * Set the peakStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool during + * the peak phase. + * + * @param peakStartVMOnConnect the peakStartVMOnConnect value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties + withPeakStartVMOnConnect(SetStartVMOnConnect peakStartVMOnConnect) { + this.peakStartVMOnConnect = peakStartVMOnConnect; + return this; + } + + /** + * Get the peakActionOnDisconnect property: Action to be taken after a user disconnect during the peak period. + * + * @return the peakActionOnDisconnect value. + */ + public SessionHandlingOperation peakActionOnDisconnect() { + return this.peakActionOnDisconnect; + } + + /** + * Set the peakActionOnDisconnect property: Action to be taken after a user disconnect during the peak period. + * + * @param peakActionOnDisconnect the peakActionOnDisconnect value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties + withPeakActionOnDisconnect(SessionHandlingOperation peakActionOnDisconnect) { + this.peakActionOnDisconnect = peakActionOnDisconnect; + return this; + } + + /** + * Get the peakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired session + * handling action when a user disconnects during the peak period. + * + * @return the peakMinutesToWaitOnDisconnect value. + */ + public Integer peakMinutesToWaitOnDisconnect() { + return this.peakMinutesToWaitOnDisconnect; + } + + /** + * Set the peakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired session + * handling action when a user disconnects during the peak period. + * + * @param peakMinutesToWaitOnDisconnect the peakMinutesToWaitOnDisconnect value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties + withPeakMinutesToWaitOnDisconnect(Integer peakMinutesToWaitOnDisconnect) { + this.peakMinutesToWaitOnDisconnect = peakMinutesToWaitOnDisconnect; + return this; + } + + /** + * Get the peakActionOnLogoff property: Action to be taken after a logoff during the peak period. + * + * @return the peakActionOnLogoff value. + */ + public SessionHandlingOperation peakActionOnLogoff() { + return this.peakActionOnLogoff; + } + + /** + * Set the peakActionOnLogoff property: Action to be taken after a logoff during the peak period. + * + * @param peakActionOnLogoff the peakActionOnLogoff value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties + withPeakActionOnLogoff(SessionHandlingOperation peakActionOnLogoff) { + this.peakActionOnLogoff = peakActionOnLogoff; + return this; + } + + /** + * Get the peakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session + * handling action when a user logs off during the peak period. + * + * @return the peakMinutesToWaitOnLogoff value. + */ + public Integer peakMinutesToWaitOnLogoff() { + return this.peakMinutesToWaitOnLogoff; + } + + /** + * Set the peakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session + * handling action when a user logs off during the peak period. + * + * @param peakMinutesToWaitOnLogoff the peakMinutesToWaitOnLogoff value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties withPeakMinutesToWaitOnLogoff(Integer peakMinutesToWaitOnLogoff) { + this.peakMinutesToWaitOnLogoff = peakMinutesToWaitOnLogoff; + return this; + } + + /** + * Get the rampDownStartTime property: Starting time for ramp down period. + * + * @return the rampDownStartTime value. + */ + public Time rampDownStartTime() { + return this.rampDownStartTime; + } + + /** + * Set the rampDownStartTime property: Starting time for ramp down period. + * + * @param rampDownStartTime the rampDownStartTime value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties withRampDownStartTime(Time rampDownStartTime) { + this.rampDownStartTime = rampDownStartTime; + return this; + } + + /** + * Get the rampDownStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool + * during the ramp down phase. + * + * @return the rampDownStartVMOnConnect value. + */ + public SetStartVMOnConnect rampDownStartVMOnConnect() { + return this.rampDownStartVMOnConnect; + } + + /** + * Set the rampDownStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool + * during the ramp down phase. + * + * @param rampDownStartVMOnConnect the rampDownStartVMOnConnect value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties + withRampDownStartVMOnConnect(SetStartVMOnConnect rampDownStartVMOnConnect) { + this.rampDownStartVMOnConnect = rampDownStartVMOnConnect; + return this; + } + + /** + * Get the rampDownActionOnDisconnect property: Action to be taken after a user disconnect during the ramp down + * period. + * + * @return the rampDownActionOnDisconnect value. + */ + public SessionHandlingOperation rampDownActionOnDisconnect() { + return this.rampDownActionOnDisconnect; + } + + /** + * Set the rampDownActionOnDisconnect property: Action to be taken after a user disconnect during the ramp down + * period. + * + * @param rampDownActionOnDisconnect the rampDownActionOnDisconnect value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties + withRampDownActionOnDisconnect(SessionHandlingOperation rampDownActionOnDisconnect) { + this.rampDownActionOnDisconnect = rampDownActionOnDisconnect; + return this; + } + + /** + * Get the rampDownMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired + * session handling action when a user disconnects during the ramp down period. + * + * @return the rampDownMinutesToWaitOnDisconnect value. + */ + public Integer rampDownMinutesToWaitOnDisconnect() { + return this.rampDownMinutesToWaitOnDisconnect; + } + + /** + * Set the rampDownMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired + * session handling action when a user disconnects during the ramp down period. + * + * @param rampDownMinutesToWaitOnDisconnect the rampDownMinutesToWaitOnDisconnect value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties + withRampDownMinutesToWaitOnDisconnect(Integer rampDownMinutesToWaitOnDisconnect) { + this.rampDownMinutesToWaitOnDisconnect = rampDownMinutesToWaitOnDisconnect; + return this; + } + + /** + * Get the rampDownActionOnLogoff property: Action to be taken after a logoff during the ramp down period. + * + * @return the rampDownActionOnLogoff value. + */ + public SessionHandlingOperation rampDownActionOnLogoff() { + return this.rampDownActionOnLogoff; + } + + /** + * Set the rampDownActionOnLogoff property: Action to be taken after a logoff during the ramp down period. + * + * @param rampDownActionOnLogoff the rampDownActionOnLogoff value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties + withRampDownActionOnLogoff(SessionHandlingOperation rampDownActionOnLogoff) { + this.rampDownActionOnLogoff = rampDownActionOnLogoff; + return this; + } + + /** + * Get the rampDownMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session + * handling action when a user logs off during the ramp down period. + * + * @return the rampDownMinutesToWaitOnLogoff value. + */ + public Integer rampDownMinutesToWaitOnLogoff() { + return this.rampDownMinutesToWaitOnLogoff; + } + + /** + * Set the rampDownMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session + * handling action when a user logs off during the ramp down period. + * + * @param rampDownMinutesToWaitOnLogoff the rampDownMinutesToWaitOnLogoff value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties + withRampDownMinutesToWaitOnLogoff(Integer rampDownMinutesToWaitOnLogoff) { + this.rampDownMinutesToWaitOnLogoff = rampDownMinutesToWaitOnLogoff; + return this; + } + + /** + * Get the offPeakStartTime property: Starting time for off-peak period. + * + * @return the offPeakStartTime value. + */ + public Time offPeakStartTime() { + return this.offPeakStartTime; + } + + /** + * Set the offPeakStartTime property: Starting time for off-peak period. + * + * @param offPeakStartTime the offPeakStartTime value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties withOffPeakStartTime(Time offPeakStartTime) { + this.offPeakStartTime = offPeakStartTime; + return this; + } + + /** + * Get the offPeakStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool + * during the off-peak phase. + * + * @return the offPeakStartVMOnConnect value. + */ + public SetStartVMOnConnect offPeakStartVMOnConnect() { + return this.offPeakStartVMOnConnect; + } + + /** + * Set the offPeakStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool + * during the off-peak phase. + * + * @param offPeakStartVMOnConnect the offPeakStartVMOnConnect value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties + withOffPeakStartVMOnConnect(SetStartVMOnConnect offPeakStartVMOnConnect) { + this.offPeakStartVMOnConnect = offPeakStartVMOnConnect; + return this; + } + + /** + * Get the offPeakActionOnDisconnect property: Action to be taken after a user disconnect during the off-peak + * period. + * + * @return the offPeakActionOnDisconnect value. + */ + public SessionHandlingOperation offPeakActionOnDisconnect() { + return this.offPeakActionOnDisconnect; + } + + /** + * Set the offPeakActionOnDisconnect property: Action to be taken after a user disconnect during the off-peak + * period. + * + * @param offPeakActionOnDisconnect the offPeakActionOnDisconnect value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties + withOffPeakActionOnDisconnect(SessionHandlingOperation offPeakActionOnDisconnect) { + this.offPeakActionOnDisconnect = offPeakActionOnDisconnect; + return this; + } + + /** + * Get the offPeakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired + * session handling action when a user disconnects during the off-peak period. + * + * @return the offPeakMinutesToWaitOnDisconnect value. + */ + public Integer offPeakMinutesToWaitOnDisconnect() { + return this.offPeakMinutesToWaitOnDisconnect; + } + + /** + * Set the offPeakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired + * session handling action when a user disconnects during the off-peak period. + * + * @param offPeakMinutesToWaitOnDisconnect the offPeakMinutesToWaitOnDisconnect value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties + withOffPeakMinutesToWaitOnDisconnect(Integer offPeakMinutesToWaitOnDisconnect) { + this.offPeakMinutesToWaitOnDisconnect = offPeakMinutesToWaitOnDisconnect; + return this; + } + + /** + * Get the offPeakActionOnLogoff property: Action to be taken after a logoff during the off-peak period. + * + * @return the offPeakActionOnLogoff value. + */ + public SessionHandlingOperation offPeakActionOnLogoff() { + return this.offPeakActionOnLogoff; + } + + /** + * Set the offPeakActionOnLogoff property: Action to be taken after a logoff during the off-peak period. + * + * @param offPeakActionOnLogoff the offPeakActionOnLogoff value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties + withOffPeakActionOnLogoff(SessionHandlingOperation offPeakActionOnLogoff) { + this.offPeakActionOnLogoff = offPeakActionOnLogoff; + return this; + } + + /** + * Get the offPeakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session + * handling action when a user logs off during the off-peak period. + * + * @return the offPeakMinutesToWaitOnLogoff value. + */ + public Integer offPeakMinutesToWaitOnLogoff() { + return this.offPeakMinutesToWaitOnLogoff; + } + + /** + * Set the offPeakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session + * handling action when a user logs off during the off-peak period. + * + * @param offPeakMinutesToWaitOnLogoff the offPeakMinutesToWaitOnLogoff value to set. + * @return the ScalingPlanPersonalSchedulePatchProperties object itself. + */ + public ScalingPlanPersonalSchedulePatchProperties + withOffPeakMinutesToWaitOnLogoff(Integer offPeakMinutesToWaitOnLogoff) { + this.offPeakMinutesToWaitOnLogoff = offPeakMinutesToWaitOnLogoff; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rampUpStartTime() != null) { + rampUpStartTime().validate(); + } + if (peakStartTime() != null) { + peakStartTime().validate(); + } + if (rampDownStartTime() != null) { + rampDownStartTime().validate(); + } + if (offPeakStartTime() != null) { + offPeakStartTime().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("daysOfWeek", this.daysOfWeek, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeJsonField("rampUpStartTime", this.rampUpStartTime); + jsonWriter.writeStringField("rampUpAutoStartHosts", + this.rampUpAutoStartHosts == null ? null : this.rampUpAutoStartHosts.toString()); + jsonWriter.writeStringField("rampUpStartVMOnConnect", + this.rampUpStartVMOnConnect == null ? null : this.rampUpStartVMOnConnect.toString()); + jsonWriter.writeStringField("rampUpActionOnDisconnect", + this.rampUpActionOnDisconnect == null ? null : this.rampUpActionOnDisconnect.toString()); + jsonWriter.writeNumberField("rampUpMinutesToWaitOnDisconnect", this.rampUpMinutesToWaitOnDisconnect); + jsonWriter.writeStringField("rampUpActionOnLogoff", + this.rampUpActionOnLogoff == null ? null : this.rampUpActionOnLogoff.toString()); + jsonWriter.writeNumberField("rampUpMinutesToWaitOnLogoff", this.rampUpMinutesToWaitOnLogoff); + jsonWriter.writeJsonField("peakStartTime", this.peakStartTime); + jsonWriter.writeStringField("peakStartVMOnConnect", + this.peakStartVMOnConnect == null ? null : this.peakStartVMOnConnect.toString()); + jsonWriter.writeStringField("peakActionOnDisconnect", + this.peakActionOnDisconnect == null ? null : this.peakActionOnDisconnect.toString()); + jsonWriter.writeNumberField("peakMinutesToWaitOnDisconnect", this.peakMinutesToWaitOnDisconnect); + jsonWriter.writeStringField("peakActionOnLogoff", + this.peakActionOnLogoff == null ? null : this.peakActionOnLogoff.toString()); + jsonWriter.writeNumberField("peakMinutesToWaitOnLogoff", this.peakMinutesToWaitOnLogoff); + jsonWriter.writeJsonField("rampDownStartTime", this.rampDownStartTime); + jsonWriter.writeStringField("rampDownStartVMOnConnect", + this.rampDownStartVMOnConnect == null ? null : this.rampDownStartVMOnConnect.toString()); + jsonWriter.writeStringField("rampDownActionOnDisconnect", + this.rampDownActionOnDisconnect == null ? null : this.rampDownActionOnDisconnect.toString()); + jsonWriter.writeNumberField("rampDownMinutesToWaitOnDisconnect", this.rampDownMinutesToWaitOnDisconnect); + jsonWriter.writeStringField("rampDownActionOnLogoff", + this.rampDownActionOnLogoff == null ? null : this.rampDownActionOnLogoff.toString()); + jsonWriter.writeNumberField("rampDownMinutesToWaitOnLogoff", this.rampDownMinutesToWaitOnLogoff); + jsonWriter.writeJsonField("offPeakStartTime", this.offPeakStartTime); + jsonWriter.writeStringField("offPeakStartVMOnConnect", + this.offPeakStartVMOnConnect == null ? null : this.offPeakStartVMOnConnect.toString()); + jsonWriter.writeStringField("offPeakActionOnDisconnect", + this.offPeakActionOnDisconnect == null ? null : this.offPeakActionOnDisconnect.toString()); + jsonWriter.writeNumberField("offPeakMinutesToWaitOnDisconnect", this.offPeakMinutesToWaitOnDisconnect); + jsonWriter.writeStringField("offPeakActionOnLogoff", + this.offPeakActionOnLogoff == null ? null : this.offPeakActionOnLogoff.toString()); + jsonWriter.writeNumberField("offPeakMinutesToWaitOnLogoff", this.offPeakMinutesToWaitOnLogoff); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingPlanPersonalSchedulePatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingPlanPersonalSchedulePatchProperties 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 ScalingPlanPersonalSchedulePatchProperties. + */ + public static ScalingPlanPersonalSchedulePatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingPlanPersonalSchedulePatchProperties deserializedScalingPlanPersonalSchedulePatchProperties + = new ScalingPlanPersonalSchedulePatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("daysOfWeek".equals(fieldName)) { + List daysOfWeek = reader.readArray(reader1 -> DayOfWeek.fromString(reader1.getString())); + deserializedScalingPlanPersonalSchedulePatchProperties.daysOfWeek = daysOfWeek; + } else if ("rampUpStartTime".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampUpStartTime = Time.fromJson(reader); + } else if ("rampUpAutoStartHosts".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampUpAutoStartHosts + = StartupBehavior.fromString(reader.getString()); + } else if ("rampUpStartVMOnConnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampUpStartVMOnConnect + = SetStartVMOnConnect.fromString(reader.getString()); + } else if ("rampUpActionOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampUpActionOnDisconnect + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("rampUpMinutesToWaitOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampUpMinutesToWaitOnDisconnect + = reader.getNullable(JsonReader::getInt); + } else if ("rampUpActionOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampUpActionOnLogoff + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("rampUpMinutesToWaitOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampUpMinutesToWaitOnLogoff + = reader.getNullable(JsonReader::getInt); + } else if ("peakStartTime".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.peakStartTime = Time.fromJson(reader); + } else if ("peakStartVMOnConnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.peakStartVMOnConnect + = SetStartVMOnConnect.fromString(reader.getString()); + } else if ("peakActionOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.peakActionOnDisconnect + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("peakMinutesToWaitOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.peakMinutesToWaitOnDisconnect + = reader.getNullable(JsonReader::getInt); + } else if ("peakActionOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.peakActionOnLogoff + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("peakMinutesToWaitOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.peakMinutesToWaitOnLogoff + = reader.getNullable(JsonReader::getInt); + } else if ("rampDownStartTime".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampDownStartTime = Time.fromJson(reader); + } else if ("rampDownStartVMOnConnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampDownStartVMOnConnect + = SetStartVMOnConnect.fromString(reader.getString()); + } else if ("rampDownActionOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampDownActionOnDisconnect + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("rampDownMinutesToWaitOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampDownMinutesToWaitOnDisconnect + = reader.getNullable(JsonReader::getInt); + } else if ("rampDownActionOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampDownActionOnLogoff + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("rampDownMinutesToWaitOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampDownMinutesToWaitOnLogoff + = reader.getNullable(JsonReader::getInt); + } else if ("offPeakStartTime".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.offPeakStartTime = Time.fromJson(reader); + } else if ("offPeakStartVMOnConnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.offPeakStartVMOnConnect + = SetStartVMOnConnect.fromString(reader.getString()); + } else if ("offPeakActionOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.offPeakActionOnDisconnect + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("offPeakMinutesToWaitOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.offPeakMinutesToWaitOnDisconnect + = reader.getNullable(JsonReader::getInt); + } else if ("offPeakActionOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.offPeakActionOnLogoff + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("offPeakMinutesToWaitOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.offPeakMinutesToWaitOnLogoff + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedScalingPlanPersonalSchedulePatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalScheduleProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalScheduleProperties.java index 727528381460..270b0b48b73b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalScheduleProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalScheduleProperties.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -742,20 +743,43 @@ public Integer offPeakMinutesToWaitOnLogoff() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (rampUpStartTime() != null) { + if (daysOfWeek() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property daysOfWeek in model ScalingPlanPersonalScheduleProperties")); + } + if (rampUpStartTime() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property rampUpStartTime in model ScalingPlanPersonalScheduleProperties")); + } else { rampUpStartTime().validate(); } - if (peakStartTime() != null) { + if (peakStartTime() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property peakStartTime in model ScalingPlanPersonalScheduleProperties")); + } else { peakStartTime().validate(); } - if (rampDownStartTime() != null) { + if (rampDownStartTime() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property rampDownStartTime in model ScalingPlanPersonalScheduleProperties")); + } else { rampDownStartTime().validate(); } - if (offPeakStartTime() != null) { + if (offPeakStartTime() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property offPeakStartTime in model ScalingPlanPersonalScheduleProperties")); + } else { offPeakStartTime().validate(); } } + private static final ClientLogger LOGGER = new ClientLogger(ScalingPlanPersonalScheduleProperties.class); + /** * {@inheritDoc} */ @@ -765,6 +789,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("daysOfWeek", this.daysOfWeek, (writer, element) -> writer.writeString(element == null ? null : element.toString())); jsonWriter.writeJsonField("rampUpStartTime", this.rampUpStartTime); + jsonWriter.writeJsonField("peakStartTime", this.peakStartTime); + jsonWriter.writeJsonField("rampDownStartTime", this.rampDownStartTime); + jsonWriter.writeJsonField("offPeakStartTime", this.offPeakStartTime); jsonWriter.writeStringField("rampUpAutoStartHosts", this.rampUpAutoStartHosts == null ? null : this.rampUpAutoStartHosts.toString()); jsonWriter.writeStringField("rampUpStartVMOnConnect", @@ -775,7 +802,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("rampUpActionOnLogoff", this.rampUpActionOnLogoff == null ? null : this.rampUpActionOnLogoff.toString()); jsonWriter.writeNumberField("rampUpMinutesToWaitOnLogoff", this.rampUpMinutesToWaitOnLogoff); - jsonWriter.writeJsonField("peakStartTime", this.peakStartTime); jsonWriter.writeStringField("peakStartVMOnConnect", this.peakStartVMOnConnect == null ? null : this.peakStartVMOnConnect.toString()); jsonWriter.writeStringField("peakActionOnDisconnect", @@ -784,7 +810,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("peakActionOnLogoff", this.peakActionOnLogoff == null ? null : this.peakActionOnLogoff.toString()); jsonWriter.writeNumberField("peakMinutesToWaitOnLogoff", this.peakMinutesToWaitOnLogoff); - jsonWriter.writeJsonField("rampDownStartTime", this.rampDownStartTime); jsonWriter.writeStringField("rampDownStartVMOnConnect", this.rampDownStartVMOnConnect == null ? null : this.rampDownStartVMOnConnect.toString()); jsonWriter.writeStringField("rampDownActionOnDisconnect", @@ -793,7 +818,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("rampDownActionOnLogoff", this.rampDownActionOnLogoff == null ? null : this.rampDownActionOnLogoff.toString()); jsonWriter.writeNumberField("rampDownMinutesToWaitOnLogoff", this.rampDownMinutesToWaitOnLogoff); - jsonWriter.writeJsonField("offPeakStartTime", this.offPeakStartTime); jsonWriter.writeStringField("offPeakStartVMOnConnect", this.offPeakStartVMOnConnect == null ? null : this.offPeakStartVMOnConnect.toString()); jsonWriter.writeStringField("offPeakActionOnDisconnect", @@ -811,6 +835,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ScalingPlanPersonalScheduleProperties 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 ScalingPlanPersonalScheduleProperties. */ public static ScalingPlanPersonalScheduleProperties fromJson(JsonReader jsonReader) throws IOException { @@ -826,6 +851,12 @@ public static ScalingPlanPersonalScheduleProperties fromJson(JsonReader jsonRead deserializedScalingPlanPersonalScheduleProperties.daysOfWeek = daysOfWeek; } else if ("rampUpStartTime".equals(fieldName)) { deserializedScalingPlanPersonalScheduleProperties.rampUpStartTime = Time.fromJson(reader); + } else if ("peakStartTime".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.peakStartTime = Time.fromJson(reader); + } else if ("rampDownStartTime".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.rampDownStartTime = Time.fromJson(reader); + } else if ("offPeakStartTime".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.offPeakStartTime = Time.fromJson(reader); } else if ("rampUpAutoStartHosts".equals(fieldName)) { deserializedScalingPlanPersonalScheduleProperties.rampUpAutoStartHosts = StartupBehavior.fromString(reader.getString()); @@ -844,8 +875,6 @@ public static ScalingPlanPersonalScheduleProperties fromJson(JsonReader jsonRead } else if ("rampUpMinutesToWaitOnLogoff".equals(fieldName)) { deserializedScalingPlanPersonalScheduleProperties.rampUpMinutesToWaitOnLogoff = reader.getNullable(JsonReader::getInt); - } else if ("peakStartTime".equals(fieldName)) { - deserializedScalingPlanPersonalScheduleProperties.peakStartTime = Time.fromJson(reader); } else if ("peakStartVMOnConnect".equals(fieldName)) { deserializedScalingPlanPersonalScheduleProperties.peakStartVMOnConnect = SetStartVMOnConnect.fromString(reader.getString()); @@ -861,8 +890,6 @@ public static ScalingPlanPersonalScheduleProperties fromJson(JsonReader jsonRead } else if ("peakMinutesToWaitOnLogoff".equals(fieldName)) { deserializedScalingPlanPersonalScheduleProperties.peakMinutesToWaitOnLogoff = reader.getNullable(JsonReader::getInt); - } else if ("rampDownStartTime".equals(fieldName)) { - deserializedScalingPlanPersonalScheduleProperties.rampDownStartTime = Time.fromJson(reader); } else if ("rampDownStartVMOnConnect".equals(fieldName)) { deserializedScalingPlanPersonalScheduleProperties.rampDownStartVMOnConnect = SetStartVMOnConnect.fromString(reader.getString()); @@ -878,8 +905,6 @@ public static ScalingPlanPersonalScheduleProperties fromJson(JsonReader jsonRead } else if ("rampDownMinutesToWaitOnLogoff".equals(fieldName)) { deserializedScalingPlanPersonalScheduleProperties.rampDownMinutesToWaitOnLogoff = reader.getNullable(JsonReader::getInt); - } else if ("offPeakStartTime".equals(fieldName)) { - deserializedScalingPlanPersonalScheduleProperties.offPeakStartTime = Time.fromJson(reader); } else if ("offPeakStartVMOnConnect".equals(fieldName)) { deserializedScalingPlanPersonalScheduleProperties.offPeakStartVMOnConnect = SetStartVMOnConnect.fromString(reader.getString()); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledScheduleInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledScheduleInner.java index 3a4f6eaeaa8c..36c8cf45558d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledScheduleInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledScheduleInner.java @@ -11,7 +11,9 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.models.CreateDeleteProperties; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingMethod; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; import com.azure.resourcemanager.desktopvirtualization.models.Time; @@ -102,6 +104,15 @@ public String id() { return this.id; } + /** + * Get the name property: Name of the ScalingPlanPooledSchedule. + * + * @return the name value. + */ + public String namePropertiesName() { + return this.innerProperties() == null ? null : this.innerProperties().name(); + } + /** * Get the daysOfWeek property: Set of days of the week on which this schedule is active. * @@ -125,6 +136,56 @@ public ScalingPlanPooledScheduleInner withDaysOfWeek(List daysOfWeek) return this; } + /** + * Get the scalingMethod property: The desired scaling method to be used to scale the hosts in the assigned host + * pool. + * + * @return the scalingMethod value. + */ + public ScalingMethod scalingMethod() { + return this.innerProperties() == null ? null : this.innerProperties().scalingMethod(); + } + + /** + * Set the scalingMethod property: The desired scaling method to be used to scale the hosts in the assigned host + * pool. + * + * @param scalingMethod the scalingMethod value to set. + * @return the ScalingPlanPooledScheduleInner object itself. + */ + public ScalingPlanPooledScheduleInner withScalingMethod(ScalingMethod scalingMethod) { + if (this.innerProperties() == null) { + this.innerProperties = new ScalingPlanPooledScheduleProperties(); + } + this.innerProperties().withScalingMethod(scalingMethod); + return this; + } + + /** + * Get the createDelete property: The properties that control how Scaling will manage the size of the hostpool by + * creating and deleting hosts. + * + * @return the createDelete value. + */ + public CreateDeleteProperties createDelete() { + return this.innerProperties() == null ? null : this.innerProperties().createDelete(); + } + + /** + * Set the createDelete property: The properties that control how Scaling will manage the size of the hostpool by + * creating and deleting hosts. + * + * @param createDelete the createDelete value to set. + * @return the ScalingPlanPooledScheduleInner object itself. + */ + public ScalingPlanPooledScheduleInner withCreateDelete(CreateDeleteProperties createDelete) { + if (this.innerProperties() == null) { + this.innerProperties = new ScalingPlanPooledScheduleProperties(); + } + this.innerProperties().withCreateDelete(createDelete); + return this; + } + /** * Get the rampUpStartTime property: Starting time for ramp up period. * @@ -200,8 +261,8 @@ public ScalingPlanPooledScheduleInner withRampUpMinimumHostsPct(Integer rampUpMi * * @return the rampUpCapacityThresholdPct value. */ - public Integer rampUpCapacityThresholdPct() { - return this.innerProperties() == null ? null : this.innerProperties().rampUpCapacityThresholdPct(); + public int rampUpCapacityThresholdPct() { + return this.innerProperties() == null ? 0 : this.innerProperties().rampUpCapacityThresholdPct(); } /** @@ -210,7 +271,7 @@ public Integer rampUpCapacityThresholdPct() { * @param rampUpCapacityThresholdPct the rampUpCapacityThresholdPct value to set. * @return the ScalingPlanPooledScheduleInner object itself. */ - public ScalingPlanPooledScheduleInner withRampUpCapacityThresholdPct(Integer rampUpCapacityThresholdPct) { + public ScalingPlanPooledScheduleInner withRampUpCapacityThresholdPct(int rampUpCapacityThresholdPct) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPooledScheduleProperties(); } @@ -340,8 +401,8 @@ public ScalingPlanPooledScheduleInner withRampDownMinimumHostsPct(Integer rampDo * * @return the rampDownCapacityThresholdPct value. */ - public Integer rampDownCapacityThresholdPct() { - return this.innerProperties() == null ? null : this.innerProperties().rampDownCapacityThresholdPct(); + public int rampDownCapacityThresholdPct() { + return this.innerProperties() == null ? 0 : this.innerProperties().rampDownCapacityThresholdPct(); } /** @@ -350,7 +411,7 @@ public Integer rampDownCapacityThresholdPct() { * @param rampDownCapacityThresholdPct the rampDownCapacityThresholdPct value to set. * @return the ScalingPlanPooledScheduleInner object itself. */ - public ScalingPlanPooledScheduleInner withRampDownCapacityThresholdPct(Integer rampDownCapacityThresholdPct) { + public ScalingPlanPooledScheduleInner withRampDownCapacityThresholdPct(int rampDownCapacityThresholdPct) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPooledScheduleProperties(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledSchedulePatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledSchedulePatchProperties.java new file mode 100644 index 000000000000..97b9b7ef30a6 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledSchedulePatchProperties.java @@ -0,0 +1,668 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent.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 com.azure.resourcemanager.desktopvirtualization.models.CreateDeleteProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingMethod; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; +import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; +import com.azure.resourcemanager.desktopvirtualization.models.Time; +import java.io.IOException; +import java.util.List; + +/** + * A ScalingPlanPooledSchedule. + */ +@Fluent +public final class ScalingPlanPooledSchedulePatchProperties + implements JsonSerializable { + /* + * Name of the ScalingPlanPooledSchedule. + */ + private String name; + + /* + * Set of days of the week on which this schedule is active. + */ + private List daysOfWeek; + + /* + * The desired scaling method to be used to scale the hosts in the assigned host pool. + */ + private ScalingMethod scalingMethod; + + /* + * The properties that control how Scaling will manage the size of the hostpool by creating and deleting hosts. + */ + private CreateDeleteProperties createDelete; + + /* + * Starting time for ramp up period. + */ + private Time rampUpStartTime; + + /* + * Load balancing algorithm for ramp up period. + */ + private SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm; + + /* + * Minimum host percentage for ramp up period. + */ + private Integer rampUpMinimumHostsPct; + + /* + * Capacity threshold for ramp up period. + */ + private Integer rampUpCapacityThresholdPct; + + /* + * Starting time for peak period. + */ + private Time peakStartTime; + + /* + * Load balancing algorithm for peak period. + */ + private SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm; + + /* + * Starting time for ramp down period. + */ + private Time rampDownStartTime; + + /* + * Load balancing algorithm for ramp down period. + */ + private SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm; + + /* + * Minimum host percentage for ramp down period. + */ + private Integer rampDownMinimumHostsPct; + + /* + * Capacity threshold for ramp down period. + */ + private Integer rampDownCapacityThresholdPct; + + /* + * Should users be logged off forcefully from hosts. + */ + private Boolean rampDownForceLogoffUsers; + + /* + * Specifies when to stop hosts during ramp down period. + */ + private StopHostsWhen rampDownStopHostsWhen; + + /* + * Number of minutes to wait to stop hosts during ramp down period. + */ + private Integer rampDownWaitTimeMinutes; + + /* + * Notification message for users during ramp down period. + */ + private String rampDownNotificationMessage; + + /* + * Starting time for off-peak period. + */ + private Time offPeakStartTime; + + /* + * Load balancing algorithm for off-peak period. + */ + private SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm; + + /** + * Creates an instance of ScalingPlanPooledSchedulePatchProperties class. + */ + public ScalingPlanPooledSchedulePatchProperties() { + } + + /** + * Get the name property: Name of the ScalingPlanPooledSchedule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the daysOfWeek property: Set of days of the week on which this schedule is active. + * + * @return the daysOfWeek value. + */ + public List daysOfWeek() { + return this.daysOfWeek; + } + + /** + * Set the daysOfWeek property: Set of days of the week on which this schedule is active. + * + * @param daysOfWeek the daysOfWeek value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withDaysOfWeek(List daysOfWeek) { + this.daysOfWeek = daysOfWeek; + return this; + } + + /** + * Get the scalingMethod property: The desired scaling method to be used to scale the hosts in the assigned host + * pool. + * + * @return the scalingMethod value. + */ + public ScalingMethod scalingMethod() { + return this.scalingMethod; + } + + /** + * Set the scalingMethod property: The desired scaling method to be used to scale the hosts in the assigned host + * pool. + * + * @param scalingMethod the scalingMethod value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withScalingMethod(ScalingMethod scalingMethod) { + this.scalingMethod = scalingMethod; + return this; + } + + /** + * Get the createDelete property: The properties that control how Scaling will manage the size of the hostpool by + * creating and deleting hosts. + * + * @return the createDelete value. + */ + public CreateDeleteProperties createDelete() { + return this.createDelete; + } + + /** + * Set the createDelete property: The properties that control how Scaling will manage the size of the hostpool by + * creating and deleting hosts. + * + * @param createDelete the createDelete value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withCreateDelete(CreateDeleteProperties createDelete) { + this.createDelete = createDelete; + return this; + } + + /** + * Get the rampUpStartTime property: Starting time for ramp up period. + * + * @return the rampUpStartTime value. + */ + public Time rampUpStartTime() { + return this.rampUpStartTime; + } + + /** + * Set the rampUpStartTime property: Starting time for ramp up period. + * + * @param rampUpStartTime the rampUpStartTime value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withRampUpStartTime(Time rampUpStartTime) { + this.rampUpStartTime = rampUpStartTime; + return this; + } + + /** + * Get the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period. + * + * @return the rampUpLoadBalancingAlgorithm value. + */ + public SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm() { + return this.rampUpLoadBalancingAlgorithm; + } + + /** + * Set the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period. + * + * @param rampUpLoadBalancingAlgorithm the rampUpLoadBalancingAlgorithm value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties + withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm) { + this.rampUpLoadBalancingAlgorithm = rampUpLoadBalancingAlgorithm; + return this; + } + + /** + * Get the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period. + * + * @return the rampUpMinimumHostsPct value. + */ + public Integer rampUpMinimumHostsPct() { + return this.rampUpMinimumHostsPct; + } + + /** + * Set the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period. + * + * @param rampUpMinimumHostsPct the rampUpMinimumHostsPct value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withRampUpMinimumHostsPct(Integer rampUpMinimumHostsPct) { + this.rampUpMinimumHostsPct = rampUpMinimumHostsPct; + return this; + } + + /** + * Get the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period. + * + * @return the rampUpCapacityThresholdPct value. + */ + public Integer rampUpCapacityThresholdPct() { + return this.rampUpCapacityThresholdPct; + } + + /** + * Set the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period. + * + * @param rampUpCapacityThresholdPct the rampUpCapacityThresholdPct value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withRampUpCapacityThresholdPct(Integer rampUpCapacityThresholdPct) { + this.rampUpCapacityThresholdPct = rampUpCapacityThresholdPct; + return this; + } + + /** + * Get the peakStartTime property: Starting time for peak period. + * + * @return the peakStartTime value. + */ + public Time peakStartTime() { + return this.peakStartTime; + } + + /** + * Set the peakStartTime property: Starting time for peak period. + * + * @param peakStartTime the peakStartTime value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withPeakStartTime(Time peakStartTime) { + this.peakStartTime = peakStartTime; + return this; + } + + /** + * Get the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period. + * + * @return the peakLoadBalancingAlgorithm value. + */ + public SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm() { + return this.peakLoadBalancingAlgorithm; + } + + /** + * Set the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period. + * + * @param peakLoadBalancingAlgorithm the peakLoadBalancingAlgorithm value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties + withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm) { + this.peakLoadBalancingAlgorithm = peakLoadBalancingAlgorithm; + return this; + } + + /** + * Get the rampDownStartTime property: Starting time for ramp down period. + * + * @return the rampDownStartTime value. + */ + public Time rampDownStartTime() { + return this.rampDownStartTime; + } + + /** + * Set the rampDownStartTime property: Starting time for ramp down period. + * + * @param rampDownStartTime the rampDownStartTime value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withRampDownStartTime(Time rampDownStartTime) { + this.rampDownStartTime = rampDownStartTime; + return this; + } + + /** + * Get the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period. + * + * @return the rampDownLoadBalancingAlgorithm value. + */ + public SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm() { + return this.rampDownLoadBalancingAlgorithm; + } + + /** + * Set the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period. + * + * @param rampDownLoadBalancingAlgorithm the rampDownLoadBalancingAlgorithm value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties + withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm) { + this.rampDownLoadBalancingAlgorithm = rampDownLoadBalancingAlgorithm; + return this; + } + + /** + * Get the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period. + * + * @return the rampDownMinimumHostsPct value. + */ + public Integer rampDownMinimumHostsPct() { + return this.rampDownMinimumHostsPct; + } + + /** + * Set the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period. + * + * @param rampDownMinimumHostsPct the rampDownMinimumHostsPct value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withRampDownMinimumHostsPct(Integer rampDownMinimumHostsPct) { + this.rampDownMinimumHostsPct = rampDownMinimumHostsPct; + return this; + } + + /** + * Get the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period. + * + * @return the rampDownCapacityThresholdPct value. + */ + public Integer rampDownCapacityThresholdPct() { + return this.rampDownCapacityThresholdPct; + } + + /** + * Set the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period. + * + * @param rampDownCapacityThresholdPct the rampDownCapacityThresholdPct value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties + withRampDownCapacityThresholdPct(Integer rampDownCapacityThresholdPct) { + this.rampDownCapacityThresholdPct = rampDownCapacityThresholdPct; + return this; + } + + /** + * Get the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts. + * + * @return the rampDownForceLogoffUsers value. + */ + public Boolean rampDownForceLogoffUsers() { + return this.rampDownForceLogoffUsers; + } + + /** + * Set the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts. + * + * @param rampDownForceLogoffUsers the rampDownForceLogoffUsers value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withRampDownForceLogoffUsers(Boolean rampDownForceLogoffUsers) { + this.rampDownForceLogoffUsers = rampDownForceLogoffUsers; + return this; + } + + /** + * Get the rampDownStopHostsWhen property: Specifies when to stop hosts during ramp down period. + * + * @return the rampDownStopHostsWhen value. + */ + public StopHostsWhen rampDownStopHostsWhen() { + return this.rampDownStopHostsWhen; + } + + /** + * Set the rampDownStopHostsWhen property: Specifies when to stop hosts during ramp down period. + * + * @param rampDownStopHostsWhen the rampDownStopHostsWhen value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withRampDownStopHostsWhen(StopHostsWhen rampDownStopHostsWhen) { + this.rampDownStopHostsWhen = rampDownStopHostsWhen; + return this; + } + + /** + * Get the rampDownWaitTimeMinutes property: Number of minutes to wait to stop hosts during ramp down period. + * + * @return the rampDownWaitTimeMinutes value. + */ + public Integer rampDownWaitTimeMinutes() { + return this.rampDownWaitTimeMinutes; + } + + /** + * Set the rampDownWaitTimeMinutes property: Number of minutes to wait to stop hosts during ramp down period. + * + * @param rampDownWaitTimeMinutes the rampDownWaitTimeMinutes value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withRampDownWaitTimeMinutes(Integer rampDownWaitTimeMinutes) { + this.rampDownWaitTimeMinutes = rampDownWaitTimeMinutes; + return this; + } + + /** + * Get the rampDownNotificationMessage property: Notification message for users during ramp down period. + * + * @return the rampDownNotificationMessage value. + */ + public String rampDownNotificationMessage() { + return this.rampDownNotificationMessage; + } + + /** + * Set the rampDownNotificationMessage property: Notification message for users during ramp down period. + * + * @param rampDownNotificationMessage the rampDownNotificationMessage value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties + withRampDownNotificationMessage(String rampDownNotificationMessage) { + this.rampDownNotificationMessage = rampDownNotificationMessage; + return this; + } + + /** + * Get the offPeakStartTime property: Starting time for off-peak period. + * + * @return the offPeakStartTime value. + */ + public Time offPeakStartTime() { + return this.offPeakStartTime; + } + + /** + * Set the offPeakStartTime property: Starting time for off-peak period. + * + * @param offPeakStartTime the offPeakStartTime value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withOffPeakStartTime(Time offPeakStartTime) { + this.offPeakStartTime = offPeakStartTime; + return this; + } + + /** + * Get the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period. + * + * @return the offPeakLoadBalancingAlgorithm value. + */ + public SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm() { + return this.offPeakLoadBalancingAlgorithm; + } + + /** + * Set the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period. + * + * @param offPeakLoadBalancingAlgorithm the offPeakLoadBalancingAlgorithm value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties + withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm) { + this.offPeakLoadBalancingAlgorithm = offPeakLoadBalancingAlgorithm; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (createDelete() != null) { + createDelete().validate(); + } + if (rampUpStartTime() != null) { + rampUpStartTime().validate(); + } + if (peakStartTime() != null) { + peakStartTime().validate(); + } + if (rampDownStartTime() != null) { + rampDownStartTime().validate(); + } + if (offPeakStartTime() != null) { + offPeakStartTime().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("daysOfWeek", this.daysOfWeek, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("scalingMethod", this.scalingMethod == null ? null : this.scalingMethod.toString()); + jsonWriter.writeJsonField("createDelete", this.createDelete); + jsonWriter.writeJsonField("rampUpStartTime", this.rampUpStartTime); + jsonWriter.writeStringField("rampUpLoadBalancingAlgorithm", + this.rampUpLoadBalancingAlgorithm == null ? null : this.rampUpLoadBalancingAlgorithm.toString()); + jsonWriter.writeNumberField("rampUpMinimumHostsPct", this.rampUpMinimumHostsPct); + jsonWriter.writeNumberField("rampUpCapacityThresholdPct", this.rampUpCapacityThresholdPct); + jsonWriter.writeJsonField("peakStartTime", this.peakStartTime); + jsonWriter.writeStringField("peakLoadBalancingAlgorithm", + this.peakLoadBalancingAlgorithm == null ? null : this.peakLoadBalancingAlgorithm.toString()); + jsonWriter.writeJsonField("rampDownStartTime", this.rampDownStartTime); + jsonWriter.writeStringField("rampDownLoadBalancingAlgorithm", + this.rampDownLoadBalancingAlgorithm == null ? null : this.rampDownLoadBalancingAlgorithm.toString()); + jsonWriter.writeNumberField("rampDownMinimumHostsPct", this.rampDownMinimumHostsPct); + jsonWriter.writeNumberField("rampDownCapacityThresholdPct", this.rampDownCapacityThresholdPct); + jsonWriter.writeBooleanField("rampDownForceLogoffUsers", this.rampDownForceLogoffUsers); + jsonWriter.writeStringField("rampDownStopHostsWhen", + this.rampDownStopHostsWhen == null ? null : this.rampDownStopHostsWhen.toString()); + jsonWriter.writeNumberField("rampDownWaitTimeMinutes", this.rampDownWaitTimeMinutes); + jsonWriter.writeStringField("rampDownNotificationMessage", this.rampDownNotificationMessage); + jsonWriter.writeJsonField("offPeakStartTime", this.offPeakStartTime); + jsonWriter.writeStringField("offPeakLoadBalancingAlgorithm", + this.offPeakLoadBalancingAlgorithm == null ? null : this.offPeakLoadBalancingAlgorithm.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingPlanPooledSchedulePatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingPlanPooledSchedulePatchProperties 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 ScalingPlanPooledSchedulePatchProperties. + */ + public static ScalingPlanPooledSchedulePatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingPlanPooledSchedulePatchProperties deserializedScalingPlanPooledSchedulePatchProperties + = new ScalingPlanPooledSchedulePatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.name = reader.getString(); + } else if ("daysOfWeek".equals(fieldName)) { + List daysOfWeek = reader.readArray(reader1 -> DayOfWeek.fromString(reader1.getString())); + deserializedScalingPlanPooledSchedulePatchProperties.daysOfWeek = daysOfWeek; + } else if ("scalingMethod".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.scalingMethod + = ScalingMethod.fromString(reader.getString()); + } else if ("createDelete".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.createDelete + = CreateDeleteProperties.fromJson(reader); + } else if ("rampUpStartTime".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampUpStartTime = Time.fromJson(reader); + } else if ("rampUpLoadBalancingAlgorithm".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampUpLoadBalancingAlgorithm + = SessionHostLoadBalancingAlgorithm.fromString(reader.getString()); + } else if ("rampUpMinimumHostsPct".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampUpMinimumHostsPct + = reader.getNullable(JsonReader::getInt); + } else if ("rampUpCapacityThresholdPct".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampUpCapacityThresholdPct + = reader.getNullable(JsonReader::getInt); + } else if ("peakStartTime".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.peakStartTime = Time.fromJson(reader); + } else if ("peakLoadBalancingAlgorithm".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.peakLoadBalancingAlgorithm + = SessionHostLoadBalancingAlgorithm.fromString(reader.getString()); + } else if ("rampDownStartTime".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampDownStartTime = Time.fromJson(reader); + } else if ("rampDownLoadBalancingAlgorithm".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampDownLoadBalancingAlgorithm + = SessionHostLoadBalancingAlgorithm.fromString(reader.getString()); + } else if ("rampDownMinimumHostsPct".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampDownMinimumHostsPct + = reader.getNullable(JsonReader::getInt); + } else if ("rampDownCapacityThresholdPct".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampDownCapacityThresholdPct + = reader.getNullable(JsonReader::getInt); + } else if ("rampDownForceLogoffUsers".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampDownForceLogoffUsers + = reader.getNullable(JsonReader::getBoolean); + } else if ("rampDownStopHostsWhen".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampDownStopHostsWhen + = StopHostsWhen.fromString(reader.getString()); + } else if ("rampDownWaitTimeMinutes".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampDownWaitTimeMinutes + = reader.getNullable(JsonReader::getInt); + } else if ("rampDownNotificationMessage".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampDownNotificationMessage + = reader.getString(); + } else if ("offPeakStartTime".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.offPeakStartTime = Time.fromJson(reader); + } else if ("offPeakLoadBalancingAlgorithm".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.offPeakLoadBalancingAlgorithm + = SessionHostLoadBalancingAlgorithm.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedScalingPlanPooledSchedulePatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledScheduleProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledScheduleProperties.java index 9c4a8262bcc5..d4ad15946443 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledScheduleProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledScheduleProperties.java @@ -5,11 +5,14 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.models.CreateDeleteProperties; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingMethod; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; import com.azure.resourcemanager.desktopvirtualization.models.Time; @@ -22,11 +25,26 @@ @Fluent public final class ScalingPlanPooledScheduleProperties implements JsonSerializable { + /* + * Name of the ScalingPlanPooledSchedule. + */ + private String name; + /* * Set of days of the week on which this schedule is active. */ private List daysOfWeek; + /* + * The desired scaling method to be used to scale the hosts in the assigned host pool. + */ + private ScalingMethod scalingMethod; + + /* + * The properties that control how Scaling will manage the size of the hostpool by creating and deleting hosts. + */ + private CreateDeleteProperties createDelete; + /* * Starting time for ramp up period. */ @@ -45,7 +63,7 @@ public final class ScalingPlanPooledScheduleProperties /* * Capacity threshold for ramp up period. */ - private Integer rampUpCapacityThresholdPct; + private int rampUpCapacityThresholdPct; /* * Starting time for peak period. @@ -75,7 +93,7 @@ public final class ScalingPlanPooledScheduleProperties /* * Capacity threshold for ramp down period. */ - private Integer rampDownCapacityThresholdPct; + private int rampDownCapacityThresholdPct; /* * Should users be logged off forcefully from hosts. @@ -113,6 +131,15 @@ public final class ScalingPlanPooledScheduleProperties public ScalingPlanPooledScheduleProperties() { } + /** + * Get the name property: Name of the ScalingPlanPooledSchedule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + /** * Get the daysOfWeek property: Set of days of the week on which this schedule is active. * @@ -133,6 +160,50 @@ public ScalingPlanPooledScheduleProperties withDaysOfWeek(List daysOf return this; } + /** + * Get the scalingMethod property: The desired scaling method to be used to scale the hosts in the assigned host + * pool. + * + * @return the scalingMethod value. + */ + public ScalingMethod scalingMethod() { + return this.scalingMethod; + } + + /** + * Set the scalingMethod property: The desired scaling method to be used to scale the hosts in the assigned host + * pool. + * + * @param scalingMethod the scalingMethod value to set. + * @return the ScalingPlanPooledScheduleProperties object itself. + */ + public ScalingPlanPooledScheduleProperties withScalingMethod(ScalingMethod scalingMethod) { + this.scalingMethod = scalingMethod; + return this; + } + + /** + * Get the createDelete property: The properties that control how Scaling will manage the size of the hostpool by + * creating and deleting hosts. + * + * @return the createDelete value. + */ + public CreateDeleteProperties createDelete() { + return this.createDelete; + } + + /** + * Set the createDelete property: The properties that control how Scaling will manage the size of the hostpool by + * creating and deleting hosts. + * + * @param createDelete the createDelete value to set. + * @return the ScalingPlanPooledScheduleProperties object itself. + */ + public ScalingPlanPooledScheduleProperties withCreateDelete(CreateDeleteProperties createDelete) { + this.createDelete = createDelete; + return this; + } + /** * Get the rampUpStartTime property: Starting time for ramp up period. * @@ -199,7 +270,7 @@ public ScalingPlanPooledScheduleProperties withRampUpMinimumHostsPct(Integer ram * * @return the rampUpCapacityThresholdPct value. */ - public Integer rampUpCapacityThresholdPct() { + public int rampUpCapacityThresholdPct() { return this.rampUpCapacityThresholdPct; } @@ -209,7 +280,7 @@ public Integer rampUpCapacityThresholdPct() { * @param rampUpCapacityThresholdPct the rampUpCapacityThresholdPct value to set. * @return the ScalingPlanPooledScheduleProperties object itself. */ - public ScalingPlanPooledScheduleProperties withRampUpCapacityThresholdPct(Integer rampUpCapacityThresholdPct) { + public ScalingPlanPooledScheduleProperties withRampUpCapacityThresholdPct(int rampUpCapacityThresholdPct) { this.rampUpCapacityThresholdPct = rampUpCapacityThresholdPct; return this; } @@ -321,7 +392,7 @@ public ScalingPlanPooledScheduleProperties withRampDownMinimumHostsPct(Integer r * * @return the rampDownCapacityThresholdPct value. */ - public Integer rampDownCapacityThresholdPct() { + public int rampDownCapacityThresholdPct() { return this.rampDownCapacityThresholdPct; } @@ -331,7 +402,7 @@ public Integer rampDownCapacityThresholdPct() { * @param rampDownCapacityThresholdPct the rampDownCapacityThresholdPct value to set. * @return the ScalingPlanPooledScheduleProperties object itself. */ - public ScalingPlanPooledScheduleProperties withRampDownCapacityThresholdPct(Integer rampDownCapacityThresholdPct) { + public ScalingPlanPooledScheduleProperties withRampDownCapacityThresholdPct(int rampDownCapacityThresholdPct) { this.rampDownCapacityThresholdPct = rampDownCapacityThresholdPct; return this; } @@ -463,20 +534,46 @@ public SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (rampUpStartTime() != null) { + if (daysOfWeek() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property daysOfWeek in model ScalingPlanPooledScheduleProperties")); + } + if (createDelete() != null) { + createDelete().validate(); + } + if (rampUpStartTime() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property rampUpStartTime in model ScalingPlanPooledScheduleProperties")); + } else { rampUpStartTime().validate(); } - if (peakStartTime() != null) { + if (peakStartTime() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property peakStartTime in model ScalingPlanPooledScheduleProperties")); + } else { peakStartTime().validate(); } - if (rampDownStartTime() != null) { + if (rampDownStartTime() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property rampDownStartTime in model ScalingPlanPooledScheduleProperties")); + } else { rampDownStartTime().validate(); } - if (offPeakStartTime() != null) { + if (offPeakStartTime() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property offPeakStartTime in model ScalingPlanPooledScheduleProperties")); + } else { offPeakStartTime().validate(); } } + private static final ClientLogger LOGGER = new ClientLogger(ScalingPlanPooledScheduleProperties.class); + /** * {@inheritDoc} */ @@ -486,24 +583,26 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("daysOfWeek", this.daysOfWeek, (writer, element) -> writer.writeString(element == null ? null : element.toString())); jsonWriter.writeJsonField("rampUpStartTime", this.rampUpStartTime); + jsonWriter.writeIntField("rampUpCapacityThresholdPct", this.rampUpCapacityThresholdPct); + jsonWriter.writeJsonField("peakStartTime", this.peakStartTime); + jsonWriter.writeJsonField("rampDownStartTime", this.rampDownStartTime); + jsonWriter.writeIntField("rampDownCapacityThresholdPct", this.rampDownCapacityThresholdPct); + jsonWriter.writeJsonField("offPeakStartTime", this.offPeakStartTime); + jsonWriter.writeStringField("scalingMethod", this.scalingMethod == null ? null : this.scalingMethod.toString()); + jsonWriter.writeJsonField("createDelete", this.createDelete); jsonWriter.writeStringField("rampUpLoadBalancingAlgorithm", this.rampUpLoadBalancingAlgorithm == null ? null : this.rampUpLoadBalancingAlgorithm.toString()); jsonWriter.writeNumberField("rampUpMinimumHostsPct", this.rampUpMinimumHostsPct); - jsonWriter.writeNumberField("rampUpCapacityThresholdPct", this.rampUpCapacityThresholdPct); - jsonWriter.writeJsonField("peakStartTime", this.peakStartTime); jsonWriter.writeStringField("peakLoadBalancingAlgorithm", this.peakLoadBalancingAlgorithm == null ? null : this.peakLoadBalancingAlgorithm.toString()); - jsonWriter.writeJsonField("rampDownStartTime", this.rampDownStartTime); jsonWriter.writeStringField("rampDownLoadBalancingAlgorithm", this.rampDownLoadBalancingAlgorithm == null ? null : this.rampDownLoadBalancingAlgorithm.toString()); jsonWriter.writeNumberField("rampDownMinimumHostsPct", this.rampDownMinimumHostsPct); - jsonWriter.writeNumberField("rampDownCapacityThresholdPct", this.rampDownCapacityThresholdPct); jsonWriter.writeBooleanField("rampDownForceLogoffUsers", this.rampDownForceLogoffUsers); jsonWriter.writeStringField("rampDownStopHostsWhen", this.rampDownStopHostsWhen == null ? null : this.rampDownStopHostsWhen.toString()); jsonWriter.writeNumberField("rampDownWaitTimeMinutes", this.rampDownWaitTimeMinutes); jsonWriter.writeStringField("rampDownNotificationMessage", this.rampDownNotificationMessage); - jsonWriter.writeJsonField("offPeakStartTime", this.offPeakStartTime); jsonWriter.writeStringField("offPeakLoadBalancingAlgorithm", this.offPeakLoadBalancingAlgorithm == null ? null : this.offPeakLoadBalancingAlgorithm.toString()); return jsonWriter.writeEndObject(); @@ -515,6 +614,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ScalingPlanPooledScheduleProperties 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 ScalingPlanPooledScheduleProperties. */ public static ScalingPlanPooledScheduleProperties fromJson(JsonReader jsonReader) throws IOException { @@ -530,31 +630,39 @@ public static ScalingPlanPooledScheduleProperties fromJson(JsonReader jsonReader deserializedScalingPlanPooledScheduleProperties.daysOfWeek = daysOfWeek; } else if ("rampUpStartTime".equals(fieldName)) { deserializedScalingPlanPooledScheduleProperties.rampUpStartTime = Time.fromJson(reader); + } else if ("rampUpCapacityThresholdPct".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.rampUpCapacityThresholdPct = reader.getInt(); + } else if ("peakStartTime".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.peakStartTime = Time.fromJson(reader); + } else if ("rampDownStartTime".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.rampDownStartTime = Time.fromJson(reader); + } else if ("rampDownCapacityThresholdPct".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.rampDownCapacityThresholdPct = reader.getInt(); + } else if ("offPeakStartTime".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.offPeakStartTime = Time.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.name = reader.getString(); + } else if ("scalingMethod".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.scalingMethod + = ScalingMethod.fromString(reader.getString()); + } else if ("createDelete".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.createDelete + = CreateDeleteProperties.fromJson(reader); } else if ("rampUpLoadBalancingAlgorithm".equals(fieldName)) { deserializedScalingPlanPooledScheduleProperties.rampUpLoadBalancingAlgorithm = SessionHostLoadBalancingAlgorithm.fromString(reader.getString()); } else if ("rampUpMinimumHostsPct".equals(fieldName)) { deserializedScalingPlanPooledScheduleProperties.rampUpMinimumHostsPct = reader.getNullable(JsonReader::getInt); - } else if ("rampUpCapacityThresholdPct".equals(fieldName)) { - deserializedScalingPlanPooledScheduleProperties.rampUpCapacityThresholdPct - = reader.getNullable(JsonReader::getInt); - } else if ("peakStartTime".equals(fieldName)) { - deserializedScalingPlanPooledScheduleProperties.peakStartTime = Time.fromJson(reader); } else if ("peakLoadBalancingAlgorithm".equals(fieldName)) { deserializedScalingPlanPooledScheduleProperties.peakLoadBalancingAlgorithm = SessionHostLoadBalancingAlgorithm.fromString(reader.getString()); - } else if ("rampDownStartTime".equals(fieldName)) { - deserializedScalingPlanPooledScheduleProperties.rampDownStartTime = Time.fromJson(reader); } else if ("rampDownLoadBalancingAlgorithm".equals(fieldName)) { deserializedScalingPlanPooledScheduleProperties.rampDownLoadBalancingAlgorithm = SessionHostLoadBalancingAlgorithm.fromString(reader.getString()); } else if ("rampDownMinimumHostsPct".equals(fieldName)) { deserializedScalingPlanPooledScheduleProperties.rampDownMinimumHostsPct = reader.getNullable(JsonReader::getInt); - } else if ("rampDownCapacityThresholdPct".equals(fieldName)) { - deserializedScalingPlanPooledScheduleProperties.rampDownCapacityThresholdPct - = reader.getNullable(JsonReader::getInt); } else if ("rampDownForceLogoffUsers".equals(fieldName)) { deserializedScalingPlanPooledScheduleProperties.rampDownForceLogoffUsers = reader.getNullable(JsonReader::getBoolean); @@ -566,8 +674,6 @@ public static ScalingPlanPooledScheduleProperties fromJson(JsonReader jsonReader = reader.getNullable(JsonReader::getInt); } else if ("rampDownNotificationMessage".equals(fieldName)) { deserializedScalingPlanPooledScheduleProperties.rampDownNotificationMessage = reader.getString(); - } else if ("offPeakStartTime".equals(fieldName)) { - deserializedScalingPlanPooledScheduleProperties.offPeakStartTime = Time.fromJson(reader); } else if ("offPeakLoadBalancingAlgorithm".equals(fieldName)) { deserializedScalingPlanPooledScheduleProperties.offPeakLoadBalancingAlgorithm = SessionHostLoadBalancingAlgorithm.fromString(reader.getString()); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanProperties.java index f74bbdbdb6b1..b555f51882bd 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanProperties.java @@ -52,7 +52,7 @@ public final class ScalingPlanProperties implements JsonSerializable schedules; @@ -177,7 +177,7 @@ public ScalingPlanProperties withExclusionTag(String exclusionTag) { } /** - * Get the schedules property: List of ScalingPlanPooledSchedule definitions. + * Get the schedules property: List of Pooled ScalingSchedule definitions. * * @return the schedules value. */ @@ -186,7 +186,7 @@ public List schedules() { } /** - * Set the schedules property: List of ScalingPlanPooledSchedule definitions. + * Set the schedules property: List of Pooled ScalingSchedule definitions. * * @param schedules the schedules value to set. * @return the ScalingPlanProperties object itself. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostConfigurationInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostConfigurationInner.java new file mode 100644 index 000000000000..05ed410ce396 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostConfigurationInner.java @@ -0,0 +1,547 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.models.BootDiagnosticsInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DiskInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DomainInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ImageInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.KeyVaultCredentialsProperties; +import com.azure.resourcemanager.desktopvirtualization.models.NetworkInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ProvisioningStateShc; +import com.azure.resourcemanager.desktopvirtualization.models.SecurityInfoProperties; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Represents a SessionHostConfiguration definition. + */ +@Fluent +public final class SessionHostConfigurationInner extends ProxyResource { + /* + * Detailed properties for SessionHostConfiguration + */ + private SessionHostConfigurationProperties innerProperties = new SessionHostConfigurationProperties(); + + /* + * 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 SessionHostConfigurationInner class. + */ + public SessionHostConfigurationInner() { + } + + /** + * Get the innerProperties property: Detailed properties for SessionHostConfiguration. + * + * @return the innerProperties value. + */ + private SessionHostConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * Get the version property: The timestamp of the last update. + * + * @return the version value. + */ + public OffsetDateTime version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Get the friendlyName property: Friendly name to describe this version of the SessionHostConfiguration. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Set the friendlyName property: Friendly name to describe this version of the SessionHostConfiguration. + * + * @param friendlyName the friendlyName value to set. + * @return the SessionHostConfigurationInner object itself. + */ + public SessionHostConfigurationInner withFriendlyName(String friendlyName) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationProperties(); + } + this.innerProperties().withFriendlyName(friendlyName); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Session Host Configuration. + * + * @return the provisioningState value. + */ + public ProvisioningStateShc provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the vmTags property: Hashtable that lists key/value pair tags to apply to the VMs. + * + * @return the vmTags value. + */ + public Map vmTags() { + return this.innerProperties() == null ? null : this.innerProperties().vmTags(); + } + + /** + * Set the vmTags property: Hashtable that lists key/value pair tags to apply to the VMs. + * + * @param vmTags the vmTags value to set. + * @return the SessionHostConfigurationInner object itself. + */ + public SessionHostConfigurationInner withVmTags(Map vmTags) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationProperties(); + } + this.innerProperties().withVmTags(vmTags); + return this; + } + + /** + * Get the vmLocation property: The Location for the session host to be created in. It will default to the location + * of the hostpool if not provided. + * + * @return the vmLocation value. + */ + public String vmLocation() { + return this.innerProperties() == null ? null : this.innerProperties().vmLocation(); + } + + /** + * Set the vmLocation property: The Location for the session host to be created in. It will default to the location + * of the hostpool if not provided. + * + * @param vmLocation the vmLocation value to set. + * @return the SessionHostConfigurationInner object itself. + */ + public SessionHostConfigurationInner withVmLocation(String vmLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationProperties(); + } + this.innerProperties().withVmLocation(vmLocation); + return this; + } + + /** + * Get the vmResourceGroup property: The ResourceGroup for the session hosts to be created in. It will default to + * the ResourceGroup of the hostpool if not provided. + * + * @return the vmResourceGroup value. + */ + public String vmResourceGroup() { + return this.innerProperties() == null ? null : this.innerProperties().vmResourceGroup(); + } + + /** + * Set the vmResourceGroup property: The ResourceGroup for the session hosts to be created in. It will default to + * the ResourceGroup of the hostpool if not provided. + * + * @param vmResourceGroup the vmResourceGroup value to set. + * @return the SessionHostConfigurationInner object itself. + */ + public SessionHostConfigurationInner withVmResourceGroup(String vmResourceGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationProperties(); + } + this.innerProperties().withVmResourceGroup(vmResourceGroup); + return this; + } + + /** + * Get the vmNamePrefix property: The prefix that should be associated with session host names. + * + * @return the vmNamePrefix value. + */ + public String vmNamePrefix() { + return this.innerProperties() == null ? null : this.innerProperties().vmNamePrefix(); + } + + /** + * Set the vmNamePrefix property: The prefix that should be associated with session host names. + * + * @param vmNamePrefix the vmNamePrefix value to set. + * @return the SessionHostConfigurationInner object itself. + */ + public SessionHostConfigurationInner withVmNamePrefix(String vmNamePrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationProperties(); + } + this.innerProperties().withVmNamePrefix(vmNamePrefix); + return this; + } + + /** + * Get the availabilityZones property: Value for availability zones to be used by the session host. Should be from + * [1,2,3]. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.innerProperties() == null ? null : this.innerProperties().availabilityZones(); + } + + /** + * Set the availabilityZones property: Value for availability zones to be used by the session host. Should be from + * [1,2,3]. + * + * @param availabilityZones the availabilityZones value to set. + * @return the SessionHostConfigurationInner object itself. + */ + public SessionHostConfigurationInner withAvailabilityZones(List availabilityZones) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationProperties(); + } + this.innerProperties().withAvailabilityZones(availabilityZones); + return this; + } + + /** + * Get the networkInfo property: Network information. + * + * @return the networkInfo value. + */ + public NetworkInfoProperties networkInfo() { + return this.innerProperties() == null ? null : this.innerProperties().networkInfo(); + } + + /** + * Set the networkInfo property: Network information. + * + * @param networkInfo the networkInfo value to set. + * @return the SessionHostConfigurationInner object itself. + */ + public SessionHostConfigurationInner withNetworkInfo(NetworkInfoProperties networkInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationProperties(); + } + this.innerProperties().withNetworkInfo(networkInfo); + return this; + } + + /** + * Get the vmSizeId property: The id of the size of a virtual machine connected to a hostpool. Example: + * Standard_D2as_v6. + * + * @return the vmSizeId value. + */ + public String vmSizeId() { + return this.innerProperties() == null ? null : this.innerProperties().vmSizeId(); + } + + /** + * Set the vmSizeId property: The id of the size of a virtual machine connected to a hostpool. Example: + * Standard_D2as_v6. + * + * @param vmSizeId the vmSizeId value to set. + * @return the SessionHostConfigurationInner object itself. + */ + public SessionHostConfigurationInner withVmSizeId(String vmSizeId) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationProperties(); + } + this.innerProperties().withVmSizeId(vmSizeId); + return this; + } + + /** + * Get the diskInfo property: Disk information. + * + * @return the diskInfo value. + */ + public DiskInfoProperties diskInfo() { + return this.innerProperties() == null ? null : this.innerProperties().diskInfo(); + } + + /** + * Set the diskInfo property: Disk information. + * + * @param diskInfo the diskInfo value to set. + * @return the SessionHostConfigurationInner object itself. + */ + public SessionHostConfigurationInner withDiskInfo(DiskInfoProperties diskInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationProperties(); + } + this.innerProperties().withDiskInfo(diskInfo); + return this; + } + + /** + * Get the customConfigurationScriptUrl property: The uri to the storage blob containing the arm template to be run + * on the virtual machine after provisioning. + * + * @return the customConfigurationScriptUrl value. + */ + public String customConfigurationScriptUrl() { + return this.innerProperties() == null ? null : this.innerProperties().customConfigurationScriptUrl(); + } + + /** + * Set the customConfigurationScriptUrl property: The uri to the storage blob containing the arm template to be run + * on the virtual machine after provisioning. + * + * @param customConfigurationScriptUrl the customConfigurationScriptUrl value to set. + * @return the SessionHostConfigurationInner object itself. + */ + public SessionHostConfigurationInner withCustomConfigurationScriptUrl(String customConfigurationScriptUrl) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationProperties(); + } + this.innerProperties().withCustomConfigurationScriptUrl(customConfigurationScriptUrl); + return this; + } + + /** + * Get the imageInfo property: Image configurations of HostPool. + * + * @return the imageInfo value. + */ + public ImageInfoProperties imageInfo() { + return this.innerProperties() == null ? null : this.innerProperties().imageInfo(); + } + + /** + * Set the imageInfo property: Image configurations of HostPool. + * + * @param imageInfo the imageInfo value to set. + * @return the SessionHostConfigurationInner object itself. + */ + public SessionHostConfigurationInner withImageInfo(ImageInfoProperties imageInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationProperties(); + } + this.innerProperties().withImageInfo(imageInfo); + return this; + } + + /** + * Get the domainInfo property: Domain configurations of session hosts. + * + * @return the domainInfo value. + */ + public DomainInfoProperties domainInfo() { + return this.innerProperties() == null ? null : this.innerProperties().domainInfo(); + } + + /** + * Set the domainInfo property: Domain configurations of session hosts. + * + * @param domainInfo the domainInfo value to set. + * @return the SessionHostConfigurationInner object itself. + */ + public SessionHostConfigurationInner withDomainInfo(DomainInfoProperties domainInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationProperties(); + } + this.innerProperties().withDomainInfo(domainInfo); + return this; + } + + /** + * Get the securityInfo property: Security information. + * + * @return the securityInfo value. + */ + public SecurityInfoProperties securityInfo() { + return this.innerProperties() == null ? null : this.innerProperties().securityInfo(); + } + + /** + * Set the securityInfo property: Security information. + * + * @param securityInfo the securityInfo value to set. + * @return the SessionHostConfigurationInner object itself. + */ + public SessionHostConfigurationInner withSecurityInfo(SecurityInfoProperties securityInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationProperties(); + } + this.innerProperties().withSecurityInfo(securityInfo); + return this; + } + + /** + * Get the vmAdminCredentials property: Local Admin credentials for session hosts. + * + * @return the vmAdminCredentials value. + */ + public KeyVaultCredentialsProperties vmAdminCredentials() { + return this.innerProperties() == null ? null : this.innerProperties().vmAdminCredentials(); + } + + /** + * Set the vmAdminCredentials property: Local Admin credentials for session hosts. + * + * @param vmAdminCredentials the vmAdminCredentials value to set. + * @return the SessionHostConfigurationInner object itself. + */ + public SessionHostConfigurationInner withVmAdminCredentials(KeyVaultCredentialsProperties vmAdminCredentials) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationProperties(); + } + this.innerProperties().withVmAdminCredentials(vmAdminCredentials); + return this; + } + + /** + * Get the bootDiagnosticsInfo property: Boot Diagnostics information. + * + * @return the bootDiagnosticsInfo value. + */ + public BootDiagnosticsInfoProperties bootDiagnosticsInfo() { + return this.innerProperties() == null ? null : this.innerProperties().bootDiagnosticsInfo(); + } + + /** + * Set the bootDiagnosticsInfo property: Boot Diagnostics information. + * + * @param bootDiagnosticsInfo the bootDiagnosticsInfo value to set. + * @return the SessionHostConfigurationInner object itself. + */ + public SessionHostConfigurationInner withBootDiagnosticsInfo(BootDiagnosticsInfoProperties bootDiagnosticsInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationProperties(); + } + this.innerProperties().withBootDiagnosticsInfo(bootDiagnosticsInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model SessionHostConfigurationInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SessionHostConfigurationInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostConfigurationInner 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 SessionHostConfigurationInner. + */ + public static SessionHostConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostConfigurationInner deserializedSessionHostConfigurationInner + = new SessionHostConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSessionHostConfigurationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSessionHostConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSessionHostConfigurationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSessionHostConfigurationInner.innerProperties + = SessionHostConfigurationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSessionHostConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostConfigurationInner; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostConfigurationPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostConfigurationPatchProperties.java new file mode 100644 index 000000000000..a8f1e3a4a54b --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostConfigurationPatchProperties.java @@ -0,0 +1,540 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent.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 com.azure.resourcemanager.desktopvirtualization.models.BootDiagnosticsInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DiskInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DomainInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ImageInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.KeyVaultCredentialsPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.NetworkInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SecurityInfoPatchProperties; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Session host configurations of HostPool. + */ +@Fluent +public final class SessionHostConfigurationPatchProperties + implements JsonSerializable { + /* + * Friendly name to describe this version of the SessionHostConfiguration. + */ + private String friendlyName; + + /* + * Hashtable that lists key/value pair tags to apply to the VMs + */ + private Map vmTags; + + /* + * The Location for the session host to be created in + */ + private String vmLocation; + + /* + * The ResourceGroup for the session hosts to be created in. It will default to the ResourceGroup of the hostpool if + * not provided. + */ + private String vmResourceGroup; + + /* + * The prefix that should be associated with session host names + */ + private String vmNamePrefix; + + /* + * Value for availability zones to be used by the session host. Should be from [1,2,3]. + */ + private List availabilityZones; + + /* + * Network information. + */ + private NetworkInfoPatchProperties networkInfo; + + /* + * The id of the size of a virtual machine connected to a hostpool. Example: Standard_D2as_v6 + */ + private String vmSizeId; + + /* + * Disk information. + */ + private DiskInfoPatchProperties diskInfo; + + /* + * The uri to the storage blob containing the arm template to be run on the virtual machine after provisioning. + */ + private String customConfigurationScriptUrl; + + /* + * Image configurations of HostPool. + */ + private ImageInfoPatchProperties imageInfo; + + /* + * Domain configurations of session hosts. + */ + private DomainInfoPatchProperties domainInfo; + + /* + * Security information. + */ + private SecurityInfoPatchProperties securityInfo; + + /* + * Local Admin credentials for session hosts. + */ + private KeyVaultCredentialsPatchProperties vmAdminCredentials; + + /* + * Boot Diagnostics information. + */ + private BootDiagnosticsInfoPatchProperties bootDiagnosticsInfo; + + /** + * Creates an instance of SessionHostConfigurationPatchProperties class. + */ + public SessionHostConfigurationPatchProperties() { + } + + /** + * Get the friendlyName property: Friendly name to describe this version of the SessionHostConfiguration. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name to describe this version of the SessionHostConfiguration. + * + * @param friendlyName the friendlyName value to set. + * @return the SessionHostConfigurationPatchProperties object itself. + */ + public SessionHostConfigurationPatchProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the vmTags property: Hashtable that lists key/value pair tags to apply to the VMs. + * + * @return the vmTags value. + */ + public Map vmTags() { + return this.vmTags; + } + + /** + * Set the vmTags property: Hashtable that lists key/value pair tags to apply to the VMs. + * + * @param vmTags the vmTags value to set. + * @return the SessionHostConfigurationPatchProperties object itself. + */ + public SessionHostConfigurationPatchProperties withVmTags(Map vmTags) { + this.vmTags = vmTags; + return this; + } + + /** + * Get the vmLocation property: The Location for the session host to be created in. + * + * @return the vmLocation value. + */ + public String vmLocation() { + return this.vmLocation; + } + + /** + * Set the vmLocation property: The Location for the session host to be created in. + * + * @param vmLocation the vmLocation value to set. + * @return the SessionHostConfigurationPatchProperties object itself. + */ + public SessionHostConfigurationPatchProperties withVmLocation(String vmLocation) { + this.vmLocation = vmLocation; + return this; + } + + /** + * Get the vmResourceGroup property: The ResourceGroup for the session hosts to be created in. It will default to + * the ResourceGroup of the hostpool if not provided. + * + * @return the vmResourceGroup value. + */ + public String vmResourceGroup() { + return this.vmResourceGroup; + } + + /** + * Set the vmResourceGroup property: The ResourceGroup for the session hosts to be created in. It will default to + * the ResourceGroup of the hostpool if not provided. + * + * @param vmResourceGroup the vmResourceGroup value to set. + * @return the SessionHostConfigurationPatchProperties object itself. + */ + public SessionHostConfigurationPatchProperties withVmResourceGroup(String vmResourceGroup) { + this.vmResourceGroup = vmResourceGroup; + return this; + } + + /** + * Get the vmNamePrefix property: The prefix that should be associated with session host names. + * + * @return the vmNamePrefix value. + */ + public String vmNamePrefix() { + return this.vmNamePrefix; + } + + /** + * Set the vmNamePrefix property: The prefix that should be associated with session host names. + * + * @param vmNamePrefix the vmNamePrefix value to set. + * @return the SessionHostConfigurationPatchProperties object itself. + */ + public SessionHostConfigurationPatchProperties withVmNamePrefix(String vmNamePrefix) { + this.vmNamePrefix = vmNamePrefix; + return this; + } + + /** + * Get the availabilityZones property: Value for availability zones to be used by the session host. Should be from + * [1,2,3]. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.availabilityZones; + } + + /** + * Set the availabilityZones property: Value for availability zones to be used by the session host. Should be from + * [1,2,3]. + * + * @param availabilityZones the availabilityZones value to set. + * @return the SessionHostConfigurationPatchProperties object itself. + */ + public SessionHostConfigurationPatchProperties withAvailabilityZones(List availabilityZones) { + this.availabilityZones = availabilityZones; + return this; + } + + /** + * Get the networkInfo property: Network information. + * + * @return the networkInfo value. + */ + public NetworkInfoPatchProperties networkInfo() { + return this.networkInfo; + } + + /** + * Set the networkInfo property: Network information. + * + * @param networkInfo the networkInfo value to set. + * @return the SessionHostConfigurationPatchProperties object itself. + */ + public SessionHostConfigurationPatchProperties withNetworkInfo(NetworkInfoPatchProperties networkInfo) { + this.networkInfo = networkInfo; + return this; + } + + /** + * Get the vmSizeId property: The id of the size of a virtual machine connected to a hostpool. Example: + * Standard_D2as_v6. + * + * @return the vmSizeId value. + */ + public String vmSizeId() { + return this.vmSizeId; + } + + /** + * Set the vmSizeId property: The id of the size of a virtual machine connected to a hostpool. Example: + * Standard_D2as_v6. + * + * @param vmSizeId the vmSizeId value to set. + * @return the SessionHostConfigurationPatchProperties object itself. + */ + public SessionHostConfigurationPatchProperties withVmSizeId(String vmSizeId) { + this.vmSizeId = vmSizeId; + return this; + } + + /** + * Get the diskInfo property: Disk information. + * + * @return the diskInfo value. + */ + public DiskInfoPatchProperties diskInfo() { + return this.diskInfo; + } + + /** + * Set the diskInfo property: Disk information. + * + * @param diskInfo the diskInfo value to set. + * @return the SessionHostConfigurationPatchProperties object itself. + */ + public SessionHostConfigurationPatchProperties withDiskInfo(DiskInfoPatchProperties diskInfo) { + this.diskInfo = diskInfo; + return this; + } + + /** + * Get the customConfigurationScriptUrl property: The uri to the storage blob containing the arm template to be run + * on the virtual machine after provisioning. + * + * @return the customConfigurationScriptUrl value. + */ + public String customConfigurationScriptUrl() { + return this.customConfigurationScriptUrl; + } + + /** + * Set the customConfigurationScriptUrl property: The uri to the storage blob containing the arm template to be run + * on the virtual machine after provisioning. + * + * @param customConfigurationScriptUrl the customConfigurationScriptUrl value to set. + * @return the SessionHostConfigurationPatchProperties object itself. + */ + public SessionHostConfigurationPatchProperties + withCustomConfigurationScriptUrl(String customConfigurationScriptUrl) { + this.customConfigurationScriptUrl = customConfigurationScriptUrl; + return this; + } + + /** + * Get the imageInfo property: Image configurations of HostPool. + * + * @return the imageInfo value. + */ + public ImageInfoPatchProperties imageInfo() { + return this.imageInfo; + } + + /** + * Set the imageInfo property: Image configurations of HostPool. + * + * @param imageInfo the imageInfo value to set. + * @return the SessionHostConfigurationPatchProperties object itself. + */ + public SessionHostConfigurationPatchProperties withImageInfo(ImageInfoPatchProperties imageInfo) { + this.imageInfo = imageInfo; + return this; + } + + /** + * Get the domainInfo property: Domain configurations of session hosts. + * + * @return the domainInfo value. + */ + public DomainInfoPatchProperties domainInfo() { + return this.domainInfo; + } + + /** + * Set the domainInfo property: Domain configurations of session hosts. + * + * @param domainInfo the domainInfo value to set. + * @return the SessionHostConfigurationPatchProperties object itself. + */ + public SessionHostConfigurationPatchProperties withDomainInfo(DomainInfoPatchProperties domainInfo) { + this.domainInfo = domainInfo; + return this; + } + + /** + * Get the securityInfo property: Security information. + * + * @return the securityInfo value. + */ + public SecurityInfoPatchProperties securityInfo() { + return this.securityInfo; + } + + /** + * Set the securityInfo property: Security information. + * + * @param securityInfo the securityInfo value to set. + * @return the SessionHostConfigurationPatchProperties object itself. + */ + public SessionHostConfigurationPatchProperties withSecurityInfo(SecurityInfoPatchProperties securityInfo) { + this.securityInfo = securityInfo; + return this; + } + + /** + * Get the vmAdminCredentials property: Local Admin credentials for session hosts. + * + * @return the vmAdminCredentials value. + */ + public KeyVaultCredentialsPatchProperties vmAdminCredentials() { + return this.vmAdminCredentials; + } + + /** + * Set the vmAdminCredentials property: Local Admin credentials for session hosts. + * + * @param vmAdminCredentials the vmAdminCredentials value to set. + * @return the SessionHostConfigurationPatchProperties object itself. + */ + public SessionHostConfigurationPatchProperties + withVmAdminCredentials(KeyVaultCredentialsPatchProperties vmAdminCredentials) { + this.vmAdminCredentials = vmAdminCredentials; + return this; + } + + /** + * Get the bootDiagnosticsInfo property: Boot Diagnostics information. + * + * @return the bootDiagnosticsInfo value. + */ + public BootDiagnosticsInfoPatchProperties bootDiagnosticsInfo() { + return this.bootDiagnosticsInfo; + } + + /** + * Set the bootDiagnosticsInfo property: Boot Diagnostics information. + * + * @param bootDiagnosticsInfo the bootDiagnosticsInfo value to set. + * @return the SessionHostConfigurationPatchProperties object itself. + */ + public SessionHostConfigurationPatchProperties + withBootDiagnosticsInfo(BootDiagnosticsInfoPatchProperties bootDiagnosticsInfo) { + this.bootDiagnosticsInfo = bootDiagnosticsInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkInfo() != null) { + networkInfo().validate(); + } + if (diskInfo() != null) { + diskInfo().validate(); + } + if (imageInfo() != null) { + imageInfo().validate(); + } + if (domainInfo() != null) { + domainInfo().validate(); + } + if (securityInfo() != null) { + securityInfo().validate(); + } + if (vmAdminCredentials() != null) { + vmAdminCredentials().validate(); + } + if (bootDiagnosticsInfo() != null) { + bootDiagnosticsInfo().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeMapField("vmTags", this.vmTags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("vmLocation", this.vmLocation); + jsonWriter.writeStringField("vmResourceGroup", this.vmResourceGroup); + jsonWriter.writeStringField("vmNamePrefix", this.vmNamePrefix); + jsonWriter.writeArrayField("availabilityZones", this.availabilityZones, + (writer, element) -> writer.writeInt(element)); + jsonWriter.writeJsonField("networkInfo", this.networkInfo); + jsonWriter.writeStringField("vmSizeId", this.vmSizeId); + jsonWriter.writeJsonField("diskInfo", this.diskInfo); + jsonWriter.writeStringField("customConfigurationScriptUrl", this.customConfigurationScriptUrl); + jsonWriter.writeJsonField("imageInfo", this.imageInfo); + jsonWriter.writeJsonField("domainInfo", this.domainInfo); + jsonWriter.writeJsonField("securityInfo", this.securityInfo); + jsonWriter.writeJsonField("vmAdminCredentials", this.vmAdminCredentials); + jsonWriter.writeJsonField("bootDiagnosticsInfo", this.bootDiagnosticsInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostConfigurationPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostConfigurationPatchProperties 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 SessionHostConfigurationPatchProperties. + */ + public static SessionHostConfigurationPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostConfigurationPatchProperties deserializedSessionHostConfigurationPatchProperties + = new SessionHostConfigurationPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("friendlyName".equals(fieldName)) { + deserializedSessionHostConfigurationPatchProperties.friendlyName = reader.getString(); + } else if ("vmTags".equals(fieldName)) { + Map vmTags = reader.readMap(reader1 -> reader1.getString()); + deserializedSessionHostConfigurationPatchProperties.vmTags = vmTags; + } else if ("vmLocation".equals(fieldName)) { + deserializedSessionHostConfigurationPatchProperties.vmLocation = reader.getString(); + } else if ("vmResourceGroup".equals(fieldName)) { + deserializedSessionHostConfigurationPatchProperties.vmResourceGroup = reader.getString(); + } else if ("vmNamePrefix".equals(fieldName)) { + deserializedSessionHostConfigurationPatchProperties.vmNamePrefix = reader.getString(); + } else if ("availabilityZones".equals(fieldName)) { + List availabilityZones = reader.readArray(reader1 -> reader1.getInt()); + deserializedSessionHostConfigurationPatchProperties.availabilityZones = availabilityZones; + } else if ("networkInfo".equals(fieldName)) { + deserializedSessionHostConfigurationPatchProperties.networkInfo + = NetworkInfoPatchProperties.fromJson(reader); + } else if ("vmSizeId".equals(fieldName)) { + deserializedSessionHostConfigurationPatchProperties.vmSizeId = reader.getString(); + } else if ("diskInfo".equals(fieldName)) { + deserializedSessionHostConfigurationPatchProperties.diskInfo + = DiskInfoPatchProperties.fromJson(reader); + } else if ("customConfigurationScriptUrl".equals(fieldName)) { + deserializedSessionHostConfigurationPatchProperties.customConfigurationScriptUrl + = reader.getString(); + } else if ("imageInfo".equals(fieldName)) { + deserializedSessionHostConfigurationPatchProperties.imageInfo + = ImageInfoPatchProperties.fromJson(reader); + } else if ("domainInfo".equals(fieldName)) { + deserializedSessionHostConfigurationPatchProperties.domainInfo + = DomainInfoPatchProperties.fromJson(reader); + } else if ("securityInfo".equals(fieldName)) { + deserializedSessionHostConfigurationPatchProperties.securityInfo + = SecurityInfoPatchProperties.fromJson(reader); + } else if ("vmAdminCredentials".equals(fieldName)) { + deserializedSessionHostConfigurationPatchProperties.vmAdminCredentials + = KeyVaultCredentialsPatchProperties.fromJson(reader); + } else if ("bootDiagnosticsInfo".equals(fieldName)) { + deserializedSessionHostConfigurationPatchProperties.bootDiagnosticsInfo + = BootDiagnosticsInfoPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostConfigurationPatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostConfigurationProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostConfigurationProperties.java new file mode 100644 index 000000000000..14f97811cd8b --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostConfigurationProperties.java @@ -0,0 +1,606 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.models.BootDiagnosticsInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DiskInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DomainInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ImageInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.KeyVaultCredentialsProperties; +import com.azure.resourcemanager.desktopvirtualization.models.NetworkInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ProvisioningStateShc; +import com.azure.resourcemanager.desktopvirtualization.models.SecurityInfoProperties; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Session host configurations of HostPool. + */ +@Fluent +public final class SessionHostConfigurationProperties implements JsonSerializable { + /* + * The timestamp of the last update. + */ + private OffsetDateTime version; + + /* + * Friendly name to describe this version of the SessionHostConfiguration. + */ + private String friendlyName; + + /* + * Provisioning state of the Session Host Configuration. + */ + private ProvisioningStateShc provisioningState; + + /* + * Hashtable that lists key/value pair tags to apply to the VMs + */ + private Map vmTags; + + /* + * The Location for the session host to be created in. It will default to the location of the hostpool if not + * provided. + */ + private String vmLocation; + + /* + * The ResourceGroup for the session hosts to be created in. It will default to the ResourceGroup of the hostpool if + * not provided. + */ + private String vmResourceGroup; + + /* + * The prefix that should be associated with session host names + */ + private String vmNamePrefix; + + /* + * Value for availability zones to be used by the session host. Should be from [1,2,3]. + */ + private List availabilityZones; + + /* + * Network information. + */ + private NetworkInfoProperties networkInfo; + + /* + * The id of the size of a virtual machine connected to a hostpool. Example: Standard_D2as_v6 + */ + private String vmSizeId; + + /* + * Disk information. + */ + private DiskInfoProperties diskInfo; + + /* + * The uri to the storage blob containing the arm template to be run on the virtual machine after provisioning. + */ + private String customConfigurationScriptUrl; + + /* + * Image configurations of HostPool. + */ + private ImageInfoProperties imageInfo; + + /* + * Domain configurations of session hosts. + */ + private DomainInfoProperties domainInfo; + + /* + * Security information. + */ + private SecurityInfoProperties securityInfo; + + /* + * Local Admin credentials for session hosts. + */ + private KeyVaultCredentialsProperties vmAdminCredentials; + + /* + * Boot Diagnostics information. + */ + private BootDiagnosticsInfoProperties bootDiagnosticsInfo; + + /** + * Creates an instance of SessionHostConfigurationProperties class. + */ + public SessionHostConfigurationProperties() { + } + + /** + * Get the version property: The timestamp of the last update. + * + * @return the version value. + */ + public OffsetDateTime version() { + return this.version; + } + + /** + * Get the friendlyName property: Friendly name to describe this version of the SessionHostConfiguration. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name to describe this version of the SessionHostConfiguration. + * + * @param friendlyName the friendlyName value to set. + * @return the SessionHostConfigurationProperties object itself. + */ + public SessionHostConfigurationProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Session Host Configuration. + * + * @return the provisioningState value. + */ + public ProvisioningStateShc provisioningState() { + return this.provisioningState; + } + + /** + * Get the vmTags property: Hashtable that lists key/value pair tags to apply to the VMs. + * + * @return the vmTags value. + */ + public Map vmTags() { + return this.vmTags; + } + + /** + * Set the vmTags property: Hashtable that lists key/value pair tags to apply to the VMs. + * + * @param vmTags the vmTags value to set. + * @return the SessionHostConfigurationProperties object itself. + */ + public SessionHostConfigurationProperties withVmTags(Map vmTags) { + this.vmTags = vmTags; + return this; + } + + /** + * Get the vmLocation property: The Location for the session host to be created in. It will default to the location + * of the hostpool if not provided. + * + * @return the vmLocation value. + */ + public String vmLocation() { + return this.vmLocation; + } + + /** + * Set the vmLocation property: The Location for the session host to be created in. It will default to the location + * of the hostpool if not provided. + * + * @param vmLocation the vmLocation value to set. + * @return the SessionHostConfigurationProperties object itself. + */ + public SessionHostConfigurationProperties withVmLocation(String vmLocation) { + this.vmLocation = vmLocation; + return this; + } + + /** + * Get the vmResourceGroup property: The ResourceGroup for the session hosts to be created in. It will default to + * the ResourceGroup of the hostpool if not provided. + * + * @return the vmResourceGroup value. + */ + public String vmResourceGroup() { + return this.vmResourceGroup; + } + + /** + * Set the vmResourceGroup property: The ResourceGroup for the session hosts to be created in. It will default to + * the ResourceGroup of the hostpool if not provided. + * + * @param vmResourceGroup the vmResourceGroup value to set. + * @return the SessionHostConfigurationProperties object itself. + */ + public SessionHostConfigurationProperties withVmResourceGroup(String vmResourceGroup) { + this.vmResourceGroup = vmResourceGroup; + return this; + } + + /** + * Get the vmNamePrefix property: The prefix that should be associated with session host names. + * + * @return the vmNamePrefix value. + */ + public String vmNamePrefix() { + return this.vmNamePrefix; + } + + /** + * Set the vmNamePrefix property: The prefix that should be associated with session host names. + * + * @param vmNamePrefix the vmNamePrefix value to set. + * @return the SessionHostConfigurationProperties object itself. + */ + public SessionHostConfigurationProperties withVmNamePrefix(String vmNamePrefix) { + this.vmNamePrefix = vmNamePrefix; + return this; + } + + /** + * Get the availabilityZones property: Value for availability zones to be used by the session host. Should be from + * [1,2,3]. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.availabilityZones; + } + + /** + * Set the availabilityZones property: Value for availability zones to be used by the session host. Should be from + * [1,2,3]. + * + * @param availabilityZones the availabilityZones value to set. + * @return the SessionHostConfigurationProperties object itself. + */ + public SessionHostConfigurationProperties withAvailabilityZones(List availabilityZones) { + this.availabilityZones = availabilityZones; + return this; + } + + /** + * Get the networkInfo property: Network information. + * + * @return the networkInfo value. + */ + public NetworkInfoProperties networkInfo() { + return this.networkInfo; + } + + /** + * Set the networkInfo property: Network information. + * + * @param networkInfo the networkInfo value to set. + * @return the SessionHostConfigurationProperties object itself. + */ + public SessionHostConfigurationProperties withNetworkInfo(NetworkInfoProperties networkInfo) { + this.networkInfo = networkInfo; + return this; + } + + /** + * Get the vmSizeId property: The id of the size of a virtual machine connected to a hostpool. Example: + * Standard_D2as_v6. + * + * @return the vmSizeId value. + */ + public String vmSizeId() { + return this.vmSizeId; + } + + /** + * Set the vmSizeId property: The id of the size of a virtual machine connected to a hostpool. Example: + * Standard_D2as_v6. + * + * @param vmSizeId the vmSizeId value to set. + * @return the SessionHostConfigurationProperties object itself. + */ + public SessionHostConfigurationProperties withVmSizeId(String vmSizeId) { + this.vmSizeId = vmSizeId; + return this; + } + + /** + * Get the diskInfo property: Disk information. + * + * @return the diskInfo value. + */ + public DiskInfoProperties diskInfo() { + return this.diskInfo; + } + + /** + * Set the diskInfo property: Disk information. + * + * @param diskInfo the diskInfo value to set. + * @return the SessionHostConfigurationProperties object itself. + */ + public SessionHostConfigurationProperties withDiskInfo(DiskInfoProperties diskInfo) { + this.diskInfo = diskInfo; + return this; + } + + /** + * Get the customConfigurationScriptUrl property: The uri to the storage blob containing the arm template to be run + * on the virtual machine after provisioning. + * + * @return the customConfigurationScriptUrl value. + */ + public String customConfigurationScriptUrl() { + return this.customConfigurationScriptUrl; + } + + /** + * Set the customConfigurationScriptUrl property: The uri to the storage blob containing the arm template to be run + * on the virtual machine after provisioning. + * + * @param customConfigurationScriptUrl the customConfigurationScriptUrl value to set. + * @return the SessionHostConfigurationProperties object itself. + */ + public SessionHostConfigurationProperties withCustomConfigurationScriptUrl(String customConfigurationScriptUrl) { + this.customConfigurationScriptUrl = customConfigurationScriptUrl; + return this; + } + + /** + * Get the imageInfo property: Image configurations of HostPool. + * + * @return the imageInfo value. + */ + public ImageInfoProperties imageInfo() { + return this.imageInfo; + } + + /** + * Set the imageInfo property: Image configurations of HostPool. + * + * @param imageInfo the imageInfo value to set. + * @return the SessionHostConfigurationProperties object itself. + */ + public SessionHostConfigurationProperties withImageInfo(ImageInfoProperties imageInfo) { + this.imageInfo = imageInfo; + return this; + } + + /** + * Get the domainInfo property: Domain configurations of session hosts. + * + * @return the domainInfo value. + */ + public DomainInfoProperties domainInfo() { + return this.domainInfo; + } + + /** + * Set the domainInfo property: Domain configurations of session hosts. + * + * @param domainInfo the domainInfo value to set. + * @return the SessionHostConfigurationProperties object itself. + */ + public SessionHostConfigurationProperties withDomainInfo(DomainInfoProperties domainInfo) { + this.domainInfo = domainInfo; + return this; + } + + /** + * Get the securityInfo property: Security information. + * + * @return the securityInfo value. + */ + public SecurityInfoProperties securityInfo() { + return this.securityInfo; + } + + /** + * Set the securityInfo property: Security information. + * + * @param securityInfo the securityInfo value to set. + * @return the SessionHostConfigurationProperties object itself. + */ + public SessionHostConfigurationProperties withSecurityInfo(SecurityInfoProperties securityInfo) { + this.securityInfo = securityInfo; + return this; + } + + /** + * Get the vmAdminCredentials property: Local Admin credentials for session hosts. + * + * @return the vmAdminCredentials value. + */ + public KeyVaultCredentialsProperties vmAdminCredentials() { + return this.vmAdminCredentials; + } + + /** + * Set the vmAdminCredentials property: Local Admin credentials for session hosts. + * + * @param vmAdminCredentials the vmAdminCredentials value to set. + * @return the SessionHostConfigurationProperties object itself. + */ + public SessionHostConfigurationProperties withVmAdminCredentials(KeyVaultCredentialsProperties vmAdminCredentials) { + this.vmAdminCredentials = vmAdminCredentials; + return this; + } + + /** + * Get the bootDiagnosticsInfo property: Boot Diagnostics information. + * + * @return the bootDiagnosticsInfo value. + */ + public BootDiagnosticsInfoProperties bootDiagnosticsInfo() { + return this.bootDiagnosticsInfo; + } + + /** + * Set the bootDiagnosticsInfo property: Boot Diagnostics information. + * + * @param bootDiagnosticsInfo the bootDiagnosticsInfo value to set. + * @return the SessionHostConfigurationProperties object itself. + */ + public SessionHostConfigurationProperties + withBootDiagnosticsInfo(BootDiagnosticsInfoProperties bootDiagnosticsInfo) { + this.bootDiagnosticsInfo = bootDiagnosticsInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vmNamePrefix() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property vmNamePrefix in model SessionHostConfigurationProperties")); + } + if (networkInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property networkInfo in model SessionHostConfigurationProperties")); + } else { + networkInfo().validate(); + } + if (vmSizeId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property vmSizeId in model SessionHostConfigurationProperties")); + } + if (diskInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property diskInfo in model SessionHostConfigurationProperties")); + } else { + diskInfo().validate(); + } + if (imageInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property imageInfo in model SessionHostConfigurationProperties")); + } else { + imageInfo().validate(); + } + if (domainInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property domainInfo in model SessionHostConfigurationProperties")); + } else { + domainInfo().validate(); + } + if (securityInfo() != null) { + securityInfo().validate(); + } + if (vmAdminCredentials() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property vmAdminCredentials in model SessionHostConfigurationProperties")); + } else { + vmAdminCredentials().validate(); + } + if (bootDiagnosticsInfo() != null) { + bootDiagnosticsInfo().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SessionHostConfigurationProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vmNamePrefix", this.vmNamePrefix); + jsonWriter.writeJsonField("networkInfo", this.networkInfo); + jsonWriter.writeStringField("vmSizeId", this.vmSizeId); + jsonWriter.writeJsonField("diskInfo", this.diskInfo); + jsonWriter.writeJsonField("imageInfo", this.imageInfo); + jsonWriter.writeJsonField("domainInfo", this.domainInfo); + jsonWriter.writeJsonField("vmAdminCredentials", this.vmAdminCredentials); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeMapField("vmTags", this.vmTags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("vmLocation", this.vmLocation); + jsonWriter.writeStringField("vmResourceGroup", this.vmResourceGroup); + jsonWriter.writeArrayField("availabilityZones", this.availabilityZones, + (writer, element) -> writer.writeInt(element)); + jsonWriter.writeStringField("customConfigurationScriptUrl", this.customConfigurationScriptUrl); + jsonWriter.writeJsonField("securityInfo", this.securityInfo); + jsonWriter.writeJsonField("bootDiagnosticsInfo", this.bootDiagnosticsInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostConfigurationProperties 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 SessionHostConfigurationProperties. + */ + public static SessionHostConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostConfigurationProperties deserializedSessionHostConfigurationProperties + = new SessionHostConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmNamePrefix".equals(fieldName)) { + deserializedSessionHostConfigurationProperties.vmNamePrefix = reader.getString(); + } else if ("networkInfo".equals(fieldName)) { + deserializedSessionHostConfigurationProperties.networkInfo = NetworkInfoProperties.fromJson(reader); + } else if ("vmSizeId".equals(fieldName)) { + deserializedSessionHostConfigurationProperties.vmSizeId = reader.getString(); + } else if ("diskInfo".equals(fieldName)) { + deserializedSessionHostConfigurationProperties.diskInfo = DiskInfoProperties.fromJson(reader); + } else if ("imageInfo".equals(fieldName)) { + deserializedSessionHostConfigurationProperties.imageInfo = ImageInfoProperties.fromJson(reader); + } else if ("domainInfo".equals(fieldName)) { + deserializedSessionHostConfigurationProperties.domainInfo = DomainInfoProperties.fromJson(reader); + } else if ("vmAdminCredentials".equals(fieldName)) { + deserializedSessionHostConfigurationProperties.vmAdminCredentials + = KeyVaultCredentialsProperties.fromJson(reader); + } else if ("version".equals(fieldName)) { + deserializedSessionHostConfigurationProperties.version = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("friendlyName".equals(fieldName)) { + deserializedSessionHostConfigurationProperties.friendlyName = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedSessionHostConfigurationProperties.provisioningState + = ProvisioningStateShc.fromString(reader.getString()); + } else if ("vmTags".equals(fieldName)) { + Map vmTags = reader.readMap(reader1 -> reader1.getString()); + deserializedSessionHostConfigurationProperties.vmTags = vmTags; + } else if ("vmLocation".equals(fieldName)) { + deserializedSessionHostConfigurationProperties.vmLocation = reader.getString(); + } else if ("vmResourceGroup".equals(fieldName)) { + deserializedSessionHostConfigurationProperties.vmResourceGroup = reader.getString(); + } else if ("availabilityZones".equals(fieldName)) { + List availabilityZones = reader.readArray(reader1 -> reader1.getInt()); + deserializedSessionHostConfigurationProperties.availabilityZones = availabilityZones; + } else if ("customConfigurationScriptUrl".equals(fieldName)) { + deserializedSessionHostConfigurationProperties.customConfigurationScriptUrl = reader.getString(); + } else if ("securityInfo".equals(fieldName)) { + deserializedSessionHostConfigurationProperties.securityInfo + = SecurityInfoProperties.fromJson(reader); + } else if ("bootDiagnosticsInfo".equals(fieldName)) { + deserializedSessionHostConfigurationProperties.bootDiagnosticsInfo + = BootDiagnosticsInfoProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostConfigurationProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostInner.java index 700013657574..fb291f23184a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostInner.java @@ -101,6 +101,75 @@ public String id() { return this.id; } + /** + * Get the activeSessions property: Number of active sessions on SessionHost. + * + * @return the activeSessions value. + */ + public Integer activeSessions() { + return this.innerProperties() == null ? null : this.innerProperties().activeSessions(); + } + + /** + * Set the activeSessions property: Number of active sessions on SessionHost. + * + * @param activeSessions the activeSessions value to set. + * @return the SessionHostInner object itself. + */ + public SessionHostInner withActiveSessions(Integer activeSessions) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostProperties(); + } + this.innerProperties().withActiveSessions(activeSessions); + return this; + } + + /** + * Get the disconnectedSessions property: Number of disconnected sessions on SessionHost. + * + * @return the disconnectedSessions value. + */ + public Integer disconnectedSessions() { + return this.innerProperties() == null ? null : this.innerProperties().disconnectedSessions(); + } + + /** + * Set the disconnectedSessions property: Number of disconnected sessions on SessionHost. + * + * @param disconnectedSessions the disconnectedSessions value to set. + * @return the SessionHostInner object itself. + */ + public SessionHostInner withDisconnectedSessions(Integer disconnectedSessions) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostProperties(); + } + this.innerProperties().withDisconnectedSessions(disconnectedSessions); + return this; + } + + /** + * Get the pendingSessions property: Number of pending sessions on SessionHost. + * + * @return the pendingSessions value. + */ + public Integer pendingSessions() { + return this.innerProperties() == null ? null : this.innerProperties().pendingSessions(); + } + + /** + * Set the pendingSessions property: Number of pending sessions on SessionHost. + * + * @param pendingSessions the pendingSessions value to set. + * @return the SessionHostInner object itself. + */ + public SessionHostInner withPendingSessions(Integer pendingSessions) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostProperties(); + } + this.innerProperties().withPendingSessions(pendingSessions); + return this; + } + /** * Get the objectId property: ObjectId of SessionHost. (internal use). * @@ -399,6 +468,25 @@ public SessionHostInner withUpdateErrorMessage(String updateErrorMessage) { return this; } + /** + * Get the lastSessionHostUpdateTime property: The last time update was completed. + * + * @return the lastSessionHostUpdateTime value. + */ + public OffsetDateTime lastSessionHostUpdateTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastSessionHostUpdateTime(); + } + + /** + * Get the sessionHostConfiguration property: SessionHostConfiguration version reference at the time the update is + * initiated, in the format of date time. Example: 2024-04-26T04:56:45Z. + * + * @return the sessionHostConfiguration value. + */ + public String sessionHostConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().sessionHostConfiguration(); + } + /** * Get the sessionHostHealthCheckResults property: List of SessionHostHealthCheckReports. * diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementInner.java new file mode 100644 index 000000000000..3c074310503f --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementInner.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationProperties; +import java.io.IOException; + +/** + * Represents a SessionHostManagement definition. + */ +@Fluent +public final class SessionHostManagementInner extends ProxyResource { + /* + * Detailed properties for SessionHostManagement + */ + private SessionHostManagementProperties innerProperties = new SessionHostManagementProperties(); + + /* + * 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 SessionHostManagementInner class. + */ + public SessionHostManagementInner() { + } + + /** + * Get the innerProperties property: Detailed properties for SessionHostManagement. + * + * @return the innerProperties value. + */ + private SessionHostManagementProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * Get the scheduledDateTimeZone property: Time zone for sessionHostManagement operations as defined in + * https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set if useLocalTime is + * true. + * + * @return the scheduledDateTimeZone value. + */ + public String scheduledDateTimeZone() { + return this.innerProperties() == null ? null : this.innerProperties().scheduledDateTimeZone(); + } + + /** + * Set the scheduledDateTimeZone property: Time zone for sessionHostManagement operations as defined in + * https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set if useLocalTime is + * true. + * + * @param scheduledDateTimeZone the scheduledDateTimeZone value to set. + * @return the SessionHostManagementInner object itself. + */ + public SessionHostManagementInner withScheduledDateTimeZone(String scheduledDateTimeZone) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostManagementProperties(); + } + this.innerProperties().withScheduledDateTimeZone(scheduledDateTimeZone); + return this; + } + + /** + * Get the update property: Parameters for a hostpool update. + * + * @return the update value. + */ + public HostPoolUpdateConfigurationProperties update() { + return this.innerProperties() == null ? null : this.innerProperties().update(); + } + + /** + * Set the update property: Parameters for a hostpool update. + * + * @param update the update value to set. + * @return the SessionHostManagementInner object itself. + */ + public SessionHostManagementInner withUpdate(HostPoolUpdateConfigurationProperties update) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostManagementProperties(); + } + this.innerProperties().withUpdate(update); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model SessionHostManagementInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SessionHostManagementInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostManagementInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostManagementInner 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 SessionHostManagementInner. + */ + public static SessionHostManagementInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostManagementInner deserializedSessionHostManagementInner = new SessionHostManagementInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSessionHostManagementInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSessionHostManagementInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSessionHostManagementInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSessionHostManagementInner.innerProperties + = SessionHostManagementProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSessionHostManagementInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostManagementInner; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementPatchProperties.java new file mode 100644 index 000000000000..4afde8037cac --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementPatchProperties.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent.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 com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationPatchProperties; +import java.io.IOException; + +/** + * Session host Managements of HostPool. + */ +@Fluent +public final class SessionHostManagementPatchProperties + implements JsonSerializable { + /* + * Time zone for sessionHostManagement operations as defined in + * https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set if useLocalTime is + * true. + */ + private String scheduledDateTimeZone; + + /* + * Parameters for a hostpool update. + */ + private HostPoolUpdateConfigurationPatchProperties update; + + /** + * Creates an instance of SessionHostManagementPatchProperties class. + */ + public SessionHostManagementPatchProperties() { + } + + /** + * Get the scheduledDateTimeZone property: Time zone for sessionHostManagement operations as defined in + * https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set if useLocalTime is + * true. + * + * @return the scheduledDateTimeZone value. + */ + public String scheduledDateTimeZone() { + return this.scheduledDateTimeZone; + } + + /** + * Set the scheduledDateTimeZone property: Time zone for sessionHostManagement operations as defined in + * https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set if useLocalTime is + * true. + * + * @param scheduledDateTimeZone the scheduledDateTimeZone value to set. + * @return the SessionHostManagementPatchProperties object itself. + */ + public SessionHostManagementPatchProperties withScheduledDateTimeZone(String scheduledDateTimeZone) { + this.scheduledDateTimeZone = scheduledDateTimeZone; + return this; + } + + /** + * Get the update property: Parameters for a hostpool update. + * + * @return the update value. + */ + public HostPoolUpdateConfigurationPatchProperties update() { + return this.update; + } + + /** + * Set the update property: Parameters for a hostpool update. + * + * @param update the update value to set. + * @return the SessionHostManagementPatchProperties object itself. + */ + public SessionHostManagementPatchProperties withUpdate(HostPoolUpdateConfigurationPatchProperties update) { + this.update = update; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (update() != null) { + update().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scheduledDateTimeZone", this.scheduledDateTimeZone); + jsonWriter.writeJsonField("update", this.update); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostManagementPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostManagementPatchProperties 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 SessionHostManagementPatchProperties. + */ + public static SessionHostManagementPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostManagementPatchProperties deserializedSessionHostManagementPatchProperties + = new SessionHostManagementPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scheduledDateTimeZone".equals(fieldName)) { + deserializedSessionHostManagementPatchProperties.scheduledDateTimeZone = reader.getString(); + } else if ("update".equals(fieldName)) { + deserializedSessionHostManagementPatchProperties.update + = HostPoolUpdateConfigurationPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostManagementPatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementProperties.java new file mode 100644 index 000000000000..49d2a9e9f81a --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementProperties.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationProperties; +import java.io.IOException; + +/** + * Session host Managements of HostPool. + */ +@Fluent +public final class SessionHostManagementProperties implements JsonSerializable { + /* + * Time zone for sessionHostManagement operations as defined in + * https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set if useLocalTime is + * true. + */ + private String scheduledDateTimeZone; + + /* + * Parameters for a hostpool update. + */ + private HostPoolUpdateConfigurationProperties update; + + /** + * Creates an instance of SessionHostManagementProperties class. + */ + public SessionHostManagementProperties() { + } + + /** + * Get the scheduledDateTimeZone property: Time zone for sessionHostManagement operations as defined in + * https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set if useLocalTime is + * true. + * + * @return the scheduledDateTimeZone value. + */ + public String scheduledDateTimeZone() { + return this.scheduledDateTimeZone; + } + + /** + * Set the scheduledDateTimeZone property: Time zone for sessionHostManagement operations as defined in + * https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set if useLocalTime is + * true. + * + * @param scheduledDateTimeZone the scheduledDateTimeZone value to set. + * @return the SessionHostManagementProperties object itself. + */ + public SessionHostManagementProperties withScheduledDateTimeZone(String scheduledDateTimeZone) { + this.scheduledDateTimeZone = scheduledDateTimeZone; + return this; + } + + /** + * Get the update property: Parameters for a hostpool update. + * + * @return the update value. + */ + public HostPoolUpdateConfigurationProperties update() { + return this.update; + } + + /** + * Set the update property: Parameters for a hostpool update. + * + * @param update the update value to set. + * @return the SessionHostManagementProperties object itself. + */ + public SessionHostManagementProperties withUpdate(HostPoolUpdateConfigurationProperties update) { + this.update = update; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scheduledDateTimeZone() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property scheduledDateTimeZone in model SessionHostManagementProperties")); + } + if (update() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property update in model SessionHostManagementProperties")); + } else { + update().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SessionHostManagementProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scheduledDateTimeZone", this.scheduledDateTimeZone); + jsonWriter.writeJsonField("update", this.update); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostManagementProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostManagementProperties 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 SessionHostManagementProperties. + */ + public static SessionHostManagementProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostManagementProperties deserializedSessionHostManagementProperties + = new SessionHostManagementProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scheduledDateTimeZone".equals(fieldName)) { + deserializedSessionHostManagementProperties.scheduledDateTimeZone = reader.getString(); + } else if ("update".equals(fieldName)) { + deserializedSessionHostManagementProperties.update + = HostPoolUpdateConfigurationProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostManagementProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementUpdateStatusInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementUpdateStatusInner.java new file mode 100644 index 000000000000..1422f346eb9b --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementUpdateStatusInner.java @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementOperationProgress; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The current status of the session host update async operation. + */ +@Fluent +public final class SessionHostManagementUpdateStatusInner + implements JsonSerializable { + /* + * Fully qualified ID for the async operation. + */ + private String id; + + /* + * Name of the async operation. + */ + private String name; + + /* + * Operation status. Current defined values are < Error | Scheduled | UpdatingSessionHosts | + * ValidatingSessionHostUpdate | Paused | Pausing | Cancelling > | Succeeded | Failed | Canceled + */ + private String status; + + /* + * Percent of the operation that is complete. + */ + private Float percentComplete; + + /* + * The start time of the operation. + */ + private OffsetDateTime startTime; + + /* + * The end time of the operation. + */ + private OffsetDateTime endTime; + + /* + * If present, details of the operation error. + */ + private ManagementError error; + + /* + * The custom properties of the SessionHost Update Status. + */ + private SessionHostManagementUpdateStatusPropertiesInner innerProperties; + + /** + * Creates an instance of SessionHostManagementUpdateStatusInner class. + */ + public SessionHostManagementUpdateStatusInner() { + } + + /** + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified ID for the async operation. + * + * @param id the id value to set. + * @return the SessionHostManagementUpdateStatusInner object itself. + */ + public SessionHostManagementUpdateStatusInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Name of the async operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the async operation. + * + * @param name the name value to set. + * @return the SessionHostManagementUpdateStatusInner object itself. + */ + public SessionHostManagementUpdateStatusInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: Operation status. Current defined values are < Error | Scheduled | + * UpdatingSessionHosts | ValidatingSessionHostUpdate | Paused | Pausing | Cancelling > | Succeeded | Failed | + * Canceled. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Operation status. Current defined values are < Error | Scheduled | + * UpdatingSessionHosts | ValidatingSessionHostUpdate | Paused | Pausing | Cancelling > | Succeeded | Failed | + * Canceled. + * + * @param status the status value to set. + * @return the SessionHostManagementUpdateStatusInner object itself. + */ + public SessionHostManagementUpdateStatusInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + public Float percentComplete() { + return this.percentComplete; + } + + /** + * Set the percentComplete property: Percent of the operation that is complete. + * + * @param percentComplete the percentComplete value to set. + * @return the SessionHostManagementUpdateStatusInner object itself. + */ + public SessionHostManagementUpdateStatusInner withPercentComplete(Float percentComplete) { + this.percentComplete = percentComplete; + return this; + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time of the operation. + * + * @param startTime the startTime value to set. + * @return the SessionHostManagementUpdateStatusInner object itself. + */ + public SessionHostManagementUpdateStatusInner withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time of the operation. + * + * @param endTime the endTime value to set. + * @return the SessionHostManagementUpdateStatusInner object itself. + */ + public SessionHostManagementUpdateStatusInner withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the error property: If present, details of the operation error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Set the error property: If present, details of the operation error. + * + * @param error the error value to set. + * @return the SessionHostManagementUpdateStatusInner object itself. + */ + public SessionHostManagementUpdateStatusInner withError(ManagementError error) { + this.error = error; + return this; + } + + /** + * Get the innerProperties property: The custom properties of the SessionHost Update Status. + * + * @return the innerProperties value. + */ + private SessionHostManagementUpdateStatusPropertiesInner innerProperties() { + return this.innerProperties; + } + + /** + * Get the correlationId property: The Log Analytics. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.innerProperties() == null ? null : this.innerProperties().correlationId(); + } + + /** + * Set the correlationId property: The Log Analytics. + * + * @param correlationId the correlationId value to set. + * @return the SessionHostManagementUpdateStatusInner object itself. + */ + public SessionHostManagementUpdateStatusInner withCorrelationId(String correlationId) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostManagementUpdateStatusPropertiesInner(); + } + this.innerProperties().withCorrelationId(correlationId); + return this; + } + + /** + * Get the progress property: Progress information on the sessionHostManagement operation. + * + * @return the progress value. + */ + public SessionHostManagementOperationProgress progress() { + return this.innerProperties() == null ? null : this.innerProperties().progress(); + } + + /** + * Set the progress property: Progress information on the sessionHostManagement operation. + * + * @param progress the progress value to set. + * @return the SessionHostManagementUpdateStatusInner object itself. + */ + public SessionHostManagementUpdateStatusInner withProgress(SessionHostManagementOperationProgress progress) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostManagementUpdateStatusPropertiesInner(); + } + this.innerProperties().withProgress(progress); + return this; + } + + /** + * Get the scheduledDateTime property: The timestamp that the update is scheduled for. + * + * @return the scheduledDateTime value. + */ + public OffsetDateTime scheduledDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().scheduledDateTime(); + } + + /** + * Set the scheduledDateTime property: The timestamp that the update is scheduled for. + * + * @param scheduledDateTime the scheduledDateTime value to set. + * @return the SessionHostManagementUpdateStatusInner object itself. + */ + public SessionHostManagementUpdateStatusInner withScheduledDateTime(OffsetDateTime scheduledDateTime) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostManagementUpdateStatusPropertiesInner(); + } + this.innerProperties().withScheduledDateTime(scheduledDateTime); + return this; + } + + /** + * Get the sessionHostManagement property: SessionHostManagement properties used for the operation. + * + * @return the sessionHostManagement value. + */ + public SessionHostManagementInner sessionHostManagement() { + return this.innerProperties() == null ? null : this.innerProperties().sessionHostManagement(); + } + + /** + * Set the sessionHostManagement property: SessionHostManagement properties used for the operation. + * + * @param sessionHostManagement the sessionHostManagement value to set. + * @return the SessionHostManagementUpdateStatusInner object itself. + */ + public SessionHostManagementUpdateStatusInner + withSessionHostManagement(SessionHostManagementInner sessionHostManagement) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostManagementUpdateStatusPropertiesInner(); + } + this.innerProperties().withSessionHostManagement(sessionHostManagement); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property status in model SessionHostManagementUpdateStatusInner")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SessionHostManagementUpdateStatusInner.class); + + /** + * {@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.writeJsonField("error", this.error); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostManagementUpdateStatusInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostManagementUpdateStatusInner 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 SessionHostManagementUpdateStatusInner. + */ + public static SessionHostManagementUpdateStatusInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostManagementUpdateStatusInner deserializedSessionHostManagementUpdateStatusInner + = new SessionHostManagementUpdateStatusInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedSessionHostManagementUpdateStatusInner.status = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedSessionHostManagementUpdateStatusInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSessionHostManagementUpdateStatusInner.name = reader.getString(); + } else if ("percentComplete".equals(fieldName)) { + deserializedSessionHostManagementUpdateStatusInner.percentComplete + = reader.getNullable(JsonReader::getFloat); + } else if ("startTime".equals(fieldName)) { + deserializedSessionHostManagementUpdateStatusInner.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedSessionHostManagementUpdateStatusInner.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("error".equals(fieldName)) { + deserializedSessionHostManagementUpdateStatusInner.error = ManagementError.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedSessionHostManagementUpdateStatusInner.innerProperties + = SessionHostManagementUpdateStatusPropertiesInner.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostManagementUpdateStatusInner; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementUpdateStatusPropertiesInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementUpdateStatusPropertiesInner.java new file mode 100644 index 000000000000..34688e30a455 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementUpdateStatusPropertiesInner.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementOperationProgress; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Properties bag to hold custom RP properties for sessionHostManagement Update Statuses. + */ +@Fluent +public final class SessionHostManagementUpdateStatusPropertiesInner + implements JsonSerializable { + /* + * The Log Analytics. + */ + private String correlationId; + + /* + * Progress information on the sessionHostManagement operation. + */ + private SessionHostManagementOperationProgress progress; + + /* + * The timestamp that the update is scheduled for. + */ + private OffsetDateTime scheduledDateTime; + + /* + * SessionHostManagement properties used for the operation. + */ + private SessionHostManagementInner sessionHostManagement; + + /** + * Creates an instance of SessionHostManagementUpdateStatusPropertiesInner class. + */ + public SessionHostManagementUpdateStatusPropertiesInner() { + } + + /** + * Get the correlationId property: The Log Analytics. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set the correlationId property: The Log Analytics. + * + * @param correlationId the correlationId value to set. + * @return the SessionHostManagementUpdateStatusPropertiesInner object itself. + */ + public SessionHostManagementUpdateStatusPropertiesInner withCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * Get the progress property: Progress information on the sessionHostManagement operation. + * + * @return the progress value. + */ + public SessionHostManagementOperationProgress progress() { + return this.progress; + } + + /** + * Set the progress property: Progress information on the sessionHostManagement operation. + * + * @param progress the progress value to set. + * @return the SessionHostManagementUpdateStatusPropertiesInner object itself. + */ + public SessionHostManagementUpdateStatusPropertiesInner + withProgress(SessionHostManagementOperationProgress progress) { + this.progress = progress; + return this; + } + + /** + * Get the scheduledDateTime property: The timestamp that the update is scheduled for. + * + * @return the scheduledDateTime value. + */ + public OffsetDateTime scheduledDateTime() { + return this.scheduledDateTime; + } + + /** + * Set the scheduledDateTime property: The timestamp that the update is scheduled for. + * + * @param scheduledDateTime the scheduledDateTime value to set. + * @return the SessionHostManagementUpdateStatusPropertiesInner object itself. + */ + public SessionHostManagementUpdateStatusPropertiesInner withScheduledDateTime(OffsetDateTime scheduledDateTime) { + this.scheduledDateTime = scheduledDateTime; + return this; + } + + /** + * Get the sessionHostManagement property: SessionHostManagement properties used for the operation. + * + * @return the sessionHostManagement value. + */ + public SessionHostManagementInner sessionHostManagement() { + return this.sessionHostManagement; + } + + /** + * Set the sessionHostManagement property: SessionHostManagement properties used for the operation. + * + * @param sessionHostManagement the sessionHostManagement value to set. + * @return the SessionHostManagementUpdateStatusPropertiesInner object itself. + */ + public SessionHostManagementUpdateStatusPropertiesInner + withSessionHostManagement(SessionHostManagementInner sessionHostManagement) { + this.sessionHostManagement = sessionHostManagement; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (progress() != null) { + progress().validate(); + } + if (sessionHostManagement() != null) { + sessionHostManagement().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("correlationId", this.correlationId); + jsonWriter.writeJsonField("progress", this.progress); + jsonWriter.writeStringField("scheduledDateTime", + this.scheduledDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.scheduledDateTime)); + jsonWriter.writeJsonField("sessionHostManagement", this.sessionHostManagement); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostManagementUpdateStatusPropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostManagementUpdateStatusPropertiesInner 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 SessionHostManagementUpdateStatusPropertiesInner. + */ + public static SessionHostManagementUpdateStatusPropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostManagementUpdateStatusPropertiesInner deserializedSessionHostManagementUpdateStatusPropertiesInner + = new SessionHostManagementUpdateStatusPropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("correlationId".equals(fieldName)) { + deserializedSessionHostManagementUpdateStatusPropertiesInner.correlationId = reader.getString(); + } else if ("progress".equals(fieldName)) { + deserializedSessionHostManagementUpdateStatusPropertiesInner.progress + = SessionHostManagementOperationProgress.fromJson(reader); + } else if ("scheduledDateTime".equals(fieldName)) { + deserializedSessionHostManagementUpdateStatusPropertiesInner.scheduledDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("sessionHostManagement".equals(fieldName)) { + deserializedSessionHostManagementUpdateStatusPropertiesInner.sessionHostManagement + = SessionHostManagementInner.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostManagementUpdateStatusPropertiesInner; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostProperties.java index fae62d39ef12..3487d8ca4b8f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostProperties.java @@ -23,6 +23,21 @@ */ @Fluent public final class SessionHostProperties implements JsonSerializable { + /* + * Number of active sessions on SessionHost. + */ + private Integer activeSessions; + + /* + * Number of disconnected sessions on SessionHost. + */ + private Integer disconnectedSessions; + + /* + * Number of pending sessions on SessionHost. + */ + private Integer pendingSessions; + /* * ObjectId of SessionHost. (internal use) */ @@ -103,6 +118,17 @@ public final class SessionHostProperties implements JsonSerializable CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("updateErrorMessage".equals(fieldName)) { deserializedSessionHostProperties.updateErrorMessage = reader.getString(); + } else if ("lastSessionHostUpdateTime".equals(fieldName)) { + deserializedSessionHostProperties.lastSessionHostUpdateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("sessionHostConfiguration".equals(fieldName)) { + deserializedSessionHostProperties.sessionHostConfiguration = reader.getString(); } else if ("sessionHostHealthCheckResults".equals(fieldName)) { List sessionHostHealthCheckResults = reader.readArray(reader1 -> SessionHostHealthCheckReport.fromJson(reader1)); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspaceInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspaceInner.java index 39d06526f2b4..8b395ffa0389 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspaceInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspaceInner.java @@ -9,12 +9,12 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedServiceIdentity; +import com.azure.resourcemanager.desktopvirtualization.models.Plan; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; import com.azure.resourcemanager.desktopvirtualization.models.PublicNetworkAccess; import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySet; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku; +import com.azure.resourcemanager.desktopvirtualization.models.Sku; import java.io.IOException; import java.util.List; import java.util.Map; @@ -147,7 +147,7 @@ public WorkspaceInner withKind(String kind) { * {@inheritDoc} */ @Override - public WorkspaceInner withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { + public WorkspaceInner withIdentity(ManagedServiceIdentity identity) { super.withIdentity(identity); return this; } @@ -156,7 +156,7 @@ public WorkspaceInner withIdentity(ResourceModelWithAllowedPropertySetIdentity i * {@inheritDoc} */ @Override - public WorkspaceInner withSku(ResourceModelWithAllowedPropertySetSku sku) { + public WorkspaceInner withSku(Sku sku) { super.withSku(sku); return this; } @@ -165,7 +165,7 @@ public WorkspaceInner withSku(ResourceModelWithAllowedPropertySetSku sku) { * {@inheritDoc} */ @Override - public WorkspaceInner withPlan(ResourceModelWithAllowedPropertySetPlan plan) { + public WorkspaceInner withPlan(Plan plan) { super.withPlan(plan); return this; } @@ -382,12 +382,11 @@ public static WorkspaceInner fromJson(JsonReader jsonReader) throws IOException } else if ("etag".equals(fieldName)) { deserializedWorkspaceInner.etag = reader.getString(); } else if ("identity".equals(fieldName)) { - deserializedWorkspaceInner - .withIdentity(ResourceModelWithAllowedPropertySetIdentity.fromJson(reader)); + deserializedWorkspaceInner.withIdentity(ManagedServiceIdentity.fromJson(reader)); } else if ("sku".equals(fieldName)) { - deserializedWorkspaceInner.withSku(ResourceModelWithAllowedPropertySetSku.fromJson(reader)); + deserializedWorkspaceInner.withSku(Sku.fromJson(reader)); } else if ("plan".equals(fieldName)) { - deserializedWorkspaceInner.withPlan(ResourceModelWithAllowedPropertySetPlan.fromJson(reader)); + deserializedWorkspaceInner.withPlan(Plan.fromJson(reader)); } else if ("systemData".equals(fieldName)) { deserializedWorkspaceInner.systemData = SystemData.fromJson(reader); } else if ("properties".equals(fieldName)) { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ActiveSessionHostConfigurationImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ActiveSessionHostConfigurationImpl.java new file mode 100644 index 000000000000..73a202511965 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ActiveSessionHostConfigurationImpl.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.ActiveSessionHostConfigurationInner; +import com.azure.resourcemanager.desktopvirtualization.models.ActiveSessionHostConfiguration; +import com.azure.resourcemanager.desktopvirtualization.models.BootDiagnosticsInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DiskInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DomainInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ImageInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.KeyVaultCredentialsProperties; +import com.azure.resourcemanager.desktopvirtualization.models.NetworkInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SecurityInfoProperties; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ActiveSessionHostConfigurationImpl implements ActiveSessionHostConfiguration { + private ActiveSessionHostConfigurationInner innerObject; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + ActiveSessionHostConfigurationImpl(ActiveSessionHostConfigurationInner innerObject, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public OffsetDateTime version() { + return this.innerModel().version(); + } + + public String friendlyName() { + return this.innerModel().friendlyName(); + } + + public Map vmTags() { + Map inner = this.innerModel().vmTags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String vmLocation() { + return this.innerModel().vmLocation(); + } + + public String vmResourceGroup() { + return this.innerModel().vmResourceGroup(); + } + + public String vmNamePrefix() { + return this.innerModel().vmNamePrefix(); + } + + public List availabilityZones() { + List inner = this.innerModel().availabilityZones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public NetworkInfoProperties networkInfo() { + return this.innerModel().networkInfo(); + } + + public String vmSizeId() { + return this.innerModel().vmSizeId(); + } + + public DiskInfoProperties diskInfo() { + return this.innerModel().diskInfo(); + } + + public String customConfigurationScriptUrl() { + return this.innerModel().customConfigurationScriptUrl(); + } + + public ImageInfoProperties imageInfo() { + return this.innerModel().imageInfo(); + } + + public DomainInfoProperties domainInfo() { + return this.innerModel().domainInfo(); + } + + public SecurityInfoProperties securityInfo() { + return this.innerModel().securityInfo(); + } + + public KeyVaultCredentialsProperties vmAdminCredentials() { + return this.innerModel().vmAdminCredentials(); + } + + public BootDiagnosticsInfoProperties bootDiagnosticsInfo() { + return this.innerModel().bootDiagnosticsInfo(); + } + + public ActiveSessionHostConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ActiveSessionHostConfigurationsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ActiveSessionHostConfigurationsClientImpl.java new file mode 100644 index 000000000000..446afae3cb53 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ActiveSessionHostConfigurationsClientImpl.java @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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.desktopvirtualization.fluent.ActiveSessionHostConfigurationsClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.ActiveSessionHostConfigurationInner; +import com.azure.resourcemanager.desktopvirtualization.models.ActiveSessionHostConfigurationList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ActiveSessionHostConfigurationsClient. + */ +public final class ActiveSessionHostConfigurationsClientImpl implements ActiveSessionHostConfigurationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ActiveSessionHostConfigurationsService service; + + /** + * The service client containing this operation class. + */ + private final DesktopVirtualizationApiClientImpl client; + + /** + * Initializes an instance of ActiveSessionHostConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ActiveSessionHostConfigurationsClientImpl(DesktopVirtualizationApiClientImpl client) { + this.service = RestProxy.create(ActiveSessionHostConfigurationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DesktopVirtualizationApiClientActiveSessionHostConfigurations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DesktopVirtualizatio") + public interface ActiveSessionHostConfigurationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/activeSessionHostConfigurations/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/activeSessionHostConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByHostPool(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByHostPoolNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, + String hostPoolName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String hostPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, accept, context); + } + + /** + * Get the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String hostPoolName) { + return getWithResponseAsync(resourceGroupName, hostPoolName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context) { + return getWithResponseAsync(resourceGroupName, hostPoolName, context).block(); + } + + /** + * Get the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ActiveSessionHostConfigurationInner get(String resourceGroupName, String hostPoolName) { + return getWithResponse(resourceGroupName, hostPoolName, Context.NONE).getValue(); + } + + /** + * List activeSessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return activeSessionHostConfigurationList along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByHostPoolSinglePageAsync(String resourceGroupName, String hostPoolName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, 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 activeSessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return activeSessionHostConfigurationList along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByHostPoolSinglePageAsync(String resourceGroupName, String hostPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List activeSessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return activeSessionHostConfigurationList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByHostPoolAsync(String resourceGroupName, + String hostPoolName) { + return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName), + nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); + } + + /** + * List activeSessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return activeSessionHostConfigurationList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByHostPoolAsync(String resourceGroupName, + String hostPoolName, Context context) { + return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, context), + nextLink -> listByHostPoolNextSinglePageAsync(nextLink, context)); + } + + /** + * List activeSessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return activeSessionHostConfigurationList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostPool(String resourceGroupName, + String hostPoolName) { + return new PagedIterable<>(listByHostPoolAsync(resourceGroupName, hostPoolName)); + } + + /** + * List activeSessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return activeSessionHostConfigurationList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostPool(String resourceGroupName, + String hostPoolName, Context context) { + return new PagedIterable<>(listByHostPoolAsync(resourceGroupName, hostPoolName, 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 activeSessionHostConfigurationList along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByHostPoolNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByHostPoolNext(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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return activeSessionHostConfigurationList along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByHostPoolNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ActiveSessionHostConfigurationsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ActiveSessionHostConfigurationsImpl.java new file mode 100644 index 000000000000..47fd38619f5e --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ActiveSessionHostConfigurationsImpl.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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.desktopvirtualization.fluent.ActiveSessionHostConfigurationsClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.ActiveSessionHostConfigurationInner; +import com.azure.resourcemanager.desktopvirtualization.models.ActiveSessionHostConfiguration; +import com.azure.resourcemanager.desktopvirtualization.models.ActiveSessionHostConfigurations; + +public final class ActiveSessionHostConfigurationsImpl implements ActiveSessionHostConfigurations { + private static final ClientLogger LOGGER = new ClientLogger(ActiveSessionHostConfigurationsImpl.class); + + private final ActiveSessionHostConfigurationsClient innerClient; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + public ActiveSessionHostConfigurationsImpl(ActiveSessionHostConfigurationsClient innerClient, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, hostPoolName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ActiveSessionHostConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ActiveSessionHostConfiguration get(String resourceGroupName, String hostPoolName) { + ActiveSessionHostConfigurationInner inner = this.serviceClient().get(resourceGroupName, hostPoolName); + if (inner != null) { + return new ActiveSessionHostConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { + PagedIterable inner + = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ActiveSessionHostConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Context context) { + PagedIterable inner + = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ActiveSessionHostConfigurationImpl(inner1, this.manager())); + } + + private ActiveSessionHostConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageImpl.java index 1cc118040ec9..78fea952ad23 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageImpl.java @@ -169,12 +169,21 @@ public AppAttachPackageImpl withProperties(AppAttachPackageProperties properties } public AppAttachPackageImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateAppAttachPackagePatch.withTags(tags); + return this; + } } public AppAttachPackageImpl withProperties(AppAttachPackagePatchProperties properties) { this.updateAppAttachPackagePatch.withProperties(properties); return this; } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackagesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackagesClientImpl.java index ddd69e1dc1d9..a1162d3a906d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackagesClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackagesClientImpl.java @@ -95,8 +95,8 @@ Mono> createOrUpdate(@HostParam("$host") String Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("appAttachPackageName") String appAttachPackageName, @HeaderParam("Accept") String accept, - Context context); + @PathParam("appAttachPackageName") String appAttachPackageName, @QueryParam("force") Boolean force, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}") @@ -147,7 +147,7 @@ Mono> listBySubscriptionNext( * Get an app attach package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -183,7 +183,7 @@ public Mono> getByResourceGroupWithResponseAsync * Get an app attach package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -219,7 +219,7 @@ private Mono> getByResourceGroupWithResponseAsyn * Get an app attach package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -235,7 +235,7 @@ public Mono getByResourceGroupAsync(String resourceGroupN * Get an app attach package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -252,7 +252,7 @@ public Response getByResourceGroupWithResponse(String res * Get an app attach package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -267,7 +267,7 @@ public AppAttachPackageInner getByResourceGroup(String resourceGroupName, String * Create or update an App Attach package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @param appAttachPackage Object containing App Attach Package definitions. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -312,7 +312,7 @@ public Mono> createOrUpdateWithResponseAsync(Str * Create or update an App Attach package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @param appAttachPackage Object containing App Attach Package definitions. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -357,7 +357,7 @@ private Mono> createOrUpdateWithResponseAsync(St * Create or update an App Attach package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @param appAttachPackage Object containing App Attach Package definitions. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -375,7 +375,7 @@ public Mono createOrUpdateAsync(String resourceGroupName, * Create or update an App Attach package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @param appAttachPackage Object containing App Attach Package definitions. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -394,7 +394,7 @@ public Response createOrUpdateWithResponse(String resourc * Create or update an App Attach package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @param appAttachPackage Object containing App Attach Package definitions. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -412,14 +412,16 @@ public AppAttachPackageInner createOrUpdate(String resourceGroupName, String app * Remove an App Attach Package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. + * @param force Force flag to delete App Attach package. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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) - public Mono> deleteWithResponseAsync(String resourceGroupName, String appAttachPackageName) { + public Mono> deleteWithResponseAsync(String resourceGroupName, String appAttachPackageName, + Boolean force) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -439,7 +441,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, force, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -447,7 +449,8 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St * Remove an App Attach Package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. + * @param force Force flag to delete App Attach package. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -456,7 +459,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String appAttachPackageName, - Context context) { + Boolean force, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -476,14 +479,14 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, appAttachPackageName, accept, context); + resourceGroupName, appAttachPackageName, force, accept, context); } /** * Remove an App Attach Package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -491,14 +494,16 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String appAttachPackageName) { - return deleteWithResponseAsync(resourceGroupName, appAttachPackageName).flatMap(ignored -> Mono.empty()); + final Boolean force = null; + return deleteWithResponseAsync(resourceGroupName, appAttachPackageName, force).flatMap(ignored -> Mono.empty()); } /** * Remove an App Attach Package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. + * @param force Force flag to delete App Attach package. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -506,29 +511,31 @@ public Mono deleteAsync(String resourceGroupName, String appAttachPackageN * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String appAttachPackageName, Context context) { - return deleteWithResponseAsync(resourceGroupName, appAttachPackageName, context).block(); + public Response deleteWithResponse(String resourceGroupName, String appAttachPackageName, Boolean force, + Context context) { + return deleteWithResponseAsync(resourceGroupName, appAttachPackageName, force, context).block(); } /** * Remove an App Attach Package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String appAttachPackageName) { - deleteWithResponse(resourceGroupName, appAttachPackageName, Context.NONE); + final Boolean force = null; + deleteWithResponse(resourceGroupName, appAttachPackageName, force, Context.NONE); } /** * Update an App Attach Package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @param appAttachPackagePatch Object containing App Attach Package definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -570,7 +577,7 @@ public Mono> updateWithResponseAsync(String reso * Update an App Attach Package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @param appAttachPackagePatch Object containing App Attach Package definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -611,7 +618,7 @@ private Mono> updateWithResponseAsync(String res * Update an App Attach Package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -628,7 +635,7 @@ public Mono updateAsync(String resourceGroupName, String * Update an App Attach Package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @param appAttachPackagePatch Object containing App Attach Package definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -646,7 +653,7 @@ public Response updateWithResponse(String resourceGroupNa * Update an App Attach Package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -663,7 +670,8 @@ public AppAttachPackageInner update(String resourceGroupName, String appAttachPa * List App Attach packages in resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter expression. Valid properties for filtering are package name and host pool. + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, package owner + * name, and custom data. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -697,7 +705,8 @@ private Mono> listByResourceGroupSinglePage * List App Attach packages in resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter expression. Valid properties for filtering are package name and host pool. + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, package owner + * name, and custom data. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -732,7 +741,8 @@ private Mono> listByResourceGroupSinglePage * List App Attach packages in resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter expression. Valid properties for filtering are package name and host pool. + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, package owner + * name, and custom data. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -764,7 +774,8 @@ public PagedFlux listByResourceGroupAsync(String resource * List App Attach packages in resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter expression. Valid properties for filtering are package name and host pool. + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, package owner + * name, and custom data. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -797,7 +808,8 @@ public PagedIterable listByResourceGroup(String resourceG * List App Attach packages in resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter expression. Valid properties for filtering are package name and host pool. + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, package owner + * name, and custom data. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -813,8 +825,8 @@ public PagedIterable listByResourceGroup(String resourceG /** * List App Attach packages in subscription. * - * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and resource - * group. + * @param filter OData filter expression. Valid properties for filtering are package name, resource group, host + * pool, package owner name, and custom data. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -842,8 +854,8 @@ private Mono> listSinglePageAsync(String fi /** * List App Attach packages in subscription. * - * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and resource - * group. + * @param filter OData filter expression. Valid properties for filtering are package name, resource group, host + * pool, package owner name, and custom data. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -872,8 +884,8 @@ private Mono> listSinglePageAsync(String fi /** * List App Attach packages in subscription. * - * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and resource - * group. + * @param filter OData filter expression. Valid properties for filtering are package name, resource group, host + * pool, package owner name, and custom data. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -902,8 +914,8 @@ public PagedFlux listAsync() { /** * List App Attach packages in subscription. * - * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and resource - * group. + * @param filter OData filter expression. Valid properties for filtering are package name, resource group, host + * pool, package owner name, and custom data. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -932,8 +944,8 @@ public PagedIterable list() { /** * List App Attach packages in subscription. * - * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and resource - * group. + * @param filter OData filter expression. Valid properties for filtering are package name, resource group, host + * pool, package owner name, and custom data. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackagesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackagesImpl.java index 42bd35b4e26e..6fc57032949d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackagesImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackagesImpl.java @@ -48,12 +48,12 @@ public AppAttachPackage getByResourceGroup(String resourceGroupName, String appA } } - public Response deleteByResourceGroupWithResponse(String resourceGroupName, String appAttachPackageName, + public Response deleteWithResponse(String resourceGroupName, String appAttachPackageName, Boolean force, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, appAttachPackageName, context); + return this.serviceClient().deleteWithResponse(resourceGroupName, appAttachPackageName, force, context); } - public void deleteByResourceGroup(String resourceGroupName, String appAttachPackageName) { + public void delete(String resourceGroupName, String appAttachPackageName) { this.serviceClient().delete(resourceGroupName, appAttachPackageName); } @@ -118,10 +118,11 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'appAttachPackages'.", id))); } - this.deleteByResourceGroupWithResponse(resourceGroupName, appAttachPackageName, Context.NONE); + Boolean localForce = null; + this.deleteWithResponse(resourceGroupName, appAttachPackageName, localForce, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { + public Response deleteByIdWithResponse(String id, Boolean force, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -132,7 +133,7 @@ public Response deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'appAttachPackages'.", id))); } - return this.deleteByResourceGroupWithResponse(resourceGroupName, appAttachPackageName, context); + return this.deleteWithResponse(resourceGroupName, appAttachPackageName, force, context); } private AppAttachPackagesClient serviceClient() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupImpl.java index cc8e13059c96..5fddcb5c767e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupImpl.java @@ -11,9 +11,9 @@ import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroup; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupPatch; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupType; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedServiceIdentity; +import com.azure.resourcemanager.desktopvirtualization.models.Plan; +import com.azure.resourcemanager.desktopvirtualization.models.Sku; import java.util.Collections; import java.util.Map; @@ -60,15 +60,15 @@ public String etag() { return this.innerModel().etag(); } - public ResourceModelWithAllowedPropertySetIdentity identity() { + public ManagedServiceIdentity identity() { return this.innerModel().identity(); } - public ResourceModelWithAllowedPropertySetSku sku() { + public Sku sku() { return this.innerModel().sku(); } - public ResourceModelWithAllowedPropertySetPlan plan() { + public Plan plan() { return this.innerModel().plan(); } @@ -247,17 +247,17 @@ public ApplicationGroupImpl withKind(String kind) { return this; } - public ApplicationGroupImpl withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { + public ApplicationGroupImpl withIdentity(ManagedServiceIdentity identity) { this.innerModel().withIdentity(identity); return this; } - public ApplicationGroupImpl withSku(ResourceModelWithAllowedPropertySetSku sku) { + public ApplicationGroupImpl withSku(Sku sku) { this.innerModel().withSku(sku); return this; } - public ApplicationGroupImpl withPlan(ResourceModelWithAllowedPropertySetPlan plan) { + public ApplicationGroupImpl withPlan(Plan plan) { this.innerModel().withPlan(plan); return this; } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ControlSessionHostUpdatesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ControlSessionHostUpdatesClientImpl.java new file mode 100644 index 000000000000..ca77646a8cd8 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ControlSessionHostUpdatesClientImpl.java @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.desktopvirtualization.fluent.ControlSessionHostUpdatesClient; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateControlParameter; +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 ControlSessionHostUpdatesClient. + */ +public final class ControlSessionHostUpdatesClientImpl implements ControlSessionHostUpdatesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ControlSessionHostUpdatesService service; + + /** + * The service client containing this operation class. + */ + private final DesktopVirtualizationApiClientImpl client; + + /** + * Initializes an instance of ControlSessionHostUpdatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ControlSessionHostUpdatesClientImpl(DesktopVirtualizationApiClientImpl client) { + this.service = RestProxy.create(ControlSessionHostUpdatesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DesktopVirtualizationApiClientControlSessionHostUpdates to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DesktopVirtualizatio") + public interface ControlSessionHostUpdatesService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/controlSessionHostUpdate") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> post(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @BodyParam("application/json") HostPoolUpdateControlParameter hostPoolUpdateControlParameter, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Control update of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolUpdateControlParameter Object containing control action for hostpool update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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) + public Mono>> postWithResponseAsync(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + if (hostPoolUpdateControlParameter == null) { + return Mono.error(new IllegalArgumentException( + "Parameter hostPoolUpdateControlParameter is required and cannot be null.")); + } else { + hostPoolUpdateControlParameter.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.post(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, hostPoolUpdateControlParameter, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Control update of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolUpdateControlParameter Object containing control action for hostpool update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> postWithResponseAsync(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + if (hostPoolUpdateControlParameter == null) { + return Mono.error(new IllegalArgumentException( + "Parameter hostPoolUpdateControlParameter is required and cannot be null.")); + } else { + hostPoolUpdateControlParameter.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.post(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, hostPoolUpdateControlParameter, accept, context); + } + + /** + * Control update of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolUpdateControlParameter Object containing control action for hostpool update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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) + public PollerFlux, Void> beginPostAsync(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter) { + Mono>> mono + = postWithResponseAsync(resourceGroupName, hostPoolName, hostPoolUpdateControlParameter); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Control update of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolUpdateControlParameter Object containing control action for hostpool update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginPostAsync(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = postWithResponseAsync(resourceGroupName, hostPoolName, hostPoolUpdateControlParameter, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Control update of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolUpdateControlParameter Object containing control action for hostpool update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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> beginPost(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter) { + return this.beginPostAsync(resourceGroupName, hostPoolName, hostPoolUpdateControlParameter).getSyncPoller(); + } + + /** + * Control update of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolUpdateControlParameter Object containing control action for hostpool update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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> beginPost(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter, Context context) { + return this.beginPostAsync(resourceGroupName, hostPoolName, hostPoolUpdateControlParameter, context) + .getSyncPoller(); + } + + /** + * Control update of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolUpdateControlParameter Object containing control action for hostpool update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + public Mono postAsync(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter) { + return beginPostAsync(resourceGroupName, hostPoolName, hostPoolUpdateControlParameter).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Control update of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolUpdateControlParameter Object containing control action for hostpool update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 postAsync(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter, Context context) { + return beginPostAsync(resourceGroupName, hostPoolName, hostPoolUpdateControlParameter, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Control update of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolUpdateControlParameter Object containing control action for hostpool update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 post(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter) { + postAsync(resourceGroupName, hostPoolName, hostPoolUpdateControlParameter).block(); + } + + /** + * Control update of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolUpdateControlParameter Object containing control action for hostpool update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 post(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter, Context context) { + postAsync(resourceGroupName, hostPoolName, hostPoolUpdateControlParameter, context).block(); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ControlSessionHostUpdatesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ControlSessionHostUpdatesImpl.java new file mode 100644 index 000000000000..0e8990c76d61 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ControlSessionHostUpdatesImpl.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.desktopvirtualization.fluent.ControlSessionHostUpdatesClient; +import com.azure.resourcemanager.desktopvirtualization.models.ControlSessionHostUpdates; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateControlParameter; + +public final class ControlSessionHostUpdatesImpl implements ControlSessionHostUpdates { + private static final ClientLogger LOGGER = new ClientLogger(ControlSessionHostUpdatesImpl.class); + + private final ControlSessionHostUpdatesClient innerClient; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + public ControlSessionHostUpdatesImpl(ControlSessionHostUpdatesClient innerClient, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void post(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter) { + this.serviceClient().post(resourceGroupName, hostPoolName, hostPoolUpdateControlParameter); + } + + public void post(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter, Context context) { + this.serviceClient().post(resourceGroupName, hostPoolName, hostPoolUpdateControlParameter, context); + } + + private ControlSessionHostUpdatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationApiClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationApiClientImpl.java index fe0d2bd66533..a9c262c3c842 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationApiClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationApiClientImpl.java @@ -13,8 +13,8 @@ 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.PollerFactory; import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -23,13 +23,16 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.desktopvirtualization.fluent.ActiveSessionHostConfigurationsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackageInfoesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient; -import com.azure.resourcemanager.desktopvirtualization.fluent.DesktopsClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.ControlSessionHostUpdatesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.DesktopVirtualizationApiClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.DesktopsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.InitiateSessionHostUpdatesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.MsixImagesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.OperationsClient; @@ -38,6 +41,10 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsUpdateStatusClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostOperationsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.StartMenuItemsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient; @@ -308,6 +315,90 @@ public HostPoolsClient getHostPools() { return this.hostPools; } + /** + * The SessionHostManagementsClient object to access its operations. + */ + private final SessionHostManagementsClient sessionHostManagements; + + /** + * Gets the SessionHostManagementsClient object to access its operations. + * + * @return the SessionHostManagementsClient object. + */ + public SessionHostManagementsClient getSessionHostManagements() { + return this.sessionHostManagements; + } + + /** + * The InitiateSessionHostUpdatesClient object to access its operations. + */ + private final InitiateSessionHostUpdatesClient initiateSessionHostUpdates; + + /** + * Gets the InitiateSessionHostUpdatesClient object to access its operations. + * + * @return the InitiateSessionHostUpdatesClient object. + */ + public InitiateSessionHostUpdatesClient getInitiateSessionHostUpdates() { + return this.initiateSessionHostUpdates; + } + + /** + * The ControlSessionHostUpdatesClient object to access its operations. + */ + private final ControlSessionHostUpdatesClient controlSessionHostUpdates; + + /** + * Gets the ControlSessionHostUpdatesClient object to access its operations. + * + * @return the ControlSessionHostUpdatesClient object. + */ + public ControlSessionHostUpdatesClient getControlSessionHostUpdates() { + return this.controlSessionHostUpdates; + } + + /** + * The SessionHostManagementsUpdateStatusClient object to access its operations. + */ + private final SessionHostManagementsUpdateStatusClient sessionHostManagementsUpdateStatus; + + /** + * Gets the SessionHostManagementsUpdateStatusClient object to access its operations. + * + * @return the SessionHostManagementsUpdateStatusClient object. + */ + public SessionHostManagementsUpdateStatusClient getSessionHostManagementsUpdateStatus() { + return this.sessionHostManagementsUpdateStatus; + } + + /** + * The SessionHostConfigurationsClient object to access its operations. + */ + private final SessionHostConfigurationsClient sessionHostConfigurations; + + /** + * Gets the SessionHostConfigurationsClient object to access its operations. + * + * @return the SessionHostConfigurationsClient object. + */ + public SessionHostConfigurationsClient getSessionHostConfigurations() { + return this.sessionHostConfigurations; + } + + /** + * The ActiveSessionHostConfigurationsClient object to access its operations. + */ + private final ActiveSessionHostConfigurationsClient activeSessionHostConfigurations; + + /** + * Gets the ActiveSessionHostConfigurationsClient object to access its operations. + * + * @return the ActiveSessionHostConfigurationsClient object. + */ + public ActiveSessionHostConfigurationsClient getActiveSessionHostConfigurations() { + return this.activeSessionHostConfigurations; + } + /** * The UserSessionsClient object to access its operations. */ @@ -336,6 +427,20 @@ public SessionHostsClient getSessionHosts() { return this.sessionHosts; } + /** + * The SessionHostOperationsClient object to access its operations. + */ + private final SessionHostOperationsClient sessionHostOperations; + + /** + * Gets the SessionHostOperationsClient object to access its operations. + * + * @return the SessionHostOperationsClient object. + */ + public SessionHostOperationsClient getSessionHostOperations() { + return this.sessionHostOperations; + } + /** * The MsixPackagesClient object to access its operations. */ @@ -409,7 +514,7 @@ public AppAttachPackagesClient getAppAttachPackages() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2024-04-03"; + this.apiVersion = "2024-11-01-preview"; this.operations = new OperationsClientImpl(this); this.workspaces = new WorkspacesClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); @@ -422,8 +527,15 @@ public AppAttachPackagesClient getAppAttachPackages() { this.applications = new ApplicationsClientImpl(this); this.desktops = new DesktopsClientImpl(this); this.hostPools = new HostPoolsClientImpl(this); + this.sessionHostManagements = new SessionHostManagementsClientImpl(this); + this.initiateSessionHostUpdates = new InitiateSessionHostUpdatesClientImpl(this); + this.controlSessionHostUpdates = new ControlSessionHostUpdatesClientImpl(this); + this.sessionHostManagementsUpdateStatus = new SessionHostManagementsUpdateStatusClientImpl(this); + this.sessionHostConfigurations = new SessionHostConfigurationsClientImpl(this); + this.activeSessionHostConfigurations = new ActiveSessionHostConfigurationsClientImpl(this); this.userSessions = new UserSessionsClientImpl(this); this.sessionHosts = new SessionHostsClientImpl(this); + this.sessionHostOperations = new SessionHostOperationsClientImpl(this); this.msixPackages = new MsixPackagesClientImpl(this); this.appAttachPackageInfoes = new AppAttachPackageInfoesClientImpl(this); this.msixImages = new MsixImagesClientImpl(this); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolImpl.java index 798fc1f0ba1e..ad2c03adb958 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolImpl.java @@ -12,20 +12,25 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationInfoInner; import com.azure.resourcemanager.desktopvirtualization.models.AgentUpdatePatchProperties; import com.azure.resourcemanager.desktopvirtualization.models.AgentUpdateProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DirectUdp; import com.azure.resourcemanager.desktopvirtualization.models.HostPool; import com.azure.resourcemanager.desktopvirtualization.models.HostPoolPatch; -import com.azure.resourcemanager.desktopvirtualization.models.HostpoolPublicNetworkAccess; import com.azure.resourcemanager.desktopvirtualization.models.HostPoolType; +import com.azure.resourcemanager.desktopvirtualization.models.HostpoolPublicNetworkAccess; import com.azure.resourcemanager.desktopvirtualization.models.LoadBalancerType; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedPrivateUdp; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedServiceIdentity; +import com.azure.resourcemanager.desktopvirtualization.models.ManagementType; import com.azure.resourcemanager.desktopvirtualization.models.PersonalDesktopAssignmentType; +import com.azure.resourcemanager.desktopvirtualization.models.Plan; import com.azure.resourcemanager.desktopvirtualization.models.PreferredAppGroupType; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; +import com.azure.resourcemanager.desktopvirtualization.models.PublicUdp; import com.azure.resourcemanager.desktopvirtualization.models.RegistrationInfo; import com.azure.resourcemanager.desktopvirtualization.models.RegistrationInfoPatch; import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenList; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku; +import com.azure.resourcemanager.desktopvirtualization.models.RelayUdp; +import com.azure.resourcemanager.desktopvirtualization.models.Sku; import com.azure.resourcemanager.desktopvirtualization.models.SsoSecretType; import java.util.Collections; import java.util.List; @@ -73,15 +78,15 @@ public String etag() { return this.innerModel().etag(); } - public ResourceModelWithAllowedPropertySetIdentity identity() { + public ManagedServiceIdentity identity() { return this.innerModel().identity(); } - public ResourceModelWithAllowedPropertySetSku sku() { + public Sku sku() { return this.innerModel().sku(); } - public ResourceModelWithAllowedPropertySetPlan plan() { + public Plan plan() { return this.innerModel().plan(); } @@ -142,6 +147,10 @@ public String vmTemplate() { return this.innerModel().vmTemplate(); } + public ManagementType managementType() { + return this.innerModel().managementType(); + } + public List applicationGroupReferences() { List inner = this.innerModel().applicationGroupReferences(); if (inner != null) { @@ -205,6 +214,22 @@ public List privateEndpointConnections() { } } + public ManagedPrivateUdp managedPrivateUdp() { + return this.innerModel().managedPrivateUdp(); + } + + public DirectUdp directUdp() { + return this.innerModel().directUdp(); + } + + public PublicUdp publicUdp() { + return this.innerModel().publicUdp(); + } + + public RelayUdp relayUdp() { + return this.innerModel().relayUdp(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -376,17 +401,17 @@ public HostPoolImpl withKind(String kind) { return this; } - public HostPoolImpl withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { + public HostPoolImpl withIdentity(ManagedServiceIdentity identity) { this.innerModel().withIdentity(identity); return this; } - public HostPoolImpl withSku(ResourceModelWithAllowedPropertySetSku sku) { + public HostPoolImpl withSku(Sku sku) { this.innerModel().withSku(sku); return this; } - public HostPoolImpl withPlan(ResourceModelWithAllowedPropertySetPlan plan) { + public HostPoolImpl withPlan(Plan plan) { this.innerModel().withPlan(plan); return this; } @@ -476,6 +501,11 @@ public HostPoolImpl withVmTemplate(String vmTemplate) { } } + public HostPoolImpl withManagementType(ManagementType managementType) { + this.innerModel().withManagementType(managementType); + return this; + } + public HostPoolImpl withSsoadfsAuthority(String ssoadfsAuthority) { if (isInCreateMode()) { this.innerModel().withSsoadfsAuthority(ssoadfsAuthority); @@ -541,6 +571,46 @@ public HostPoolImpl withAgentUpdate(AgentUpdateProperties agentUpdate) { return this; } + public HostPoolImpl withManagedPrivateUdp(ManagedPrivateUdp managedPrivateUdp) { + if (isInCreateMode()) { + this.innerModel().withManagedPrivateUdp(managedPrivateUdp); + return this; + } else { + this.updateHostPool.withManagedPrivateUdp(managedPrivateUdp); + return this; + } + } + + public HostPoolImpl withDirectUdp(DirectUdp directUdp) { + if (isInCreateMode()) { + this.innerModel().withDirectUdp(directUdp); + return this; + } else { + this.updateHostPool.withDirectUdp(directUdp); + return this; + } + } + + public HostPoolImpl withPublicUdp(PublicUdp publicUdp) { + if (isInCreateMode()) { + this.innerModel().withPublicUdp(publicUdp); + return this; + } else { + this.updateHostPool.withPublicUdp(publicUdp); + return this; + } + } + + public HostPoolImpl withRelayUdp(RelayUdp relayUdp) { + if (isInCreateMode()) { + this.innerModel().withRelayUdp(relayUdp); + return this; + } else { + this.updateHostPool.withRelayUdp(relayUdp); + return this; + } + } + public HostPoolImpl withRegistrationInfo(RegistrationInfoPatch registrationInfo) { this.updateHostPool.withRegistrationInfo(registrationInfo); return this; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolPropertiesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolPropertiesImpl.java index 8a313ac02d06..d56373c69bf5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolPropertiesImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolPropertiesImpl.java @@ -7,14 +7,19 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.models.HostPoolPropertiesInner; import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationInfoInner; import com.azure.resourcemanager.desktopvirtualization.models.AgentUpdateProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DirectUdp; import com.azure.resourcemanager.desktopvirtualization.models.HostPoolProperties; -import com.azure.resourcemanager.desktopvirtualization.models.HostpoolPublicNetworkAccess; import com.azure.resourcemanager.desktopvirtualization.models.HostPoolType; +import com.azure.resourcemanager.desktopvirtualization.models.HostpoolPublicNetworkAccess; import com.azure.resourcemanager.desktopvirtualization.models.LoadBalancerType; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedPrivateUdp; +import com.azure.resourcemanager.desktopvirtualization.models.ManagementType; import com.azure.resourcemanager.desktopvirtualization.models.PersonalDesktopAssignmentType; import com.azure.resourcemanager.desktopvirtualization.models.PreferredAppGroupType; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; +import com.azure.resourcemanager.desktopvirtualization.models.PublicUdp; import com.azure.resourcemanager.desktopvirtualization.models.RegistrationInfo; +import com.azure.resourcemanager.desktopvirtualization.models.RelayUdp; import com.azure.resourcemanager.desktopvirtualization.models.SsoSecretType; import java.util.Collections; import java.util.List; @@ -83,6 +88,10 @@ public String vmTemplate() { return this.innerModel().vmTemplate(); } + public ManagementType managementType() { + return this.innerModel().managementType(); + } + public List applicationGroupReferences() { List inner = this.innerModel().applicationGroupReferences(); if (inner != null) { @@ -146,6 +155,22 @@ public List privateEndpointConnections() { } } + public ManagedPrivateUdp managedPrivateUdp() { + return this.innerModel().managedPrivateUdp(); + } + + public DirectUdp directUdp() { + return this.innerModel().directUdp(); + } + + public PublicUdp publicUdp() { + return this.innerModel().publicUdp(); + } + + public RelayUdp relayUdp() { + return this.innerModel().relayUdp(); + } + public HostPoolPropertiesInner innerModel() { return this.innerObject; } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/InitiateSessionHostUpdatesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/InitiateSessionHostUpdatesClientImpl.java new file mode 100644 index 000000000000..d1995275a895 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/InitiateSessionHostUpdatesClientImpl.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.desktopvirtualization.fluent.InitiateSessionHostUpdatesClient; +import com.azure.resourcemanager.desktopvirtualization.models.UpdateSessionHostsRequestBody; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in InitiateSessionHostUpdatesClient. + */ +public final class InitiateSessionHostUpdatesClientImpl implements InitiateSessionHostUpdatesClient { + /** + * The proxy service used to perform REST calls. + */ + private final InitiateSessionHostUpdatesService service; + + /** + * The service client containing this operation class. + */ + private final DesktopVirtualizationApiClientImpl client; + + /** + * Initializes an instance of InitiateSessionHostUpdatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + InitiateSessionHostUpdatesClientImpl(DesktopVirtualizationApiClientImpl client) { + this.service = RestProxy.create(InitiateSessionHostUpdatesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DesktopVirtualizationApiClientInitiateSessionHostUpdates to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DesktopVirtualizatio") + public interface InitiateSessionHostUpdatesService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/initiateSessionHostUpdate") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> post(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @BodyParam("application/json") UpdateSessionHostsRequestBody updateSessionHostsRequestBody, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Initiates a hostpool update or schedule an update for the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param updateSessionHostsRequestBody Object containing the definition for properties to be used in the + * sessionHostUpdate validation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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) + public Mono> postWithResponseAsync(String resourceGroupName, String hostPoolName, + UpdateSessionHostsRequestBody updateSessionHostsRequestBody) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + if (updateSessionHostsRequestBody != null) { + updateSessionHostsRequestBody.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.post(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, updateSessionHostsRequestBody, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Initiates a hostpool update or schedule an update for the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param updateSessionHostsRequestBody Object containing the definition for properties to be used in the + * sessionHostUpdate validation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> postWithResponseAsync(String resourceGroupName, String hostPoolName, + UpdateSessionHostsRequestBody updateSessionHostsRequestBody, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + if (updateSessionHostsRequestBody != null) { + updateSessionHostsRequestBody.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.post(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, updateSessionHostsRequestBody, accept, context); + } + + /** + * Initiates a hostpool update or schedule an update for the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono postAsync(String resourceGroupName, String hostPoolName) { + final UpdateSessionHostsRequestBody updateSessionHostsRequestBody = null; + return postWithResponseAsync(resourceGroupName, hostPoolName, updateSessionHostsRequestBody) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Initiates a hostpool update or schedule an update for the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param updateSessionHostsRequestBody Object containing the definition for properties to be used in the + * sessionHostUpdate validation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response postWithResponse(String resourceGroupName, String hostPoolName, + UpdateSessionHostsRequestBody updateSessionHostsRequestBody, Context context) { + return postWithResponseAsync(resourceGroupName, hostPoolName, updateSessionHostsRequestBody, context).block(); + } + + /** + * Initiates a hostpool update or schedule an update for the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void post(String resourceGroupName, String hostPoolName) { + final UpdateSessionHostsRequestBody updateSessionHostsRequestBody = null; + postWithResponse(resourceGroupName, hostPoolName, updateSessionHostsRequestBody, Context.NONE); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/InitiateSessionHostUpdatesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/InitiateSessionHostUpdatesImpl.java new file mode 100644 index 000000000000..ab1ec957725a --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/InitiateSessionHostUpdatesImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.desktopvirtualization.fluent.InitiateSessionHostUpdatesClient; +import com.azure.resourcemanager.desktopvirtualization.models.InitiateSessionHostUpdates; +import com.azure.resourcemanager.desktopvirtualization.models.UpdateSessionHostsRequestBody; + +public final class InitiateSessionHostUpdatesImpl implements InitiateSessionHostUpdates { + private static final ClientLogger LOGGER = new ClientLogger(InitiateSessionHostUpdatesImpl.class); + + private final InitiateSessionHostUpdatesClient innerClient; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + public InitiateSessionHostUpdatesImpl(InitiateSessionHostUpdatesClient innerClient, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response postWithResponse(String resourceGroupName, String hostPoolName, + UpdateSessionHostsRequestBody updateSessionHostsRequestBody, Context context) { + return this.serviceClient() + .postWithResponse(resourceGroupName, hostPoolName, updateSessionHostsRequestBody, context); + } + + public void post(String resourceGroupName, String hostPoolName) { + this.serviceClient().post(resourceGroupName, hostPoolName); + } + + private InitiateSessionHostUpdatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixImagesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixImagesImpl.java index 3b19eb67bb19..621cd9dfb67a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixImagesImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixImagesImpl.java @@ -10,8 +10,8 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.MsixImagesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ExpandMsixImageInner; import com.azure.resourcemanager.desktopvirtualization.models.ExpandMsixImage; -import com.azure.resourcemanager.desktopvirtualization.models.MsixImages; import com.azure.resourcemanager.desktopvirtualization.models.MsixImageUri; +import com.azure.resourcemanager.desktopvirtualization.models.MsixImages; public final class MsixImagesImpl implements MsixImages { private static final ClientLogger LOGGER = new ClientLogger(MsixImagesImpl.class); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsImpl.java index 1b13deb5f8e9..5e6115c07dff 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsImpl.java @@ -12,8 +12,8 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionWithSystemDataInner; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnections; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; +import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnections; public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanImpl.java index 4419c5172090..e22e953172ea 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanImpl.java @@ -8,14 +8,14 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanInner; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedServiceIdentity; +import com.azure.resourcemanager.desktopvirtualization.models.Plan; import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolReference; import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolType; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlan; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPatch; import com.azure.resourcemanager.desktopvirtualization.models.ScalingSchedule; +import com.azure.resourcemanager.desktopvirtualization.models.Sku; import java.util.Collections; import java.util.List; import java.util.Map; @@ -62,15 +62,15 @@ public String etag() { return this.innerModel().etag(); } - public ResourceModelWithAllowedPropertySetIdentity identity() { + public ManagedServiceIdentity identity() { return this.innerModel().identity(); } - public ResourceModelWithAllowedPropertySetSku sku() { + public Sku sku() { return this.innerModel().sku(); } - public ResourceModelWithAllowedPropertySetPlan plan() { + public Plan plan() { return this.innerModel().plan(); } @@ -259,17 +259,17 @@ public ScalingPlanImpl withKind(String kind) { return this; } - public ScalingPlanImpl withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { + public ScalingPlanImpl withIdentity(ManagedServiceIdentity identity) { this.innerModel().withIdentity(identity); return this; } - public ScalingPlanImpl withSku(ResourceModelWithAllowedPropertySetSku sku) { + public ScalingPlanImpl withSku(Sku sku) { this.innerModel().withSku(sku); return this; } - public ScalingPlanImpl withPlan(ResourceModelWithAllowedPropertySetPlan plan) { + public ScalingPlanImpl withPlan(Plan plan) { this.innerModel().withPlan(plan); return this; } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalScheduleImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalScheduleImpl.java index 8ce69bb08598..64911c379924 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalScheduleImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalScheduleImpl.java @@ -266,6 +266,36 @@ public ScalingPlanPersonalScheduleImpl withRampUpStartTime(Time rampUpStartTime) } } + public ScalingPlanPersonalScheduleImpl withPeakStartTime(Time peakStartTime) { + if (isInCreateMode()) { + this.innerModel().withPeakStartTime(peakStartTime); + return this; + } else { + this.updateScalingPlanSchedule.withPeakStartTime(peakStartTime); + return this; + } + } + + public ScalingPlanPersonalScheduleImpl withRampDownStartTime(Time rampDownStartTime) { + if (isInCreateMode()) { + this.innerModel().withRampDownStartTime(rampDownStartTime); + return this; + } else { + this.updateScalingPlanSchedule.withRampDownStartTime(rampDownStartTime); + return this; + } + } + + public ScalingPlanPersonalScheduleImpl withOffPeakStartTime(Time offPeakStartTime) { + if (isInCreateMode()) { + this.innerModel().withOffPeakStartTime(offPeakStartTime); + return this; + } else { + this.updateScalingPlanSchedule.withOffPeakStartTime(offPeakStartTime); + return this; + } + } + public ScalingPlanPersonalScheduleImpl withRampUpAutoStartHosts(StartupBehavior rampUpAutoStartHosts) { if (isInCreateMode()) { this.innerModel().withRampUpAutoStartHosts(rampUpAutoStartHosts); @@ -328,16 +358,6 @@ public ScalingPlanPersonalScheduleImpl withRampUpMinutesToWaitOnLogoff(Integer r } } - public ScalingPlanPersonalScheduleImpl withPeakStartTime(Time peakStartTime) { - if (isInCreateMode()) { - this.innerModel().withPeakStartTime(peakStartTime); - return this; - } else { - this.updateScalingPlanSchedule.withPeakStartTime(peakStartTime); - return this; - } - } - public ScalingPlanPersonalScheduleImpl withPeakStartVMOnConnect(SetStartVMOnConnect peakStartVMOnConnect) { if (isInCreateMode()) { this.innerModel().withPeakStartVMOnConnect(peakStartVMOnConnect); @@ -388,16 +408,6 @@ public ScalingPlanPersonalScheduleImpl withPeakMinutesToWaitOnLogoff(Integer pea } } - public ScalingPlanPersonalScheduleImpl withRampDownStartTime(Time rampDownStartTime) { - if (isInCreateMode()) { - this.innerModel().withRampDownStartTime(rampDownStartTime); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownStartTime(rampDownStartTime); - return this; - } - } - public ScalingPlanPersonalScheduleImpl withRampDownStartVMOnConnect(SetStartVMOnConnect rampDownStartVMOnConnect) { if (isInCreateMode()) { this.innerModel().withRampDownStartVMOnConnect(rampDownStartVMOnConnect); @@ -450,16 +460,6 @@ public ScalingPlanPersonalScheduleImpl withRampDownMinutesToWaitOnLogoff(Integer } } - public ScalingPlanPersonalScheduleImpl withOffPeakStartTime(Time offPeakStartTime) { - if (isInCreateMode()) { - this.innerModel().withOffPeakStartTime(offPeakStartTime); - return this; - } else { - this.updateScalingPlanSchedule.withOffPeakStartTime(offPeakStartTime); - return this; - } - } - public ScalingPlanPersonalScheduleImpl withOffPeakStartVMOnConnect(SetStartVMOnConnect offPeakStartVMOnConnect) { if (isInCreateMode()) { this.innerModel().withOffPeakStartVMOnConnect(offPeakStartVMOnConnect); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledScheduleImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledScheduleImpl.java index ab84fb562dde..e16c14d66f95 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledScheduleImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledScheduleImpl.java @@ -7,7 +7,9 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPooledScheduleInner; +import com.azure.resourcemanager.desktopvirtualization.models.CreateDeleteProperties; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingMethod; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedule; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedulePatch; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; @@ -38,6 +40,10 @@ public SystemData systemData() { return this.innerModel().systemData(); } + public String namePropertiesName() { + return this.innerModel().namePropertiesName(); + } + public List daysOfWeek() { List inner = this.innerModel().daysOfWeek(); if (inner != null) { @@ -47,6 +53,14 @@ public List daysOfWeek() { } } + public ScalingMethod scalingMethod() { + return this.innerModel().scalingMethod(); + } + + public CreateDeleteProperties createDelete() { + return this.innerModel().createDelete(); + } + public Time rampUpStartTime() { return this.innerModel().rampUpStartTime(); } @@ -59,7 +73,7 @@ public Integer rampUpMinimumHostsPct() { return this.innerModel().rampUpMinimumHostsPct(); } - public Integer rampUpCapacityThresholdPct() { + public int rampUpCapacityThresholdPct() { return this.innerModel().rampUpCapacityThresholdPct(); } @@ -83,7 +97,7 @@ public Integer rampDownMinimumHostsPct() { return this.innerModel().rampDownMinimumHostsPct(); } - public Integer rampDownCapacityThresholdPct() { + public int rampDownCapacityThresholdPct() { return this.innerModel().rampDownCapacityThresholdPct(); } @@ -229,95 +243,115 @@ public ScalingPlanPooledScheduleImpl withRampUpStartTime(Time rampUpStartTime) { } } - public ScalingPlanPooledScheduleImpl - withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm) { + public ScalingPlanPooledScheduleImpl withRampUpCapacityThresholdPct(int rampUpCapacityThresholdPct) { + this.innerModel().withRampUpCapacityThresholdPct(rampUpCapacityThresholdPct); + return this; + } + + public ScalingPlanPooledScheduleImpl withPeakStartTime(Time peakStartTime) { if (isInCreateMode()) { - this.innerModel().withRampUpLoadBalancingAlgorithm(rampUpLoadBalancingAlgorithm); + this.innerModel().withPeakStartTime(peakStartTime); return this; } else { - this.updateScalingPlanSchedule.withRampUpLoadBalancingAlgorithm(rampUpLoadBalancingAlgorithm); + this.updateScalingPlanSchedule.withPeakStartTime(peakStartTime); return this; } } - public ScalingPlanPooledScheduleImpl withRampUpMinimumHostsPct(Integer rampUpMinimumHostsPct) { + public ScalingPlanPooledScheduleImpl withRampDownStartTime(Time rampDownStartTime) { if (isInCreateMode()) { - this.innerModel().withRampUpMinimumHostsPct(rampUpMinimumHostsPct); + this.innerModel().withRampDownStartTime(rampDownStartTime); return this; } else { - this.updateScalingPlanSchedule.withRampUpMinimumHostsPct(rampUpMinimumHostsPct); + this.updateScalingPlanSchedule.withRampDownStartTime(rampDownStartTime); return this; } } - public ScalingPlanPooledScheduleImpl withRampUpCapacityThresholdPct(Integer rampUpCapacityThresholdPct) { + public ScalingPlanPooledScheduleImpl withRampDownCapacityThresholdPct(int rampDownCapacityThresholdPct) { + this.innerModel().withRampDownCapacityThresholdPct(rampDownCapacityThresholdPct); + return this; + } + + public ScalingPlanPooledScheduleImpl withOffPeakStartTime(Time offPeakStartTime) { if (isInCreateMode()) { - this.innerModel().withRampUpCapacityThresholdPct(rampUpCapacityThresholdPct); + this.innerModel().withOffPeakStartTime(offPeakStartTime); return this; } else { - this.updateScalingPlanSchedule.withRampUpCapacityThresholdPct(rampUpCapacityThresholdPct); + this.updateScalingPlanSchedule.withOffPeakStartTime(offPeakStartTime); return this; } } - public ScalingPlanPooledScheduleImpl withPeakStartTime(Time peakStartTime) { + public ScalingPlanPooledScheduleImpl withScalingMethod(ScalingMethod scalingMethod) { if (isInCreateMode()) { - this.innerModel().withPeakStartTime(peakStartTime); + this.innerModel().withScalingMethod(scalingMethod); return this; } else { - this.updateScalingPlanSchedule.withPeakStartTime(peakStartTime); + this.updateScalingPlanSchedule.withScalingMethod(scalingMethod); + return this; + } + } + + public ScalingPlanPooledScheduleImpl withCreateDelete(CreateDeleteProperties createDelete) { + if (isInCreateMode()) { + this.innerModel().withCreateDelete(createDelete); + return this; + } else { + this.updateScalingPlanSchedule.withCreateDelete(createDelete); return this; } } public ScalingPlanPooledScheduleImpl - withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm) { + withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm) { if (isInCreateMode()) { - this.innerModel().withPeakLoadBalancingAlgorithm(peakLoadBalancingAlgorithm); + this.innerModel().withRampUpLoadBalancingAlgorithm(rampUpLoadBalancingAlgorithm); return this; } else { - this.updateScalingPlanSchedule.withPeakLoadBalancingAlgorithm(peakLoadBalancingAlgorithm); + this.updateScalingPlanSchedule.withRampUpLoadBalancingAlgorithm(rampUpLoadBalancingAlgorithm); return this; } } - public ScalingPlanPooledScheduleImpl withRampDownStartTime(Time rampDownStartTime) { + public ScalingPlanPooledScheduleImpl withRampUpMinimumHostsPct(Integer rampUpMinimumHostsPct) { if (isInCreateMode()) { - this.innerModel().withRampDownStartTime(rampDownStartTime); + this.innerModel().withRampUpMinimumHostsPct(rampUpMinimumHostsPct); return this; } else { - this.updateScalingPlanSchedule.withRampDownStartTime(rampDownStartTime); + this.updateScalingPlanSchedule.withRampUpMinimumHostsPct(rampUpMinimumHostsPct); return this; } } public ScalingPlanPooledScheduleImpl - withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm) { + withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm) { if (isInCreateMode()) { - this.innerModel().withRampDownLoadBalancingAlgorithm(rampDownLoadBalancingAlgorithm); + this.innerModel().withPeakLoadBalancingAlgorithm(peakLoadBalancingAlgorithm); return this; } else { - this.updateScalingPlanSchedule.withRampDownLoadBalancingAlgorithm(rampDownLoadBalancingAlgorithm); + this.updateScalingPlanSchedule.withPeakLoadBalancingAlgorithm(peakLoadBalancingAlgorithm); return this; } } - public ScalingPlanPooledScheduleImpl withRampDownMinimumHostsPct(Integer rampDownMinimumHostsPct) { + public ScalingPlanPooledScheduleImpl + withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm) { if (isInCreateMode()) { - this.innerModel().withRampDownMinimumHostsPct(rampDownMinimumHostsPct); + this.innerModel().withRampDownLoadBalancingAlgorithm(rampDownLoadBalancingAlgorithm); return this; } else { - this.updateScalingPlanSchedule.withRampDownMinimumHostsPct(rampDownMinimumHostsPct); + this.updateScalingPlanSchedule.withRampDownLoadBalancingAlgorithm(rampDownLoadBalancingAlgorithm); return this; } } - public ScalingPlanPooledScheduleImpl withRampDownCapacityThresholdPct(Integer rampDownCapacityThresholdPct) { + public ScalingPlanPooledScheduleImpl withRampDownMinimumHostsPct(Integer rampDownMinimumHostsPct) { if (isInCreateMode()) { - this.innerModel().withRampDownCapacityThresholdPct(rampDownCapacityThresholdPct); + this.innerModel().withRampDownMinimumHostsPct(rampDownMinimumHostsPct); return this; } else { - this.updateScalingPlanSchedule.withRampDownCapacityThresholdPct(rampDownCapacityThresholdPct); + this.updateScalingPlanSchedule.withRampDownMinimumHostsPct(rampDownMinimumHostsPct); return this; } } @@ -362,16 +396,6 @@ public ScalingPlanPooledScheduleImpl withRampDownNotificationMessage(String ramp } } - public ScalingPlanPooledScheduleImpl withOffPeakStartTime(Time offPeakStartTime) { - if (isInCreateMode()) { - this.innerModel().withOffPeakStartTime(offPeakStartTime); - return this; - } else { - this.updateScalingPlanSchedule.withOffPeakStartTime(offPeakStartTime); - return this; - } - } - public ScalingPlanPooledScheduleImpl withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm) { if (isInCreateMode()) { @@ -383,6 +407,16 @@ public ScalingPlanPooledScheduleImpl withOffPeakStartTime(Time offPeakStartTime) } } + public ScalingPlanPooledScheduleImpl withRampUpCapacityThresholdPct(Integer rampUpCapacityThresholdPct) { + this.updateScalingPlanSchedule.withRampUpCapacityThresholdPct(rampUpCapacityThresholdPct); + return this; + } + + public ScalingPlanPooledScheduleImpl withRampDownCapacityThresholdPct(Integer rampDownCapacityThresholdPct) { + this.updateScalingPlanSchedule.withRampDownCapacityThresholdPct(rampDownCapacityThresholdPct); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostConfigurationImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostConfigurationImpl.java new file mode 100644 index 000000000000..a82cb67d1eb5 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostConfigurationImpl.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostConfigurationInner; +import com.azure.resourcemanager.desktopvirtualization.models.BootDiagnosticsInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DiskInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DomainInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ImageInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.KeyVaultCredentialsProperties; +import com.azure.resourcemanager.desktopvirtualization.models.NetworkInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ProvisioningStateShc; +import com.azure.resourcemanager.desktopvirtualization.models.SecurityInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostConfiguration; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class SessionHostConfigurationImpl implements SessionHostConfiguration { + private SessionHostConfigurationInner innerObject; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + SessionHostConfigurationImpl(SessionHostConfigurationInner innerObject, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public OffsetDateTime version() { + return this.innerModel().version(); + } + + public String friendlyName() { + return this.innerModel().friendlyName(); + } + + public ProvisioningStateShc provisioningState() { + return this.innerModel().provisioningState(); + } + + public Map vmTags() { + Map inner = this.innerModel().vmTags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String vmLocation() { + return this.innerModel().vmLocation(); + } + + public String vmResourceGroup() { + return this.innerModel().vmResourceGroup(); + } + + public String vmNamePrefix() { + return this.innerModel().vmNamePrefix(); + } + + public List availabilityZones() { + List inner = this.innerModel().availabilityZones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public NetworkInfoProperties networkInfo() { + return this.innerModel().networkInfo(); + } + + public String vmSizeId() { + return this.innerModel().vmSizeId(); + } + + public DiskInfoProperties diskInfo() { + return this.innerModel().diskInfo(); + } + + public String customConfigurationScriptUrl() { + return this.innerModel().customConfigurationScriptUrl(); + } + + public ImageInfoProperties imageInfo() { + return this.innerModel().imageInfo(); + } + + public DomainInfoProperties domainInfo() { + return this.innerModel().domainInfo(); + } + + public SecurityInfoProperties securityInfo() { + return this.innerModel().securityInfo(); + } + + public KeyVaultCredentialsProperties vmAdminCredentials() { + return this.innerModel().vmAdminCredentials(); + } + + public BootDiagnosticsInfoProperties bootDiagnosticsInfo() { + return this.innerModel().bootDiagnosticsInfo(); + } + + public SessionHostConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostConfigurationsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostConfigurationsClientImpl.java new file mode 100644 index 000000000000..ddda702b2c34 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostConfigurationsClientImpl.java @@ -0,0 +1,946 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostConfigurationInner; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostConfigurationList; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostConfigurationPatch; +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 SessionHostConfigurationsClient. + */ +public final class SessionHostConfigurationsClientImpl implements SessionHostConfigurationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SessionHostConfigurationsService service; + + /** + * The service client containing this operation class. + */ + private final DesktopVirtualizationApiClientImpl client; + + /** + * Initializes an instance of SessionHostConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SessionHostConfigurationsClientImpl(DesktopVirtualizationApiClientImpl client) { + this.service = RestProxy.create(SessionHostConfigurationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DesktopVirtualizationApiClientSessionHostConfigurations to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DesktopVirtualizatio") + public interface SessionHostConfigurationsService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @BodyParam("application/json") SessionHostConfigurationInner sessionHostConfiguration, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations/default") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @BodyParam("application/json") SessionHostConfigurationPatch sessionHostConfiguration, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByHostPool(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByHostPoolNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Create or update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String hostPoolName, SessionHostConfigurationInner sessionHostConfiguration) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + if (sessionHostConfiguration == null) { + return Mono.error( + new IllegalArgumentException("Parameter sessionHostConfiguration is required and cannot be null.")); + } else { + sessionHostConfiguration.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostConfiguration, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String hostPoolName, SessionHostConfigurationInner sessionHostConfiguration, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + if (sessionHostConfiguration == null) { + return Mono.error( + new IllegalArgumentException("Parameter sessionHostConfiguration is required and cannot be null.")); + } else { + sessionHostConfiguration.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostConfiguration, accept, + context); + } + + /** + * Create or update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, SessionHostConfigurationInner> + beginCreateOrUpdateAsync(String resourceGroupName, String hostPoolName, + SessionHostConfigurationInner sessionHostConfiguration) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, hostPoolName, sessionHostConfiguration); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SessionHostConfigurationInner.class, SessionHostConfigurationInner.class, + this.client.getContext()); + } + + /** + * Create or update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SessionHostConfigurationInner> + beginCreateOrUpdateAsync(String resourceGroupName, String hostPoolName, + SessionHostConfigurationInner sessionHostConfiguration, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, hostPoolName, sessionHostConfiguration, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SessionHostConfigurationInner.class, SessionHostConfigurationInner.class, + context); + } + + /** + * Create or update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SessionHostConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String hostPoolName, SessionHostConfigurationInner sessionHostConfiguration) { + return this.beginCreateOrUpdateAsync(resourceGroupName, hostPoolName, sessionHostConfiguration).getSyncPoller(); + } + + /** + * Create or update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SessionHostConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String hostPoolName, SessionHostConfigurationInner sessionHostConfiguration, + Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, hostPoolName, sessionHostConfiguration, context) + .getSyncPoller(); + } + + /** + * Create or update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync(String resourceGroupName, String hostPoolName, + SessionHostConfigurationInner sessionHostConfiguration) { + return beginCreateOrUpdateAsync(resourceGroupName, hostPoolName, sessionHostConfiguration).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String hostPoolName, + SessionHostConfigurationInner sessionHostConfiguration, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, hostPoolName, sessionHostConfiguration, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionHostConfigurationInner createOrUpdate(String resourceGroupName, String hostPoolName, + SessionHostConfigurationInner sessionHostConfiguration) { + return createOrUpdateAsync(resourceGroupName, hostPoolName, sessionHostConfiguration).block(); + } + + /** + * Create or update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionHostConfigurationInner createOrUpdate(String resourceGroupName, String hostPoolName, + SessionHostConfigurationInner sessionHostConfiguration, Context context) { + return createOrUpdateAsync(resourceGroupName, hostPoolName, sessionHostConfiguration, context).block(); + } + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + SessionHostConfigurationPatch sessionHostConfiguration) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + if (sessionHostConfiguration != null) { + sessionHostConfiguration.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostConfiguration, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + SessionHostConfigurationPatch sessionHostConfiguration, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + if (sessionHostConfiguration != null) { + sessionHostConfiguration.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, sessionHostConfiguration, accept, context); + } + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, SessionHostConfigurationInner> beginUpdateAsync( + String resourceGroupName, String hostPoolName, SessionHostConfigurationPatch sessionHostConfiguration) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, hostPoolName, sessionHostConfiguration); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SessionHostConfigurationInner.class, SessionHostConfigurationInner.class, + this.client.getContext()); + } + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, SessionHostConfigurationInner> + beginUpdateAsync(String resourceGroupName, String hostPoolName) { + final SessionHostConfigurationPatch sessionHostConfiguration = null; + Mono>> mono + = updateWithResponseAsync(resourceGroupName, hostPoolName, sessionHostConfiguration); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SessionHostConfigurationInner.class, SessionHostConfigurationInner.class, + this.client.getContext()); + } + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SessionHostConfigurationInner> beginUpdateAsync( + String resourceGroupName, String hostPoolName, SessionHostConfigurationPatch sessionHostConfiguration, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, hostPoolName, sessionHostConfiguration, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SessionHostConfigurationInner.class, SessionHostConfigurationInner.class, + context); + } + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SessionHostConfigurationInner> + beginUpdate(String resourceGroupName, String hostPoolName) { + final SessionHostConfigurationPatch sessionHostConfiguration = null; + return this.beginUpdateAsync(resourceGroupName, hostPoolName, sessionHostConfiguration).getSyncPoller(); + } + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SessionHostConfigurationInner> beginUpdate( + String resourceGroupName, String hostPoolName, SessionHostConfigurationPatch sessionHostConfiguration, + Context context) { + return this.beginUpdateAsync(resourceGroupName, hostPoolName, sessionHostConfiguration, context) + .getSyncPoller(); + } + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String hostPoolName, + SessionHostConfigurationPatch sessionHostConfiguration) { + return beginUpdateAsync(resourceGroupName, hostPoolName, sessionHostConfiguration).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String hostPoolName) { + final SessionHostConfigurationPatch sessionHostConfiguration = null; + return beginUpdateAsync(resourceGroupName, hostPoolName, sessionHostConfiguration).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String hostPoolName, + SessionHostConfigurationPatch sessionHostConfiguration, Context context) { + return beginUpdateAsync(resourceGroupName, hostPoolName, sessionHostConfiguration, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionHostConfigurationInner update(String resourceGroupName, String hostPoolName) { + final SessionHostConfigurationPatch sessionHostConfiguration = null; + return updateAsync(resourceGroupName, hostPoolName, sessionHostConfiguration).block(); + } + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionHostConfigurationInner update(String resourceGroupName, String hostPoolName, + SessionHostConfigurationPatch sessionHostConfiguration, Context context) { + return updateAsync(resourceGroupName, hostPoolName, sessionHostConfiguration, context).block(); + } + + /** + * Get a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostConfiguration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, + String hostPoolName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostConfiguration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String hostPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, accept, context); + } + + /** + * Get a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostConfiguration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String hostPoolName) { + return getWithResponseAsync(resourceGroupName, hostPoolName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostConfiguration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context) { + return getWithResponseAsync(resourceGroupName, hostPoolName, context).block(); + } + + /** + * Get a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostConfiguration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionHostConfigurationInner get(String resourceGroupName, String hostPoolName) { + return getWithResponse(resourceGroupName, hostPoolName, Context.NONE).getValue(); + } + + /** + * List sessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostConfigurationList along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, + String hostPoolName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, 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 sessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostConfigurationList along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, + String hostPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List sessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostConfigurationList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName) { + return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName), + nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); + } + + /** + * List sessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostConfigurationList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, + Context context) { + return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, context), + nextLink -> listByHostPoolNextSinglePageAsync(nextLink, context)); + } + + /** + * List sessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostConfigurationList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { + return new PagedIterable<>(listByHostPoolAsync(resourceGroupName, hostPoolName)); + } + + /** + * List sessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostConfigurationList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Context context) { + return new PagedIterable<>(listByHostPoolAsync(resourceGroupName, hostPoolName, 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 sessionHostConfigurationList along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByHostPoolNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByHostPoolNext(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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostConfigurationList along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByHostPoolNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostConfigurationsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostConfigurationsImpl.java new file mode 100644 index 000000000000..62fb6eea178e --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostConfigurationsImpl.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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.desktopvirtualization.fluent.SessionHostConfigurationsClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostConfigurationInner; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostConfiguration; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostConfigurationPatch; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostConfigurations; + +public final class SessionHostConfigurationsImpl implements SessionHostConfigurations { + private static final ClientLogger LOGGER = new ClientLogger(SessionHostConfigurationsImpl.class); + + private final SessionHostConfigurationsClient innerClient; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + public SessionHostConfigurationsImpl(SessionHostConfigurationsClient innerClient, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public SessionHostConfiguration createOrUpdate(String resourceGroupName, String hostPoolName, + SessionHostConfigurationInner sessionHostConfiguration) { + SessionHostConfigurationInner inner + = this.serviceClient().createOrUpdate(resourceGroupName, hostPoolName, sessionHostConfiguration); + if (inner != null) { + return new SessionHostConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public SessionHostConfiguration createOrUpdate(String resourceGroupName, String hostPoolName, + SessionHostConfigurationInner sessionHostConfiguration, Context context) { + SessionHostConfigurationInner inner + = this.serviceClient().createOrUpdate(resourceGroupName, hostPoolName, sessionHostConfiguration, context); + if (inner != null) { + return new SessionHostConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public SessionHostConfiguration update(String resourceGroupName, String hostPoolName) { + SessionHostConfigurationInner inner = this.serviceClient().update(resourceGroupName, hostPoolName); + if (inner != null) { + return new SessionHostConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public SessionHostConfiguration update(String resourceGroupName, String hostPoolName, + SessionHostConfigurationPatch sessionHostConfiguration, Context context) { + SessionHostConfigurationInner inner + = this.serviceClient().update(resourceGroupName, hostPoolName, sessionHostConfiguration, context); + if (inner != null) { + return new SessionHostConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, hostPoolName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SessionHostConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SessionHostConfiguration get(String resourceGroupName, String hostPoolName) { + SessionHostConfigurationInner inner = this.serviceClient().get(resourceGroupName, hostPoolName); + if (inner != null) { + return new SessionHostConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { + PagedIterable inner + = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionHostConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Context context) { + PagedIterable inner + = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionHostConfigurationImpl(inner1, this.manager())); + } + + private SessionHostConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostImpl.java index 70d75a4b9d9f..f2ffd408f2e2 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostImpl.java @@ -41,6 +41,18 @@ public SystemData systemData() { return this.innerModel().systemData(); } + public Integer activeSessions() { + return this.innerModel().activeSessions(); + } + + public Integer disconnectedSessions() { + return this.innerModel().disconnectedSessions(); + } + + public Integer pendingSessions() { + return this.innerModel().pendingSessions(); + } + public String objectId() { return this.innerModel().objectId(); } @@ -105,6 +117,14 @@ public String updateErrorMessage() { return this.innerModel().updateErrorMessage(); } + public OffsetDateTime lastSessionHostUpdateTime() { + return this.innerModel().lastSessionHostUpdateTime(); + } + + public String sessionHostConfiguration() { + return this.innerModel().sessionHostConfiguration(); + } + public List sessionHostHealthCheckResults() { List inner = this.innerModel().sessionHostHealthCheckResults(); if (inner != null) { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementImpl.java new file mode 100644 index 000000000000..a039276b0c45 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagement; + +public final class SessionHostManagementImpl implements SessionHostManagement { + private SessionHostManagementInner innerObject; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + SessionHostManagementImpl(SessionHostManagementInner innerObject, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String scheduledDateTimeZone() { + return this.innerModel().scheduledDateTimeZone(); + } + + public HostPoolUpdateConfigurationProperties update() { + return this.innerModel().update(); + } + + public SessionHostManagementInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementUpdateStatusImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementUpdateStatusImpl.java new file mode 100644 index 000000000000..1c6c1114ab7c --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementUpdateStatusImpl.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementUpdateStatusInner; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagement; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementOperationProgress; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementUpdateStatus; +import java.time.OffsetDateTime; + +public final class SessionHostManagementUpdateStatusImpl implements SessionHostManagementUpdateStatus { + private SessionHostManagementUpdateStatusInner innerObject; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + SessionHostManagementUpdateStatusImpl(SessionHostManagementUpdateStatusInner innerObject, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager 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 Float percentComplete() { + return this.innerModel().percentComplete(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public ManagementError error() { + return this.innerModel().error(); + } + + public String correlationId() { + return this.innerModel().correlationId(); + } + + public SessionHostManagementOperationProgress progress() { + return this.innerModel().progress(); + } + + public OffsetDateTime scheduledDateTime() { + return this.innerModel().scheduledDateTime(); + } + + public SessionHostManagement sessionHostManagement() { + SessionHostManagementInner inner = this.innerModel().sessionHostManagement(); + if (inner != null) { + return new SessionHostManagementImpl(inner, this.manager()); + } else { + return null; + } + } + + public SessionHostManagementUpdateStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementUpdateStatusPropertiesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementUpdateStatusPropertiesImpl.java new file mode 100644 index 000000000000..4fa5ae0231d7 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementUpdateStatusPropertiesImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementUpdateStatusPropertiesInner; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagement; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementOperationProgress; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementUpdateStatusProperties; +import java.time.OffsetDateTime; + +public final class SessionHostManagementUpdateStatusPropertiesImpl + implements SessionHostManagementUpdateStatusProperties { + private SessionHostManagementUpdateStatusPropertiesInner innerObject; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + SessionHostManagementUpdateStatusPropertiesImpl(SessionHostManagementUpdateStatusPropertiesInner innerObject, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String correlationId() { + return this.innerModel().correlationId(); + } + + public SessionHostManagementOperationProgress progress() { + return this.innerModel().progress(); + } + + public OffsetDateTime scheduledDateTime() { + return this.innerModel().scheduledDateTime(); + } + + public SessionHostManagement sessionHostManagement() { + SessionHostManagementInner inner = this.innerModel().sessionHostManagement(); + if (inner != null) { + return new SessionHostManagementImpl(inner, this.manager()); + } else { + return null; + } + } + + public SessionHostManagementUpdateStatusPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementsClientImpl.java new file mode 100644 index 000000000000..a54f351ea0d2 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementsClientImpl.java @@ -0,0 +1,697 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementList; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementPatch; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SessionHostManagementsClient. + */ +public final class SessionHostManagementsClientImpl implements SessionHostManagementsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SessionHostManagementsService service; + + /** + * The service client containing this operation class. + */ + private final DesktopVirtualizationApiClientImpl client; + + /** + * Initializes an instance of SessionHostManagementsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SessionHostManagementsClientImpl(DesktopVirtualizationApiClientImpl client) { + this.service = RestProxy.create(SessionHostManagementsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DesktopVirtualizationApiClientSessionHostManagements to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DesktopVirtualizatio") + public interface SessionHostManagementsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @BodyParam("application/json") SessionHostManagementInner sessionHostManagement, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @BodyParam("application/json") SessionHostManagementPatch sessionHostManagement, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByHostPool(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByHostPoolNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostManagement along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, + String hostPoolName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostManagement along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String hostPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, accept, context); + } + + /** + * Get a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostManagement on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String hostPoolName) { + return getWithResponseAsync(resourceGroupName, hostPoolName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostManagement along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context) { + return getWithResponseAsync(resourceGroupName, hostPoolName, context).block(); + } + + /** + * Get a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostManagement. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionHostManagementInner get(String resourceGroupName, String hostPoolName) { + return getWithResponse(resourceGroupName, hostPoolName, Context.NONE).getValue(); + } + + /** + * Create or update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostManagement Object containing SessionHostManagement definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String hostPoolName, SessionHostManagementInner sessionHostManagement) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + if (sessionHostManagement == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionHostManagement is required and cannot be null.")); + } else { + sessionHostManagement.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostManagement, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostManagement Object containing SessionHostManagement definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String hostPoolName, SessionHostManagementInner sessionHostManagement, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + if (sessionHostManagement == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionHostManagement is required and cannot be null.")); + } else { + sessionHostManagement.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostManagement, accept, context); + } + + /** + * Create or update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostManagement Object containing SessionHostManagement definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync(String resourceGroupName, String hostPoolName, + SessionHostManagementInner sessionHostManagement) { + return createOrUpdateWithResponseAsync(resourceGroupName, hostPoolName, sessionHostManagement) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostManagement Object containing SessionHostManagement definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String hostPoolName, SessionHostManagementInner sessionHostManagement, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, hostPoolName, sessionHostManagement, context).block(); + } + + /** + * Create or update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostManagement Object containing SessionHostManagement definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionHostManagementInner createOrUpdate(String resourceGroupName, String hostPoolName, + SessionHostManagementInner sessionHostManagement) { + return createOrUpdateWithResponse(resourceGroupName, hostPoolName, sessionHostManagement, Context.NONE) + .getValue(); + } + + /** + * Update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostManagement Object containing SessionHostManagement definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateWithResponseAsync(String resourceGroupName, + String hostPoolName, SessionHostManagementPatch sessionHostManagement) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + if (sessionHostManagement != null) { + sessionHostManagement.validate(); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostManagement, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostManagement Object containing SessionHostManagement definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, + String hostPoolName, SessionHostManagementPatch sessionHostManagement, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + if (sessionHostManagement != null) { + sessionHostManagement.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, sessionHostManagement, accept, context); + } + + /** + * Update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String hostPoolName) { + final SessionHostManagementPatch sessionHostManagement = null; + return updateWithResponseAsync(resourceGroupName, hostPoolName, sessionHostManagement) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostManagement Object containing SessionHostManagement definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String hostPoolName, + SessionHostManagementPatch sessionHostManagement, Context context) { + return updateWithResponseAsync(resourceGroupName, hostPoolName, sessionHostManagement, context).block(); + } + + /** + * Update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionHostManagementInner update(String resourceGroupName, String hostPoolName) { + final SessionHostManagementPatch sessionHostManagement = null; + return updateWithResponse(resourceGroupName, hostPoolName, sessionHostManagement, Context.NONE).getValue(); + } + + /** + * List SessionHostManagements by hostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostManagementList along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, + String hostPoolName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, 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 SessionHostManagements by hostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostManagementList along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, + String hostPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SessionHostManagements by hostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostManagementList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName) { + return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName), + nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); + } + + /** + * List SessionHostManagements by hostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostManagementList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, + Context context) { + return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, context), + nextLink -> listByHostPoolNextSinglePageAsync(nextLink, context)); + } + + /** + * List SessionHostManagements by hostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostManagementList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { + return new PagedIterable<>(listByHostPoolAsync(resourceGroupName, hostPoolName)); + } + + /** + * List SessionHostManagements by hostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostManagementList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Context context) { + return new PagedIterable<>(listByHostPoolAsync(resourceGroupName, hostPoolName, 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 sessionHostManagementList along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByHostPoolNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByHostPoolNext(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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostManagementList along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByHostPoolNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementsImpl.java new file mode 100644 index 000000000000..1f3b229688e2 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementsImpl.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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.desktopvirtualization.fluent.SessionHostManagementsClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagement; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementPatch; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagements; + +public final class SessionHostManagementsImpl implements SessionHostManagements { + private static final ClientLogger LOGGER = new ClientLogger(SessionHostManagementsImpl.class); + + private final SessionHostManagementsClient innerClient; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + public SessionHostManagementsImpl(SessionHostManagementsClient innerClient, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, hostPoolName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SessionHostManagementImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SessionHostManagement get(String resourceGroupName, String hostPoolName) { + SessionHostManagementInner inner = this.serviceClient().get(resourceGroupName, hostPoolName); + if (inner != null) { + return new SessionHostManagementImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse(String resourceGroupName, String hostPoolName, + SessionHostManagementInner sessionHostManagement, Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, hostPoolName, sessionHostManagement, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SessionHostManagementImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SessionHostManagement createOrUpdate(String resourceGroupName, String hostPoolName, + SessionHostManagementInner sessionHostManagement) { + SessionHostManagementInner inner + = this.serviceClient().createOrUpdate(resourceGroupName, hostPoolName, sessionHostManagement); + if (inner != null) { + return new SessionHostManagementImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse(String resourceGroupName, String hostPoolName, + SessionHostManagementPatch sessionHostManagement, Context context) { + Response inner + = this.serviceClient().updateWithResponse(resourceGroupName, hostPoolName, sessionHostManagement, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SessionHostManagementImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SessionHostManagement update(String resourceGroupName, String hostPoolName) { + SessionHostManagementInner inner = this.serviceClient().update(resourceGroupName, hostPoolName); + if (inner != null) { + return new SessionHostManagementImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { + PagedIterable inner + = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionHostManagementImpl(inner1, this.manager())); + } + + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Context context) { + PagedIterable inner + = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionHostManagementImpl(inner1, this.manager())); + } + + private SessionHostManagementsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementsUpdateStatusClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementsUpdateStatusClientImpl.java new file mode 100644 index 000000000000..4e23486bfe20 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementsUpdateStatusClientImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsUpdateStatusClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementUpdateStatusInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SessionHostManagementsUpdateStatusClient. + */ +public final class SessionHostManagementsUpdateStatusClientImpl implements SessionHostManagementsUpdateStatusClient { + /** + * The proxy service used to perform REST calls. + */ + private final SessionHostManagementsUpdateStatusService service; + + /** + * The service client containing this operation class. + */ + private final DesktopVirtualizationApiClientImpl client; + + /** + * Initializes an instance of SessionHostManagementsUpdateStatusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SessionHostManagementsUpdateStatusClientImpl(DesktopVirtualizationApiClientImpl client) { + this.service = RestProxy.create(SessionHostManagementsUpdateStatusService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DesktopVirtualizationApiClientSessionHostManagementsUpdateStatus to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DesktopVirtualizatio") + public interface SessionHostManagementsUpdateStatusService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/sessionHostUpdateStatuses/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the session host update status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host update status for a given hostpool along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, + String hostPoolName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the session host update status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host update status for a given hostpool along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String hostPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, accept, context); + } + + /** + * Get the session host update status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host update status for a given hostpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String hostPoolName) { + return getWithResponseAsync(resourceGroupName, hostPoolName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the session host update status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host update status for a given hostpool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String hostPoolName, Context context) { + return getWithResponseAsync(resourceGroupName, hostPoolName, context).block(); + } + + /** + * Get the session host update status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host update status for a given hostpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionHostManagementUpdateStatusInner get(String resourceGroupName, String hostPoolName) { + return getWithResponse(resourceGroupName, hostPoolName, Context.NONE).getValue(); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementsUpdateStatusImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementsUpdateStatusImpl.java new file mode 100644 index 000000000000..a69a456097cf --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementsUpdateStatusImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsUpdateStatusClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementUpdateStatusInner; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementUpdateStatus; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementsUpdateStatus; + +public final class SessionHostManagementsUpdateStatusImpl implements SessionHostManagementsUpdateStatus { + private static final ClientLogger LOGGER = new ClientLogger(SessionHostManagementsUpdateStatusImpl.class); + + private final SessionHostManagementsUpdateStatusClient innerClient; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + public SessionHostManagementsUpdateStatusImpl(SessionHostManagementsUpdateStatusClient innerClient, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, hostPoolName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SessionHostManagementUpdateStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SessionHostManagementUpdateStatus get(String resourceGroupName, String hostPoolName) { + SessionHostManagementUpdateStatusInner inner = this.serviceClient().get(resourceGroupName, hostPoolName); + if (inner != null) { + return new SessionHostManagementUpdateStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + private SessionHostManagementsUpdateStatusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostOperationsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostOperationsClientImpl.java new file mode 100644 index 000000000000..6eb7e94af609 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostOperationsClientImpl.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostOperationsClient; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SessionHostOperationsClient. + */ +public final class SessionHostOperationsClientImpl implements SessionHostOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SessionHostOperationsService service; + + /** + * The service client containing this operation class. + */ + private final DesktopVirtualizationApiClientImpl client; + + /** + * Initializes an instance of SessionHostOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SessionHostOperationsClientImpl(DesktopVirtualizationApiClientImpl client) { + this.service = RestProxy.create(SessionHostOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DesktopVirtualizationApiClientSessionHostOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DesktopVirtualizatio") + public interface SessionHostOperationsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/retryProvisioning") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> retryProvisioning(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("sessionHostName") String sessionHostname, @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retry provisioning on a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostname The name of the session host within the specified host pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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) + public Mono> retryProvisioningWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + if (sessionHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionHostname is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.retryProvisioning(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retry provisioning on a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostname The name of the session host within the specified host pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> retryProvisioningWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + if (sessionHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionHostname is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.retryProvisioning(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, accept, context); + } + + /** + * Retry provisioning on a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostname The name of the session host within the specified host pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + public Mono retryProvisioningAsync(String resourceGroupName, String hostPoolName, String sessionHostname) { + return retryProvisioningWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Retry provisioning on a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostname The name of the session host within the specified host pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response retryProvisioningWithResponse(String resourceGroupName, String hostPoolName, + String sessionHostname, Context context) { + return retryProvisioningWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, context).block(); + } + + /** + * Retry provisioning on a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostname The name of the session host within the specified host pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 retryProvisioning(String resourceGroupName, String hostPoolName, String sessionHostname) { + retryProvisioningWithResponse(resourceGroupName, hostPoolName, sessionHostname, Context.NONE); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostOperationsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostOperationsImpl.java new file mode 100644 index 000000000000..50dff5412509 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostOperationsImpl.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostOperationsClient; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostOperations; + +public final class SessionHostOperationsImpl implements SessionHostOperations { + private static final ClientLogger LOGGER = new ClientLogger(SessionHostOperationsImpl.class); + + private final SessionHostOperationsClient innerClient; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + public SessionHostOperationsImpl(SessionHostOperationsClient innerClient, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response retryProvisioningWithResponse(String resourceGroupName, String hostPoolName, + String sessionHostname, Context context) { + return this.serviceClient() + .retryProvisioningWithResponse(resourceGroupName, hostPoolName, sessionHostname, context); + } + + public void retryProvisioning(String resourceGroupName, String hostPoolName, String sessionHostname) { + this.serviceClient().retryProvisioning(resourceGroupName, hostPoolName, sessionHostname); + } + + private SessionHostOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsClientImpl.java index b9a03129f802..77716daaf4b1 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsClientImpl.java @@ -105,7 +105,8 @@ Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); + @QueryParam("initialSkip") Integer initialSkip, @QueryParam("vmPath") String vmPath, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -538,6 +539,7 @@ public SessionHostInner update(String resourceGroupName, String hostPoolName, St * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. + * @param vmPath The path to the VM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -545,7 +547,7 @@ public SessionHostInner update(String resourceGroupName, String hostPoolName, St */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, - Integer pageSize, Boolean isDescending, Integer initialSkip) { + Integer pageSize, Boolean isDescending, Integer initialSkip, String vmPath) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -565,7 +567,7 @@ private Mono> listSinglePageAsync(String resourc return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, - accept, context)) + vmPath, 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())); @@ -579,6 +581,7 @@ private Mono> listSinglePageAsync(String resourc * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. + * @param vmPath The path to the VM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -587,7 +590,7 @@ private Mono> listSinglePageAsync(String resourc */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + Integer pageSize, Boolean isDescending, Integer initialSkip, String vmPath, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -607,7 +610,7 @@ private Mono> listSinglePageAsync(String resourc context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, accept, context) + resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, vmPath, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -620,6 +623,7 @@ private Mono> listSinglePageAsync(String resourc * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. + * @param vmPath The path to the VM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -627,9 +631,9 @@ private Mono> listSinglePageAsync(String resourc */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip) { + Boolean isDescending, Integer initialSkip, String vmPath) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), + () -> listSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, vmPath), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -648,8 +652,9 @@ public PagedFlux listAsync(String resourceGroupName, String ho final Integer pageSize = null; final Boolean isDescending = null; final Integer initialSkip = null; + final String vmPath = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), + () -> listSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, vmPath), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -661,6 +666,7 @@ public PagedFlux listAsync(String resourceGroupName, String ho * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. + * @param vmPath The path to the VM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -669,10 +675,9 @@ public PagedFlux listAsync(String resourceGroupName, String ho */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + Boolean isDescending, Integer initialSkip, String vmPath, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, + initialSkip, vmPath, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -690,7 +695,9 @@ public PagedIterable list(String resourceGroupName, String hos final Integer pageSize = null; final Boolean isDescending = null; final Integer initialSkip = null; - return new PagedIterable<>(listAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip)); + final String vmPath = null; + return new PagedIterable<>( + listAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, vmPath)); } /** @@ -701,6 +708,7 @@ public PagedIterable list(String resourceGroupName, String hos * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. + * @param vmPath The path to the VM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -709,9 +717,9 @@ public PagedIterable list(String resourceGroupName, String hos */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context) { + Boolean isDescending, Integer initialSkip, String vmPath, Context context) { return new PagedIterable<>( - listAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context)); + listAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, vmPath, context)); } /** diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsImpl.java index 221be96abcf5..2f276d4273f6 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsImpl.java @@ -86,9 +86,9 @@ public PagedIterable list(String resourceGroupName, String hostPool } public PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context); + Boolean isDescending, Integer initialSkip, String vmPath, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, vmPath, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionHostImpl(inner1, this.manager())); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspaceImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspaceImpl.java index dc51afb0b309..aceb0273c0fb 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspaceImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspaceImpl.java @@ -8,11 +8,11 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.WorkspaceInner; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedServiceIdentity; +import com.azure.resourcemanager.desktopvirtualization.models.Plan; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; import com.azure.resourcemanager.desktopvirtualization.models.PublicNetworkAccess; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku; +import com.azure.resourcemanager.desktopvirtualization.models.Sku; import com.azure.resourcemanager.desktopvirtualization.models.Workspace; import com.azure.resourcemanager.desktopvirtualization.models.WorkspacePatch; import java.util.Collections; @@ -61,15 +61,15 @@ public String etag() { return this.innerModel().etag(); } - public ResourceModelWithAllowedPropertySetIdentity identity() { + public ManagedServiceIdentity identity() { return this.innerModel().identity(); } - public ResourceModelWithAllowedPropertySetSku sku() { + public Sku sku() { return this.innerModel().sku(); } - public ResourceModelWithAllowedPropertySetPlan plan() { + public Plan plan() { return this.innerModel().plan(); } @@ -244,17 +244,17 @@ public WorkspaceImpl withKind(String kind) { return this; } - public WorkspaceImpl withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { + public WorkspaceImpl withIdentity(ManagedServiceIdentity identity) { this.innerModel().withIdentity(identity); return this; } - public WorkspaceImpl withSku(ResourceModelWithAllowedPropertySetSku sku) { + public WorkspaceImpl withSku(Sku sku) { this.innerModel().withSku(sku); return this; } - public WorkspaceImpl withPlan(ResourceModelWithAllowedPropertySetPlan plan) { + public WorkspaceImpl withPlan(Plan plan) { this.innerModel().withPlan(plan); return this; } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveDirectoryInfoPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveDirectoryInfoPatchProperties.java new file mode 100644 index 000000000000..65c7a0de4576 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveDirectoryInfoPatchProperties.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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; + +/** + * Active directory info. Only one should be populated based on the join type. + */ +@Fluent +public final class ActiveDirectoryInfoPatchProperties implements JsonSerializable { + /* + * Credentials needed to create the virtual machine. + */ + private KeyVaultCredentialsPatchProperties domainCredentials; + + /** + * Creates an instance of ActiveDirectoryInfoPatchProperties class. + */ + public ActiveDirectoryInfoPatchProperties() { + } + + /** + * Get the domainCredentials property: Credentials needed to create the virtual machine. + * + * @return the domainCredentials value. + */ + public KeyVaultCredentialsPatchProperties domainCredentials() { + return this.domainCredentials; + } + + /** + * Set the domainCredentials property: Credentials needed to create the virtual machine. + * + * @param domainCredentials the domainCredentials value to set. + * @return the ActiveDirectoryInfoPatchProperties object itself. + */ + public ActiveDirectoryInfoPatchProperties + withDomainCredentials(KeyVaultCredentialsPatchProperties domainCredentials) { + this.domainCredentials = domainCredentials; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (domainCredentials() != null) { + domainCredentials().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("domainCredentials", this.domainCredentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActiveDirectoryInfoPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActiveDirectoryInfoPatchProperties 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 ActiveDirectoryInfoPatchProperties. + */ + public static ActiveDirectoryInfoPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActiveDirectoryInfoPatchProperties deserializedActiveDirectoryInfoPatchProperties + = new ActiveDirectoryInfoPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("domainCredentials".equals(fieldName)) { + deserializedActiveDirectoryInfoPatchProperties.domainCredentials + = KeyVaultCredentialsPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedActiveDirectoryInfoPatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveDirectoryInfoProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveDirectoryInfoProperties.java new file mode 100644 index 000000000000..6c8590d91208 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveDirectoryInfoProperties.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Active directory info. Only one should be populated based on the join type. + */ +@Fluent +public final class ActiveDirectoryInfoProperties implements JsonSerializable { + /* + * Credentials needed to create the virtual machine. + */ + private KeyVaultCredentialsProperties domainCredentials; + + /* + * The organizational unit(OU) path. + */ + private String ouPath; + + /* + * The domain a virtual machine connected to a hostpool will join. + */ + private String domainName; + + /** + * Creates an instance of ActiveDirectoryInfoProperties class. + */ + public ActiveDirectoryInfoProperties() { + } + + /** + * Get the domainCredentials property: Credentials needed to create the virtual machine. + * + * @return the domainCredentials value. + */ + public KeyVaultCredentialsProperties domainCredentials() { + return this.domainCredentials; + } + + /** + * Set the domainCredentials property: Credentials needed to create the virtual machine. + * + * @param domainCredentials the domainCredentials value to set. + * @return the ActiveDirectoryInfoProperties object itself. + */ + public ActiveDirectoryInfoProperties withDomainCredentials(KeyVaultCredentialsProperties domainCredentials) { + this.domainCredentials = domainCredentials; + return this; + } + + /** + * Get the ouPath property: The organizational unit(OU) path. + * + * @return the ouPath value. + */ + public String ouPath() { + return this.ouPath; + } + + /** + * Set the ouPath property: The organizational unit(OU) path. + * + * @param ouPath the ouPath value to set. + * @return the ActiveDirectoryInfoProperties object itself. + */ + public ActiveDirectoryInfoProperties withOuPath(String ouPath) { + this.ouPath = ouPath; + return this; + } + + /** + * Get the domainName property: The domain a virtual machine connected to a hostpool will join. + * + * @return the domainName value. + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the domainName property: The domain a virtual machine connected to a hostpool will join. + * + * @param domainName the domainName value to set. + * @return the ActiveDirectoryInfoProperties object itself. + */ + public ActiveDirectoryInfoProperties withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (domainCredentials() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property domainCredentials in model ActiveDirectoryInfoProperties")); + } else { + domainCredentials().validate(); + } + if (ouPath() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ouPath in model ActiveDirectoryInfoProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ActiveDirectoryInfoProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("domainCredentials", this.domainCredentials); + jsonWriter.writeStringField("ouPath", this.ouPath); + jsonWriter.writeStringField("domainName", this.domainName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActiveDirectoryInfoProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActiveDirectoryInfoProperties 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 ActiveDirectoryInfoProperties. + */ + public static ActiveDirectoryInfoProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActiveDirectoryInfoProperties deserializedActiveDirectoryInfoProperties + = new ActiveDirectoryInfoProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("domainCredentials".equals(fieldName)) { + deserializedActiveDirectoryInfoProperties.domainCredentials + = KeyVaultCredentialsProperties.fromJson(reader); + } else if ("ouPath".equals(fieldName)) { + deserializedActiveDirectoryInfoProperties.ouPath = reader.getString(); + } else if ("domainName".equals(fieldName)) { + deserializedActiveDirectoryInfoProperties.domainName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedActiveDirectoryInfoProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveSessionHostConfiguration.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveSessionHostConfiguration.java new file mode 100644 index 000000000000..f4562058efcd --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveSessionHostConfiguration.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.ActiveSessionHostConfigurationInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of ActiveSessionHostConfiguration. + */ +public interface ActiveSessionHostConfiguration { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the version property: The timestamp of the last update. + * + * @return the version value. + */ + OffsetDateTime version(); + + /** + * Gets the friendlyName property: Friendly name to describe this version of the SessionHostConfiguration. + * + * @return the friendlyName value. + */ + String friendlyName(); + + /** + * Gets the vmTags property: Hashtable that lists key/value pair tags to apply to the VMs. + * + * @return the vmTags value. + */ + Map vmTags(); + + /** + * Gets the vmLocation property: The Location for the session host to be created in. It will default to the location + * of the hostpool if not provided. + * + * @return the vmLocation value. + */ + String vmLocation(); + + /** + * Gets the vmResourceGroup property: The ResourceGroup for the session hosts to be created in. It will default to + * the ResourceGroup of the hostpool if not provided. + * + * @return the vmResourceGroup value. + */ + String vmResourceGroup(); + + /** + * Gets the vmNamePrefix property: The prefix that should be associated with session host names. + * + * @return the vmNamePrefix value. + */ + String vmNamePrefix(); + + /** + * Gets the availabilityZones property: Value for availability zones to be used by the session host. Should be from + * [1,2,3]. + * + * @return the availabilityZones value. + */ + List availabilityZones(); + + /** + * Gets the networkInfo property: Network information. + * + * @return the networkInfo value. + */ + NetworkInfoProperties networkInfo(); + + /** + * Gets the vmSizeId property: The id of the size of a virtual machine connected to a hostpool. Example: + * Standard_D2as_v6. + * + * @return the vmSizeId value. + */ + String vmSizeId(); + + /** + * Gets the diskInfo property: Disk information. + * + * @return the diskInfo value. + */ + DiskInfoProperties diskInfo(); + + /** + * Gets the customConfigurationScriptUrl property: The uri to the storage blob containing the arm template to be run + * on the virtual machine after provisioning. + * + * @return the customConfigurationScriptUrl value. + */ + String customConfigurationScriptUrl(); + + /** + * Gets the imageInfo property: Image configurations of HostPool. + * + * @return the imageInfo value. + */ + ImageInfoProperties imageInfo(); + + /** + * Gets the domainInfo property: Domain configurations of session hosts. + * + * @return the domainInfo value. + */ + DomainInfoProperties domainInfo(); + + /** + * Gets the securityInfo property: Security information. + * + * @return the securityInfo value. + */ + SecurityInfoProperties securityInfo(); + + /** + * Gets the vmAdminCredentials property: Local Admin credentials for session hosts. + * + * @return the vmAdminCredentials value. + */ + KeyVaultCredentialsProperties vmAdminCredentials(); + + /** + * Gets the bootDiagnosticsInfo property: Boot Diagnostics information. + * + * @return the bootDiagnosticsInfo value. + */ + BootDiagnosticsInfoProperties bootDiagnosticsInfo(); + + /** + * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.ActiveSessionHostConfigurationInner + * object. + * + * @return the inner object. + */ + ActiveSessionHostConfigurationInner innerModel(); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveSessionHostConfigurationList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveSessionHostConfigurationList.java new file mode 100644 index 000000000000..e3c9bddd4676 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveSessionHostConfigurationList.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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 com.azure.resourcemanager.desktopvirtualization.fluent.models.ActiveSessionHostConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * ActiveSessionHostConfigurationList + * + * List of ActiveSessionHostConfiguration definitions. + */ +@Fluent +public final class ActiveSessionHostConfigurationList implements JsonSerializable { + /* + * List of ActiveSessionHostConfiguration definitions. + */ + private List value; + + /* + * Link to the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of ActiveSessionHostConfigurationList class. + */ + public ActiveSessionHostConfigurationList() { + } + + /** + * Get the value property: List of ActiveSessionHostConfiguration definitions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of ActiveSessionHostConfiguration definitions. + * + * @param value the value value to set. + * @return the ActiveSessionHostConfigurationList object itself. + */ + public ActiveSessionHostConfigurationList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActiveSessionHostConfigurationList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActiveSessionHostConfigurationList 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 ActiveSessionHostConfigurationList. + */ + public static ActiveSessionHostConfigurationList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActiveSessionHostConfigurationList deserializedActiveSessionHostConfigurationList + = new ActiveSessionHostConfigurationList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ActiveSessionHostConfigurationInner.fromJson(reader1)); + deserializedActiveSessionHostConfigurationList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedActiveSessionHostConfigurationList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedActiveSessionHostConfigurationList; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveSessionHostConfigurations.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveSessionHostConfigurations.java new file mode 100644 index 000000000000..51f41834e19c --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveSessionHostConfigurations.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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 ActiveSessionHostConfigurations. + */ +public interface ActiveSessionHostConfigurations { + /** + * Get the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations + * along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context); + + /** + * Get the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations. + */ + ActiveSessionHostConfiguration get(String resourceGroupName, String hostPoolName); + + /** + * List activeSessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return activeSessionHostConfigurationList as paginated response with {@link PagedIterable}. + */ + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); + + /** + * List activeSessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return activeSessionHostConfigurationList as paginated response with {@link PagedIterable}. + */ + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Context context); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackage.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackage.java index 5c13080c7a84..b24fd3abfce8 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackage.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackage.java @@ -200,7 +200,7 @@ interface WithTags { /** * The template for AppAttachPackage update. */ - interface Update extends UpdateStages.WithProperties { + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { /** * Executes the update request. * @@ -221,6 +221,19 @@ interface Update extends UpdateStages.WithProperties { * The AppAttachPackage update stages. */ interface UpdateStages { + /** + * The stage of the AppAttachPackage update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: tags to be updated. + * + * @param tags tags to be updated. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** * The stage of the AppAttachPackage update allowing to specify properties. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageInfoProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageInfoProperties.java index 2e6acbe77ee2..a7e0de3800de 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageInfoProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageInfoProperties.java @@ -26,7 +26,7 @@ public final class AppAttachPackageInfoProperties implements JsonSerializable packageDependencies; /* - * Package version found in the appxmanifest.xml. + * Package Version found in the appxmanifest.xml. */ private String version; /* - * Date Package was last updated, found in the appxmanifest.xml. + * Date the package source was last updated, for Msix packages this is found in the appxmanifest.xml. */ private OffsetDateTime lastUpdated; @@ -127,7 +127,7 @@ public AppAttachPackageInfoProperties withPackageAlias(String packageAlias) { } /** - * Get the imagePath property: VHD/CIM image path on Network Share. + * Get the imagePath property: VHD/CIM/APP-V image path on Network Share. * * @return the imagePath value. */ @@ -136,7 +136,7 @@ public String imagePath() { } /** - * Set the imagePath property: VHD/CIM image path on Network Share. + * Set the imagePath property: VHD/CIM/APP-V image path on Network Share. * * @param imagePath the imagePath value to set. * @return the AppAttachPackageInfoProperties object itself. @@ -167,8 +167,8 @@ public AppAttachPackageInfoProperties withPackageName(String packageName) { } /** - * Get the packageFamilyName property: Package Family Name from appxmanifest.xml. Contains Package Name and - * Publisher name. + * Get the packageFamilyName property: Identifier not including the package version, for Msix packages it is the + * family name from the appxmanifest.xml. * * @return the packageFamilyName value. */ @@ -177,8 +177,8 @@ public String packageFamilyName() { } /** - * Set the packageFamilyName property: Package Family Name from appxmanifest.xml. Contains Package Name and - * Publisher name. + * Set the packageFamilyName property: Identifier not including the package version, for Msix packages it is the + * family name from the appxmanifest.xml. * * @param packageFamilyName the packageFamilyName value to set. * @return the AppAttachPackageInfoProperties object itself. @@ -189,7 +189,8 @@ public AppAttachPackageInfoProperties withPackageFamilyName(String packageFamily } /** - * Get the packageFullName property: Package Full Name from appxmanifest.xml. + * Get the packageFullName property: Identifier including the package version, for Msix packages it is the full name + * from the appxmanifest.xml. * * @return the packageFullName value. */ @@ -198,7 +199,8 @@ public String packageFullName() { } /** - * Set the packageFullName property: Package Full Name from appxmanifest.xml. + * Set the packageFullName property: Identifier including the package version, for Msix packages it is the full name + * from the appxmanifest.xml. * * @param packageFullName the packageFullName value to set. * @return the AppAttachPackageInfoProperties object itself. @@ -309,7 +311,7 @@ public AppAttachPackageInfoProperties withPackageDependencies(List tags; + /* * Detailed properties for App Attach Package */ @@ -48,6 +54,26 @@ public final class AppAttachPackagePatch extends ProxyResource { public AppAttachPackagePatch() { } + /** + * Get the tags property: tags to be updated. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: tags to be updated. + * + * @param tags the tags value to set. + * @return the AppAttachPackagePatch object itself. + */ + public AppAttachPackagePatch withTags(Map tags) { + this.tags = tags; + return this; + } + /** * Get the properties property: Detailed properties for App Attach Package. * @@ -124,6 +150,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -150,6 +177,9 @@ public static AppAttachPackagePatch fromJson(JsonReader jsonReader) throws IOExc deserializedAppAttachPackagePatch.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedAppAttachPackagePatch.type = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAppAttachPackagePatch.tags = tags; } else if ("properties".equals(fieldName)) { deserializedAppAttachPackagePatch.properties = AppAttachPackagePatchProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackagePatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackagePatchProperties.java index c19158727da9..3d26be4fe6e7 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackagePatchProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackagePatchProperties.java @@ -28,7 +28,7 @@ public final class AppAttachPackagePatchProperties implements JsonSerializable hostPoolReferences; /* - * URL path to certificate name located in keyVault + * URL of keyvault location to store certificate */ private String keyVaultUrl; @@ -37,6 +37,16 @@ public final class AppAttachPackagePatchProperties implements JsonSerializable hostP } /** - * Get the keyVaultUrl property: URL path to certificate name located in keyVault. + * Get the keyVaultUrl property: URL of keyvault location to store certificate. * * @return the keyVaultUrl value. */ @@ -93,7 +103,7 @@ public String keyVaultUrl() { } /** - * Set the keyVaultUrl property: URL path to certificate name located in keyVault. + * Set the keyVaultUrl property: URL of keyvault location to store certificate. * * @param keyVaultUrl the keyVaultUrl value to set. * @return the AppAttachPackagePatchProperties object itself. @@ -126,6 +136,48 @@ public FailHealthCheckOnStagingFailure failHealthCheckOnStagingFailure() { return this; } + /** + * Get the packageLookbackUrl property: Lookback url to third party control plane, should be null for first party + * packages. + * + * @return the packageLookbackUrl value. + */ + public String packageLookbackUrl() { + return this.packageLookbackUrl; + } + + /** + * Set the packageLookbackUrl property: Lookback url to third party control plane, should be null for first party + * packages. + * + * @param packageLookbackUrl the packageLookbackUrl value to set. + * @return the AppAttachPackagePatchProperties object itself. + */ + public AppAttachPackagePatchProperties withPackageLookbackUrl(String packageLookbackUrl) { + this.packageLookbackUrl = packageLookbackUrl; + return this; + } + + /** + * Get the customData property: Field that can be populated with custom data and filtered on in list GET calls. + * + * @return the customData value. + */ + public String customData() { + return this.customData; + } + + /** + * Set the customData property: Field that can be populated with custom data and filtered on in list GET calls. + * + * @param customData the customData value to set. + * @return the AppAttachPackagePatchProperties object itself. + */ + public AppAttachPackagePatchProperties withCustomData(String customData) { + this.customData = customData; + return this; + } + /** * Validates the instance. * @@ -149,6 +201,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("keyVaultURL", this.keyVaultUrl); jsonWriter.writeStringField("failHealthCheckOnStagingFailure", this.failHealthCheckOnStagingFailure == null ? null : this.failHealthCheckOnStagingFailure.toString()); + jsonWriter.writeStringField("packageLookbackUrl", this.packageLookbackUrl); + jsonWriter.writeStringField("customData", this.customData); return jsonWriter.writeEndObject(); } @@ -178,6 +232,10 @@ public static AppAttachPackagePatchProperties fromJson(JsonReader jsonReader) th } else if ("failHealthCheckOnStagingFailure".equals(fieldName)) { deserializedAppAttachPackagePatchProperties.failHealthCheckOnStagingFailure = FailHealthCheckOnStagingFailure.fromString(reader.getString()); + } else if ("packageLookbackUrl".equals(fieldName)) { + deserializedAppAttachPackagePatchProperties.packageLookbackUrl = reader.getString(); + } else if ("customData".equals(fieldName)) { + deserializedAppAttachPackagePatchProperties.customData = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageProperties.java index 9cfcd7110011..167f0dd225df 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageProperties.java @@ -33,7 +33,7 @@ public final class AppAttachPackageProperties implements JsonSerializable hostPoolReferences; /* - * URL path to certificate name located in keyVault + * URL of keyvault location to store certificate */ private String keyVaultUrl; @@ -42,6 +42,21 @@ public final class AppAttachPackageProperties implements JsonSerializable hostPoolRe } /** - * Get the keyVaultUrl property: URL path to certificate name located in keyVault. + * Get the keyVaultUrl property: URL of keyvault location to store certificate. * * @return the keyVaultUrl value. */ @@ -107,7 +122,7 @@ public String keyVaultUrl() { } /** - * Set the keyVaultUrl property: URL path to certificate name located in keyVault. + * Set the keyVaultUrl property: URL of keyvault location to store certificate. * * @param keyVaultUrl the keyVaultUrl value to set. * @return the AppAttachPackageProperties object itself. @@ -140,6 +155,68 @@ public FailHealthCheckOnStagingFailure failHealthCheckOnStagingFailure() { return this; } + /** + * Get the packageOwnerName property: Specific name of package owner, is "AppAttach" for native app attach packages. + * + * @return the packageOwnerName value. + */ + public String packageOwnerName() { + return this.packageOwnerName; + } + + /** + * Set the packageOwnerName property: Specific name of package owner, is "AppAttach" for native app attach packages. + * + * @param packageOwnerName the packageOwnerName value to set. + * @return the AppAttachPackageProperties object itself. + */ + public AppAttachPackageProperties withPackageOwnerName(String packageOwnerName) { + this.packageOwnerName = packageOwnerName; + return this; + } + + /** + * Get the packageLookbackUrl property: Lookback url to third party control plane, is null for native app attach + * packages. + * + * @return the packageLookbackUrl value. + */ + public String packageLookbackUrl() { + return this.packageLookbackUrl; + } + + /** + * Set the packageLookbackUrl property: Lookback url to third party control plane, is null for native app attach + * packages. + * + * @param packageLookbackUrl the packageLookbackUrl value to set. + * @return the AppAttachPackageProperties object itself. + */ + public AppAttachPackageProperties withPackageLookbackUrl(String packageLookbackUrl) { + this.packageLookbackUrl = packageLookbackUrl; + return this; + } + + /** + * Get the customData property: Field that can be populated with custom data and filtered on in list GET calls. + * + * @return the customData value. + */ + public String customData() { + return this.customData; + } + + /** + * Set the customData property: Field that can be populated with custom data and filtered on in list GET calls. + * + * @param customData the customData value to set. + * @return the AppAttachPackageProperties object itself. + */ + public AppAttachPackageProperties withCustomData(String customData) { + this.customData = customData; + return this; + } + /** * Validates the instance. * @@ -163,6 +240,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("keyVaultURL", this.keyVaultUrl); jsonWriter.writeStringField("failHealthCheckOnStagingFailure", this.failHealthCheckOnStagingFailure == null ? null : this.failHealthCheckOnStagingFailure.toString()); + jsonWriter.writeStringField("packageOwnerName", this.packageOwnerName); + jsonWriter.writeStringField("packageLookbackUrl", this.packageLookbackUrl); + jsonWriter.writeStringField("customData", this.customData); return jsonWriter.writeEndObject(); } @@ -194,6 +274,12 @@ public static AppAttachPackageProperties fromJson(JsonReader jsonReader) throws } else if ("failHealthCheckOnStagingFailure".equals(fieldName)) { deserializedAppAttachPackageProperties.failHealthCheckOnStagingFailure = FailHealthCheckOnStagingFailure.fromString(reader.getString()); + } else if ("packageOwnerName".equals(fieldName)) { + deserializedAppAttachPackageProperties.packageOwnerName = reader.getString(); + } else if ("packageLookbackUrl".equals(fieldName)) { + deserializedAppAttachPackageProperties.packageLookbackUrl = reader.getString(); + } else if ("customData".equals(fieldName)) { + deserializedAppAttachPackageProperties.customData = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackages.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackages.java index 3e7f0b94f613..3e2eaad7966a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackages.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackages.java @@ -16,7 +16,7 @@ public interface AppAttachPackages { * Get an app attach package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -30,7 +30,7 @@ Response getByResourceGroupWithResponse(String resourceGroupNa * Get an app attach package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -42,26 +42,27 @@ Response getByResourceGroupWithResponse(String resourceGroupNa * Remove an App Attach Package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. + * @param force Force flag to delete App Attach package. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteByResourceGroupWithResponse(String resourceGroupName, String appAttachPackageName, + Response deleteWithResponse(String resourceGroupName, String appAttachPackageName, Boolean force, Context context); /** * Remove an App Attach Package. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackageName The name of the App Attach package arm object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deleteByResourceGroup(String resourceGroupName, String appAttachPackageName); + void delete(String resourceGroupName, String appAttachPackageName); /** * List App Attach packages in resource group. @@ -78,7 +79,8 @@ Response deleteByResourceGroupWithResponse(String resourceGroupName, Strin * List App Attach packages in resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter expression. Valid properties for filtering are package name and host pool. + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, package owner + * name, and custom data. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -99,8 +101,8 @@ Response deleteByResourceGroupWithResponse(String resourceGroupName, Strin /** * List App Attach packages in subscription. * - * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and resource - * group. + * @param filter OData filter expression. Valid properties for filtering are package name, resource group, host + * pool, package owner name, and custom data. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -146,13 +148,14 @@ Response deleteByResourceGroupWithResponse(String resourceGroupName, Strin * Remove an App Attach Package. * * @param id the resource ID. + * @param force Force flag to delete App Attach package. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteByIdWithResponse(String id, Context context); + Response deleteByIdWithResponse(String id, Boolean force, Context context); /** * Begins definition for a new AppAttachPackage resource. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroup.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroup.java index b065e3f9f667..b3c2945fe4d2 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroup.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroup.java @@ -78,25 +78,25 @@ public interface ApplicationGroup { String etag(); /** - * Gets the identity property: The identity property. + * Gets the identity property: Managed service identity (system assigned and/or user assigned identities). * * @return the identity value. */ - ResourceModelWithAllowedPropertySetIdentity identity(); + ManagedServiceIdentity identity(); /** - * Gets the sku property: The sku property. + * Gets the sku property: The resource model definition representing SKU. * * @return the sku value. */ - ResourceModelWithAllowedPropertySetSku sku(); + Sku sku(); /** - * Gets the plan property: The plan property. + * Gets the plan property: Plan for the resource. * * @return the plan value. */ - ResourceModelWithAllowedPropertySetPlan plan(); + Plan plan(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -344,12 +344,13 @@ interface WithKind { */ interface WithIdentity { /** - * Specifies the identity property: The identity property.. + * Specifies the identity property: Managed service identity (system assigned and/or user assigned + * identities). * - * @param identity The identity property. + * @param identity Managed service identity (system assigned and/or user assigned identities). * @return the next definition stage. */ - WithCreate withIdentity(ResourceModelWithAllowedPropertySetIdentity identity); + WithCreate withIdentity(ManagedServiceIdentity identity); } /** @@ -357,12 +358,12 @@ interface WithIdentity { */ interface WithSku { /** - * Specifies the sku property: The sku property.. + * Specifies the sku property: The resource model definition representing SKU. * - * @param sku The sku property. + * @param sku The resource model definition representing SKU. * @return the next definition stage. */ - WithCreate withSku(ResourceModelWithAllowedPropertySetSku sku); + WithCreate withSku(Sku sku); } /** @@ -370,12 +371,12 @@ interface WithSku { */ interface WithPlan { /** - * Specifies the plan property: The plan property.. + * Specifies the plan property: Plan for the resource.. * - * @param plan The plan property. + * @param plan Plan for the resource. * @return the next definition stage. */ - WithCreate withPlan(ResourceModelWithAllowedPropertySetPlan plan); + WithCreate withPlan(Plan plan); } /** diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AzureActiveDirectoryInfoProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AzureActiveDirectoryInfoProperties.java new file mode 100644 index 000000000000..27b9ff013664 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AzureActiveDirectoryInfoProperties.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Azure Active directory info. Only one should be populated based on the join type. + */ +@Fluent +public final class AzureActiveDirectoryInfoProperties implements JsonSerializable { + /* + * The Mobile Device Management(MDM) guid. + */ + private String mdmProviderGuid; + + /** + * Creates an instance of AzureActiveDirectoryInfoProperties class. + */ + public AzureActiveDirectoryInfoProperties() { + } + + /** + * Get the mdmProviderGuid property: The Mobile Device Management(MDM) guid. + * + * @return the mdmProviderGuid value. + */ + public String mdmProviderGuid() { + return this.mdmProviderGuid; + } + + /** + * Set the mdmProviderGuid property: The Mobile Device Management(MDM) guid. + * + * @param mdmProviderGuid the mdmProviderGuid value to set. + * @return the AzureActiveDirectoryInfoProperties object itself. + */ + public AzureActiveDirectoryInfoProperties withMdmProviderGuid(String mdmProviderGuid) { + this.mdmProviderGuid = mdmProviderGuid; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (mdmProviderGuid() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property mdmProviderGuid in model AzureActiveDirectoryInfoProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureActiveDirectoryInfoProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mdmProviderGuid", this.mdmProviderGuid); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureActiveDirectoryInfoProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureActiveDirectoryInfoProperties 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 AzureActiveDirectoryInfoProperties. + */ + public static AzureActiveDirectoryInfoProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureActiveDirectoryInfoProperties deserializedAzureActiveDirectoryInfoProperties + = new AzureActiveDirectoryInfoProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mdmProviderGuid".equals(fieldName)) { + deserializedAzureActiveDirectoryInfoProperties.mdmProviderGuid = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureActiveDirectoryInfoProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/BootDiagnosticsInfoPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/BootDiagnosticsInfoPatchProperties.java new file mode 100644 index 000000000000..ae96759dff6e --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/BootDiagnosticsInfoPatchProperties.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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. + * <br><br> You can easily view the output of your console log. <br><br> Azure also enables you + * to see a screenshot of the VM from the hypervisor. + */ +@Fluent +public final class BootDiagnosticsInfoPatchProperties 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 BootDiagnosticsInfoPatchProperties class. + */ + public BootDiagnosticsInfoPatchProperties() { + } + + /** + * 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 BootDiagnosticsInfoPatchProperties object itself. + */ + public BootDiagnosticsInfoPatchProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the storageUri property: Uri of the storage account to use for placing the console output and screenshot. + * <br><br>If storageUri is not specified while enabling boot diagnostics, managed storage will be used. + * + * @return the storageUri value. + */ + public String storageUri() { + return this.storageUri; + } + + /** + * Set the storageUri property: Uri of the storage account to use for placing the console output and screenshot. + * <br><br>If storageUri is not specified while enabling boot diagnostics, managed storage will be used. + * + * @param storageUri the storageUri value to set. + * @return the BootDiagnosticsInfoPatchProperties object itself. + */ + public BootDiagnosticsInfoPatchProperties withStorageUri(String storageUri) { + this.storageUri = storageUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@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 BootDiagnosticsInfoPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BootDiagnosticsInfoPatchProperties 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 BootDiagnosticsInfoPatchProperties. + */ + public static BootDiagnosticsInfoPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BootDiagnosticsInfoPatchProperties deserializedBootDiagnosticsInfoPatchProperties + = new BootDiagnosticsInfoPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedBootDiagnosticsInfoPatchProperties.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("storageUri".equals(fieldName)) { + deserializedBootDiagnosticsInfoPatchProperties.storageUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBootDiagnosticsInfoPatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/BootDiagnosticsInfoProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/BootDiagnosticsInfoProperties.java new file mode 100644 index 000000000000..1b9371b5673c --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/BootDiagnosticsInfoProperties.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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. + * <br><br> You can easily view the output of your console log. <br><br> Azure also enables you + * to see a screenshot of the VM from the hypervisor. + */ +@Fluent +public final class BootDiagnosticsInfoProperties 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 BootDiagnosticsInfoProperties class. + */ + public BootDiagnosticsInfoProperties() { + } + + /** + * 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 BootDiagnosticsInfoProperties object itself. + */ + public BootDiagnosticsInfoProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the storageUri property: Uri of the storage account to use for placing the console output and screenshot. + * <br><br>If storageUri is not specified while enabling boot diagnostics, managed storage will be used. + * + * @return the storageUri value. + */ + public String storageUri() { + return this.storageUri; + } + + /** + * Set the storageUri property: Uri of the storage account to use for placing the console output and screenshot. + * <br><br>If storageUri is not specified while enabling boot diagnostics, managed storage will be used. + * + * @param storageUri the storageUri value to set. + * @return the BootDiagnosticsInfoProperties object itself. + */ + public BootDiagnosticsInfoProperties withStorageUri(String storageUri) { + this.storageUri = storageUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@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 BootDiagnosticsInfoProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BootDiagnosticsInfoProperties 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 BootDiagnosticsInfoProperties. + */ + public static BootDiagnosticsInfoProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BootDiagnosticsInfoProperties deserializedBootDiagnosticsInfoProperties + = new BootDiagnosticsInfoProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedBootDiagnosticsInfoProperties.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("storageUri".equals(fieldName)) { + deserializedBootDiagnosticsInfoProperties.storageUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBootDiagnosticsInfoProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ControlSessionHostUpdates.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ControlSessionHostUpdates.java new file mode 100644 index 000000000000..4aace6d16621 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ControlSessionHostUpdates.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.Context; + +/** + * Resource collection API of ControlSessionHostUpdates. + */ +public interface ControlSessionHostUpdates { + /** + * Control update of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolUpdateControlParameter Object containing control action for hostpool update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void post(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter); + + /** + * Control update of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolUpdateControlParameter Object containing control action for hostpool update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void post(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter, Context context); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CreateDeleteProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CreateDeleteProperties.java new file mode 100644 index 000000000000..794e35a381c1 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CreateDeleteProperties.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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 properties that control how Scaling will manage the size of the hostpool by creating and deleting hosts. + */ +@Fluent +public final class CreateDeleteProperties implements JsonSerializable { + /* + * Maximum number of session hosts that may be created by the Scaling Service. This requires the assigned hostpool + * to have a session host config property. + */ + private Integer rampUpMaximumHostPoolSize; + + /* + * Minimum number of session hosts that will be be created by the Scaling Service. Scaling will not delete any hosts + * when this limit is met. This requires the assigned hostpool to have a session host config property. + */ + private Integer rampUpMinimumHostPoolSize; + + /* + * Maximum number of session hosts that may be created by the Scaling Service. This requires the assigned hostpool + * to have a session host config property. + */ + private Integer rampDownMaximumHostPoolSize; + + /* + * Minimum number of session hosts that will be be created by the Scaling Service. Scaling will not delete any hosts + * when this limit is met. This requires the assigned hostpool to have a session host config property. + */ + private Integer rampDownMinimumHostPoolSize; + + /** + * Creates an instance of CreateDeleteProperties class. + */ + public CreateDeleteProperties() { + } + + /** + * Get the rampUpMaximumHostPoolSize property: Maximum number of session hosts that may be created by the Scaling + * Service. This requires the assigned hostpool to have a session host config property. + * + * @return the rampUpMaximumHostPoolSize value. + */ + public Integer rampUpMaximumHostPoolSize() { + return this.rampUpMaximumHostPoolSize; + } + + /** + * Set the rampUpMaximumHostPoolSize property: Maximum number of session hosts that may be created by the Scaling + * Service. This requires the assigned hostpool to have a session host config property. + * + * @param rampUpMaximumHostPoolSize the rampUpMaximumHostPoolSize value to set. + * @return the CreateDeleteProperties object itself. + */ + public CreateDeleteProperties withRampUpMaximumHostPoolSize(Integer rampUpMaximumHostPoolSize) { + this.rampUpMaximumHostPoolSize = rampUpMaximumHostPoolSize; + return this; + } + + /** + * Get the rampUpMinimumHostPoolSize property: Minimum number of session hosts that will be be created by the + * Scaling Service. Scaling will not delete any hosts when this limit is met. This requires the assigned hostpool to + * have a session host config property. + * + * @return the rampUpMinimumHostPoolSize value. + */ + public Integer rampUpMinimumHostPoolSize() { + return this.rampUpMinimumHostPoolSize; + } + + /** + * Set the rampUpMinimumHostPoolSize property: Minimum number of session hosts that will be be created by the + * Scaling Service. Scaling will not delete any hosts when this limit is met. This requires the assigned hostpool to + * have a session host config property. + * + * @param rampUpMinimumHostPoolSize the rampUpMinimumHostPoolSize value to set. + * @return the CreateDeleteProperties object itself. + */ + public CreateDeleteProperties withRampUpMinimumHostPoolSize(Integer rampUpMinimumHostPoolSize) { + this.rampUpMinimumHostPoolSize = rampUpMinimumHostPoolSize; + return this; + } + + /** + * Get the rampDownMaximumHostPoolSize property: Maximum number of session hosts that may be created by the Scaling + * Service. This requires the assigned hostpool to have a session host config property. + * + * @return the rampDownMaximumHostPoolSize value. + */ + public Integer rampDownMaximumHostPoolSize() { + return this.rampDownMaximumHostPoolSize; + } + + /** + * Set the rampDownMaximumHostPoolSize property: Maximum number of session hosts that may be created by the Scaling + * Service. This requires the assigned hostpool to have a session host config property. + * + * @param rampDownMaximumHostPoolSize the rampDownMaximumHostPoolSize value to set. + * @return the CreateDeleteProperties object itself. + */ + public CreateDeleteProperties withRampDownMaximumHostPoolSize(Integer rampDownMaximumHostPoolSize) { + this.rampDownMaximumHostPoolSize = rampDownMaximumHostPoolSize; + return this; + } + + /** + * Get the rampDownMinimumHostPoolSize property: Minimum number of session hosts that will be be created by the + * Scaling Service. Scaling will not delete any hosts when this limit is met. This requires the assigned hostpool to + * have a session host config property. + * + * @return the rampDownMinimumHostPoolSize value. + */ + public Integer rampDownMinimumHostPoolSize() { + return this.rampDownMinimumHostPoolSize; + } + + /** + * Set the rampDownMinimumHostPoolSize property: Minimum number of session hosts that will be be created by the + * Scaling Service. Scaling will not delete any hosts when this limit is met. This requires the assigned hostpool to + * have a session host config property. + * + * @param rampDownMinimumHostPoolSize the rampDownMinimumHostPoolSize value to set. + * @return the CreateDeleteProperties object itself. + */ + public CreateDeleteProperties withRampDownMinimumHostPoolSize(Integer rampDownMinimumHostPoolSize) { + this.rampDownMinimumHostPoolSize = rampDownMinimumHostPoolSize; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("rampUpMaximumHostPoolSize", this.rampUpMaximumHostPoolSize); + jsonWriter.writeNumberField("rampUpMinimumHostPoolSize", this.rampUpMinimumHostPoolSize); + jsonWriter.writeNumberField("rampDownMaximumHostPoolSize", this.rampDownMaximumHostPoolSize); + jsonWriter.writeNumberField("rampDownMinimumHostPoolSize", this.rampDownMinimumHostPoolSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateDeleteProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateDeleteProperties 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 CreateDeleteProperties. + */ + public static CreateDeleteProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CreateDeleteProperties deserializedCreateDeleteProperties = new CreateDeleteProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rampUpMaximumHostPoolSize".equals(fieldName)) { + deserializedCreateDeleteProperties.rampUpMaximumHostPoolSize + = reader.getNullable(JsonReader::getInt); + } else if ("rampUpMinimumHostPoolSize".equals(fieldName)) { + deserializedCreateDeleteProperties.rampUpMinimumHostPoolSize + = reader.getNullable(JsonReader::getInt); + } else if ("rampDownMaximumHostPoolSize".equals(fieldName)) { + deserializedCreateDeleteProperties.rampDownMaximumHostPoolSize + = reader.getNullable(JsonReader::getInt); + } else if ("rampDownMinimumHostPoolSize".equals(fieldName)) { + deserializedCreateDeleteProperties.rampDownMinimumHostPoolSize + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedCreateDeleteProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CustomInfoPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CustomInfoPatchProperties.java new file mode 100644 index 000000000000..cc39dd0b2355 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CustomInfoPatchProperties.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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; + +/** + * Custom image information. + */ +@Fluent +public final class CustomInfoPatchProperties implements JsonSerializable { + /* + * The resource id of the custom image. + */ + private String resourceId; + + /** + * Creates an instance of CustomInfoPatchProperties class. + */ + public CustomInfoPatchProperties() { + } + + /** + * Get the resourceId property: The resource id of the custom image. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource id of the custom image. + * + * @param resourceId the resourceId value to set. + * @return the CustomInfoPatchProperties object itself. + */ + public CustomInfoPatchProperties withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomInfoPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomInfoPatchProperties 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 CustomInfoPatchProperties. + */ + public static CustomInfoPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomInfoPatchProperties deserializedCustomInfoPatchProperties = new CustomInfoPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedCustomInfoPatchProperties.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomInfoPatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CustomInfoProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CustomInfoProperties.java new file mode 100644 index 000000000000..bc9cdb6fddf9 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CustomInfoProperties.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Custom image information. + */ +@Fluent +public final class CustomInfoProperties implements JsonSerializable { + /* + * The resource id of the custom image. + */ + private String resourceId; + + /** + * Creates an instance of CustomInfoProperties class. + */ + public CustomInfoProperties() { + } + + /** + * Get the resourceId property: The resource id of the custom image. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource id of the custom image. + * + * @param resourceId the resourceId value to set. + * @return the CustomInfoProperties object itself. + */ + public CustomInfoProperties withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceId() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property resourceId in model CustomInfoProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomInfoProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomInfoProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomInfoProperties 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 CustomInfoProperties. + */ + public static CustomInfoProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomInfoProperties deserializedCustomInfoProperties = new CustomInfoProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedCustomInfoProperties.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomInfoProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DirectUdp.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DirectUdp.java new file mode 100644 index 000000000000..cf59ca3a9216 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DirectUdp.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection + * type when making connections. This means that this connection is possible, but is not guaranteed, as there are other + * factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making + * connections. + */ +public final class DirectUdp extends ExpandableStringEnum { + /** + * Static value Default for DirectUdp. + */ + public static final DirectUdp DEFAULT = fromString("Default"); + + /** + * Static value Enabled for DirectUdp. + */ + public static final DirectUdp ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for DirectUdp. + */ + public static final DirectUdp DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of DirectUdp value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DirectUdp() { + } + + /** + * Creates or finds a DirectUdp from its string representation. + * + * @param name a name to look for. + * @return the corresponding DirectUdp. + */ + public static DirectUdp fromString(String name) { + return fromString(name, DirectUdp.class); + } + + /** + * Gets known DirectUdp values. + * + * @return known DirectUdp values. + */ + public static Collection values() { + return values(DirectUdp.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DiskInfoPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DiskInfoPatchProperties.java new file mode 100644 index 000000000000..c225f116ce88 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DiskInfoPatchProperties.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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; + +/** + * Disk information. + */ +@Fluent +public final class DiskInfoPatchProperties implements JsonSerializable { + /* + * The disk type used by virtual machine in hostpool session host. + */ + private VirtualMachineDiskType type; + + /** + * Creates an instance of DiskInfoPatchProperties class. + */ + public DiskInfoPatchProperties() { + } + + /** + * Get the type property: The disk type used by virtual machine in hostpool session host. + * + * @return the type value. + */ + public VirtualMachineDiskType type() { + return this.type; + } + + /** + * Set the type property: The disk type used by virtual machine in hostpool session host. + * + * @param type the type value to set. + * @return the DiskInfoPatchProperties object itself. + */ + public DiskInfoPatchProperties withType(VirtualMachineDiskType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiskInfoPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiskInfoPatchProperties 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 DiskInfoPatchProperties. + */ + public static DiskInfoPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiskInfoPatchProperties deserializedDiskInfoPatchProperties = new DiskInfoPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedDiskInfoPatchProperties.type = VirtualMachineDiskType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDiskInfoPatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DiskInfoProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DiskInfoProperties.java new file mode 100644 index 000000000000..dc0083e667cc --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DiskInfoProperties.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Disk information. + */ +@Fluent +public final class DiskInfoProperties implements JsonSerializable { + /* + * The disk type used by virtual machine in hostpool session host. + */ + private VirtualMachineDiskType type; + + /** + * Creates an instance of DiskInfoProperties class. + */ + public DiskInfoProperties() { + } + + /** + * Get the type property: The disk type used by virtual machine in hostpool session host. + * + * @return the type value. + */ + public VirtualMachineDiskType type() { + return this.type; + } + + /** + * Set the type property: The disk type used by virtual machine in hostpool session host. + * + * @param type the type value to set. + * @return the DiskInfoProperties object itself. + */ + public DiskInfoProperties withType(VirtualMachineDiskType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model DiskInfoProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DiskInfoProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiskInfoProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiskInfoProperties 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 DiskInfoProperties. + */ + public static DiskInfoProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiskInfoProperties deserializedDiskInfoProperties = new DiskInfoProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedDiskInfoProperties.type = VirtualMachineDiskType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDiskInfoProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DomainInfoPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DomainInfoPatchProperties.java new file mode 100644 index 000000000000..c14c0bd52627 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DomainInfoPatchProperties.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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; + +/** + * Domain configurations of session hosts. + */ +@Fluent +public final class DomainInfoPatchProperties implements JsonSerializable { + /* + * Active directory info. Only one should be populated based on the join type. + */ + private ActiveDirectoryInfoPatchProperties activeDirectoryInfo; + + /** + * Creates an instance of DomainInfoPatchProperties class. + */ + public DomainInfoPatchProperties() { + } + + /** + * Get the activeDirectoryInfo property: Active directory info. Only one should be populated based on the join type. + * + * @return the activeDirectoryInfo value. + */ + public ActiveDirectoryInfoPatchProperties activeDirectoryInfo() { + return this.activeDirectoryInfo; + } + + /** + * Set the activeDirectoryInfo property: Active directory info. Only one should be populated based on the join type. + * + * @param activeDirectoryInfo the activeDirectoryInfo value to set. + * @return the DomainInfoPatchProperties object itself. + */ + public DomainInfoPatchProperties withActiveDirectoryInfo(ActiveDirectoryInfoPatchProperties activeDirectoryInfo) { + this.activeDirectoryInfo = activeDirectoryInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (activeDirectoryInfo() != null) { + activeDirectoryInfo().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("activeDirectoryInfo", this.activeDirectoryInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DomainInfoPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DomainInfoPatchProperties 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 DomainInfoPatchProperties. + */ + public static DomainInfoPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DomainInfoPatchProperties deserializedDomainInfoPatchProperties = new DomainInfoPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("activeDirectoryInfo".equals(fieldName)) { + deserializedDomainInfoPatchProperties.activeDirectoryInfo + = ActiveDirectoryInfoPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDomainInfoPatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DomainInfoProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DomainInfoProperties.java new file mode 100644 index 000000000000..f934d63c67ff --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DomainInfoProperties.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Domain configurations of session hosts. + */ +@Fluent +public final class DomainInfoProperties implements JsonSerializable { + /* + * The type of domain join done by the virtual machine. + */ + private DomainJoinType joinType; + + /* + * Active directory info. Only one should be populated based on the join type. + */ + private ActiveDirectoryInfoProperties activeDirectoryInfo; + + /* + * Azure active directory info. Only one should be populated based on the join type. + */ + private AzureActiveDirectoryInfoProperties azureActiveDirectoryInfo; + + /** + * Creates an instance of DomainInfoProperties class. + */ + public DomainInfoProperties() { + } + + /** + * Get the joinType property: The type of domain join done by the virtual machine. + * + * @return the joinType value. + */ + public DomainJoinType joinType() { + return this.joinType; + } + + /** + * Set the joinType property: The type of domain join done by the virtual machine. + * + * @param joinType the joinType value to set. + * @return the DomainInfoProperties object itself. + */ + public DomainInfoProperties withJoinType(DomainJoinType joinType) { + this.joinType = joinType; + return this; + } + + /** + * Get the activeDirectoryInfo property: Active directory info. Only one should be populated based on the join type. + * + * @return the activeDirectoryInfo value. + */ + public ActiveDirectoryInfoProperties activeDirectoryInfo() { + return this.activeDirectoryInfo; + } + + /** + * Set the activeDirectoryInfo property: Active directory info. Only one should be populated based on the join type. + * + * @param activeDirectoryInfo the activeDirectoryInfo value to set. + * @return the DomainInfoProperties object itself. + */ + public DomainInfoProperties withActiveDirectoryInfo(ActiveDirectoryInfoProperties activeDirectoryInfo) { + this.activeDirectoryInfo = activeDirectoryInfo; + return this; + } + + /** + * Get the azureActiveDirectoryInfo property: Azure active directory info. Only one should be populated based on the + * join type. + * + * @return the azureActiveDirectoryInfo value. + */ + public AzureActiveDirectoryInfoProperties azureActiveDirectoryInfo() { + return this.azureActiveDirectoryInfo; + } + + /** + * Set the azureActiveDirectoryInfo property: Azure active directory info. Only one should be populated based on the + * join type. + * + * @param azureActiveDirectoryInfo the azureActiveDirectoryInfo value to set. + * @return the DomainInfoProperties object itself. + */ + public DomainInfoProperties + withAzureActiveDirectoryInfo(AzureActiveDirectoryInfoProperties azureActiveDirectoryInfo) { + this.azureActiveDirectoryInfo = azureActiveDirectoryInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (joinType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property joinType in model DomainInfoProperties")); + } + if (activeDirectoryInfo() != null) { + activeDirectoryInfo().validate(); + } + if (azureActiveDirectoryInfo() != null) { + azureActiveDirectoryInfo().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DomainInfoProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("joinType", this.joinType == null ? null : this.joinType.toString()); + jsonWriter.writeJsonField("activeDirectoryInfo", this.activeDirectoryInfo); + jsonWriter.writeJsonField("azureActiveDirectoryInfo", this.azureActiveDirectoryInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DomainInfoProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DomainInfoProperties 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 DomainInfoProperties. + */ + public static DomainInfoProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DomainInfoProperties deserializedDomainInfoProperties = new DomainInfoProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("joinType".equals(fieldName)) { + deserializedDomainInfoProperties.joinType = DomainJoinType.fromString(reader.getString()); + } else if ("activeDirectoryInfo".equals(fieldName)) { + deserializedDomainInfoProperties.activeDirectoryInfo + = ActiveDirectoryInfoProperties.fromJson(reader); + } else if ("azureActiveDirectoryInfo".equals(fieldName)) { + deserializedDomainInfoProperties.azureActiveDirectoryInfo + = AzureActiveDirectoryInfoProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDomainInfoProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DomainJoinType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DomainJoinType.java new file mode 100644 index 000000000000..c3ba4e1f9c18 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DomainJoinType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of domain join done by the virtual machine. + */ +public final class DomainJoinType extends ExpandableStringEnum { + /** + * Static value ActiveDirectory for DomainJoinType. + */ + public static final DomainJoinType ACTIVE_DIRECTORY = fromString("ActiveDirectory"); + + /** + * Static value AzureActiveDirectory for DomainJoinType. + */ + public static final DomainJoinType AZURE_ACTIVE_DIRECTORY = fromString("AzureActiveDirectory"); + + /** + * Creates a new instance of DomainJoinType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DomainJoinType() { + } + + /** + * Creates or finds a DomainJoinType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DomainJoinType. + */ + public static DomainJoinType fromString(String name) { + return fromString(name, DomainJoinType.class); + } + + /** + * Gets known DomainJoinType values. + * + * @return known DomainJoinType values. + */ + public static Collection values() { + return values(DomainJoinType.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImage.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImage.java index cafd12037999..1f82f025a9b6 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImage.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImage.java @@ -113,7 +113,7 @@ public interface ExpandMsixImage { List packageDependencies(); /** - * Gets the version property: Package version found in the appxmanifest.xml. + * Gets the version property: Package Version found in the appxmanifest.xml. * * @return the version value. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPool.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPool.java index 141e7459f03e..818c96169e79 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPool.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPool.java @@ -81,25 +81,25 @@ public interface HostPool { String etag(); /** - * Gets the identity property: The identity property. + * Gets the identity property: Managed service identity (system assigned and/or user assigned identities). * * @return the identity value. */ - ResourceModelWithAllowedPropertySetIdentity identity(); + ManagedServiceIdentity identity(); /** - * Gets the sku property: The sku property. + * Gets the sku property: The resource model definition representing SKU. * * @return the sku value. */ - ResourceModelWithAllowedPropertySetSku sku(); + Sku sku(); /** - * Gets the plan property: The plan property. + * Gets the plan property: Plan for the resource. * * @return the plan value. */ - ResourceModelWithAllowedPropertySetPlan plan(); + Plan plan(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -179,7 +179,8 @@ public interface HostPool { Boolean validationEnvironment(); /** - * Gets the registrationInfo property: The registration info of HostPool. + * Gets the registrationInfo property: The registration info of HostPool. This is not returned on GET. In order to + * get the registration token use the retrieveRegistrationToken or listRegistrationTokens POST calls. * * @return the registrationInfo value. */ @@ -192,6 +193,14 @@ public interface HostPool { */ String vmTemplate(); + /** + * Gets the managementType property: The type of management for this hostpool, Automated or Standard. The default + * value is Automated. + * + * @return the managementType value. + */ + ManagementType managementType(); + /** * Gets the applicationGroupReferences property: List of applicationGroup links. * @@ -281,6 +290,46 @@ public interface HostPool { */ List privateEndpointConnections(); + /** + * Gets the managedPrivateUdp property: Default: AVD-wide settings are used to determine connection availability, + * Enabled: UDP will attempt this connection type when making connections. This means that this connection is + * possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP + * will not attempt this connection type when making connections. + * + * @return the managedPrivateUdp value. + */ + ManagedPrivateUdp managedPrivateUdp(); + + /** + * Gets the directUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: + * UDP will attempt this connection type when making connections. This means that this connection is possible, but + * is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not + * attempt this connection type when making connections. + * + * @return the directUdp value. + */ + DirectUdp directUdp(); + + /** + * Gets the publicUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: + * UDP will attempt this connection type when making connections. This means that this connection is possible, but + * is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not + * attempt this connection type when making connections. + * + * @return the publicUdp value. + */ + PublicUdp publicUdp(); + + /** + * Gets the relayUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: + * UDP will attempt this connection type when making connections. This means that this connection is possible, but + * is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not + * attempt this connection type when making connections. + * + * @return the relayUdp value. + */ + RelayUdp relayUdp(); + /** * Gets the region of the resource. * @@ -411,11 +460,12 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithMan DefinitionStages.WithPlan, DefinitionStages.WithFriendlyName, DefinitionStages.WithDescription, DefinitionStages.WithPersonalDesktopAssignmentType, DefinitionStages.WithCustomRdpProperty, DefinitionStages.WithMaxSessionLimit, DefinitionStages.WithRing, DefinitionStages.WithValidationEnvironment, - DefinitionStages.WithRegistrationInfo, DefinitionStages.WithVmTemplate, + DefinitionStages.WithRegistrationInfo, DefinitionStages.WithVmTemplate, DefinitionStages.WithManagementType, DefinitionStages.WithSsoadfsAuthority, DefinitionStages.WithSsoClientId, DefinitionStages.WithSsoClientSecretKeyVaultPath, DefinitionStages.WithSsoSecretType, DefinitionStages.WithStartVMOnConnect, DefinitionStages.WithPublicNetworkAccess, - DefinitionStages.WithAgentUpdate { + DefinitionStages.WithAgentUpdate, DefinitionStages.WithManagedPrivateUdp, DefinitionStages.WithDirectUdp, + DefinitionStages.WithPublicUdp, DefinitionStages.WithRelayUdp { /** * Executes the create request. * @@ -485,12 +535,13 @@ interface WithKind { */ interface WithIdentity { /** - * Specifies the identity property: The identity property.. + * Specifies the identity property: Managed service identity (system assigned and/or user assigned + * identities). * - * @param identity The identity property. + * @param identity Managed service identity (system assigned and/or user assigned identities). * @return the next definition stage. */ - WithCreate withIdentity(ResourceModelWithAllowedPropertySetIdentity identity); + WithCreate withIdentity(ManagedServiceIdentity identity); } /** @@ -498,12 +549,12 @@ interface WithIdentity { */ interface WithSku { /** - * Specifies the sku property: The sku property.. + * Specifies the sku property: The resource model definition representing SKU. * - * @param sku The sku property. + * @param sku The resource model definition representing SKU. * @return the next definition stage. */ - WithCreate withSku(ResourceModelWithAllowedPropertySetSku sku); + WithCreate withSku(Sku sku); } /** @@ -511,12 +562,12 @@ interface WithSku { */ interface WithPlan { /** - * Specifies the plan property: The plan property.. + * Specifies the plan property: Plan for the resource.. * - * @param plan The plan property. + * @param plan Plan for the resource. * @return the next definition stage. */ - WithCreate withPlan(ResourceModelWithAllowedPropertySetPlan plan); + WithCreate withPlan(Plan plan); } /** @@ -615,9 +666,12 @@ interface WithValidationEnvironment { */ interface WithRegistrationInfo { /** - * Specifies the registrationInfo property: The registration info of HostPool.. + * Specifies the registrationInfo property: The registration info of HostPool. This is not returned on GET. + * In order to get the registration token use the retrieveRegistrationToken or listRegistrationTokens POST + * calls.. * - * @param registrationInfo The registration info of HostPool. + * @param registrationInfo The registration info of HostPool. This is not returned on GET. In order to get + * the registration token use the retrieveRegistrationToken or listRegistrationTokens POST calls. * @return the next definition stage. */ WithCreate withRegistrationInfo(RegistrationInfoInner registrationInfo); @@ -636,6 +690,21 @@ interface WithVmTemplate { WithCreate withVmTemplate(String vmTemplate); } + /** + * The stage of the HostPool definition allowing to specify managementType. + */ + interface WithManagementType { + /** + * Specifies the managementType property: The type of management for this hostpool, Automated or Standard. + * The default value is Automated.. + * + * @param managementType The type of management for this hostpool, Automated or Standard. The default value + * is Automated. + * @return the next definition stage. + */ + WithCreate withManagementType(ManagementType managementType); + } + /** * The stage of the HostPool definition allowing to specify ssoadfsAuthority. */ @@ -733,6 +802,82 @@ interface WithAgentUpdate { */ WithCreate withAgentUpdate(AgentUpdateProperties agentUpdate); } + + /** + * The stage of the HostPool definition allowing to specify managedPrivateUdp. + */ + interface WithManagedPrivateUdp { + /** + * Specifies the managedPrivateUdp property: Default: AVD-wide settings are used to determine connection + * availability, Enabled: UDP will attempt this connection type when making connections. This means that + * this connection is possible, but is not guaranteed, as there are other factors that may prevent this + * connection type, Disabled: UDP will not attempt this connection type when making connections. + * + * @param managedPrivateUdp Default: AVD-wide settings are used to determine connection availability, + * Enabled: UDP will attempt this connection type when making connections. This means that this connection + * is possible, but is not guaranteed, as there are other factors that may prevent this connection type, + * Disabled: UDP will not attempt this connection type when making connections. + * @return the next definition stage. + */ + WithCreate withManagedPrivateUdp(ManagedPrivateUdp managedPrivateUdp); + } + + /** + * The stage of the HostPool definition allowing to specify directUdp. + */ + interface WithDirectUdp { + /** + * Specifies the directUdp property: Default: AVD-wide settings are used to determine connection + * availability, Enabled: UDP will attempt this connection type when making connections. This means that + * this connection is possible, but is not guaranteed, as there are other factors that may prevent this + * connection type, Disabled: UDP will not attempt this connection type when making connections. + * + * @param directUdp Default: AVD-wide settings are used to determine connection availability, Enabled: UDP + * will attempt this connection type when making connections. This means that this connection is possible, + * but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP + * will not attempt this connection type when making connections. + * @return the next definition stage. + */ + WithCreate withDirectUdp(DirectUdp directUdp); + } + + /** + * The stage of the HostPool definition allowing to specify publicUdp. + */ + interface WithPublicUdp { + /** + * Specifies the publicUdp property: Default: AVD-wide settings are used to determine connection + * availability, Enabled: UDP will attempt this connection type when making connections. This means that + * this connection is possible, but is not guaranteed, as there are other factors that may prevent this + * connection type, Disabled: UDP will not attempt this connection type when making connections. + * + * @param publicUdp Default: AVD-wide settings are used to determine connection availability, Enabled: UDP + * will attempt this connection type when making connections. This means that this connection is possible, + * but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP + * will not attempt this connection type when making connections. + * @return the next definition stage. + */ + WithCreate withPublicUdp(PublicUdp publicUdp); + } + + /** + * The stage of the HostPool definition allowing to specify relayUdp. + */ + interface WithRelayUdp { + /** + * Specifies the relayUdp property: Default: AVD-wide settings are used to determine connection + * availability, Enabled: UDP will attempt this connection type when making connections. This means that + * this connection is possible, but is not guaranteed, as there are other factors that may prevent this + * connection type, Disabled: UDP will not attempt this connection type when making connections. + * + * @param relayUdp Default: AVD-wide settings are used to determine connection availability, Enabled: UDP + * will attempt this connection type when making connections. This means that this connection is possible, + * but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP + * will not attempt this connection type when making connections. + * @return the next definition stage. + */ + WithCreate withRelayUdp(RelayUdp relayUdp); + } } /** @@ -751,7 +896,8 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithFriendlyName, U UpdateStages.WithValidationEnvironment, UpdateStages.WithRegistrationInfo, UpdateStages.WithVmTemplate, UpdateStages.WithSsoadfsAuthority, UpdateStages.WithSsoClientId, UpdateStages.WithSsoClientSecretKeyVaultPath, UpdateStages.WithSsoSecretType, UpdateStages.WithPreferredAppGroupType, UpdateStages.WithStartVMOnConnect, - UpdateStages.WithPublicNetworkAccess, UpdateStages.WithAgentUpdate { + UpdateStages.WithPublicNetworkAccess, UpdateStages.WithAgentUpdate, UpdateStages.WithManagedPrivateUdp, + UpdateStages.WithDirectUdp, UpdateStages.WithPublicUdp, UpdateStages.WithRelayUdp { /** * Executes the update request. * @@ -894,9 +1040,12 @@ interface WithValidationEnvironment { */ interface WithRegistrationInfo { /** - * Specifies the registrationInfo property: The registration info of HostPool.. + * Specifies the registrationInfo property: The registration info of HostPool. This is not returned on GET. + * In order to get the registration token use the retrieveRegistrationToken or listRegistrationTokens POST + * calls.. * - * @param registrationInfo The registration info of HostPool. + * @param registrationInfo The registration info of HostPool. This is not returned on GET. In order to get + * the registration token use the retrieveRegistrationToken or listRegistrationTokens POST calls. * @return the next definition stage. */ Update withRegistrationInfo(RegistrationInfoPatch registrationInfo); @@ -1026,6 +1175,82 @@ interface WithAgentUpdate { */ Update withAgentUpdate(AgentUpdatePatchProperties agentUpdate); } + + /** + * The stage of the HostPool update allowing to specify managedPrivateUdp. + */ + interface WithManagedPrivateUdp { + /** + * Specifies the managedPrivateUdp property: Default: AVD-wide settings are used to determine connection + * availability, Enabled: UDP will attempt this connection type when making connections. This means that + * this connection is possible, but is not guaranteed, as there are other factors that may prevent this + * connection type, Disabled: UDP will not attempt this connection type when making connections. + * + * @param managedPrivateUdp Default: AVD-wide settings are used to determine connection availability, + * Enabled: UDP will attempt this connection type when making connections. This means that this connection + * is possible, but is not guaranteed, as there are other factors that may prevent this connection type, + * Disabled: UDP will not attempt this connection type when making connections. + * @return the next definition stage. + */ + Update withManagedPrivateUdp(ManagedPrivateUdp managedPrivateUdp); + } + + /** + * The stage of the HostPool update allowing to specify directUdp. + */ + interface WithDirectUdp { + /** + * Specifies the directUdp property: Default: AVD-wide settings are used to determine connection + * availability, Enabled: UDP will attempt this connection type when making connections. This means that + * this connection is possible, but is not guaranteed, as there are other factors that may prevent this + * connection type, Disabled: UDP will not attempt this connection type when making connections. + * + * @param directUdp Default: AVD-wide settings are used to determine connection availability, Enabled: UDP + * will attempt this connection type when making connections. This means that this connection is possible, + * but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP + * will not attempt this connection type when making connections. + * @return the next definition stage. + */ + Update withDirectUdp(DirectUdp directUdp); + } + + /** + * The stage of the HostPool update allowing to specify publicUdp. + */ + interface WithPublicUdp { + /** + * Specifies the publicUdp property: Default: AVD-wide settings are used to determine connection + * availability, Enabled: UDP will attempt this connection type when making connections. This means that + * this connection is possible, but is not guaranteed, as there are other factors that may prevent this + * connection type, Disabled: UDP will not attempt this connection type when making connections. + * + * @param publicUdp Default: AVD-wide settings are used to determine connection availability, Enabled: UDP + * will attempt this connection type when making connections. This means that this connection is possible, + * but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP + * will not attempt this connection type when making connections. + * @return the next definition stage. + */ + Update withPublicUdp(PublicUdp publicUdp); + } + + /** + * The stage of the HostPool update allowing to specify relayUdp. + */ + interface WithRelayUdp { + /** + * Specifies the relayUdp property: Default: AVD-wide settings are used to determine connection + * availability, Enabled: UDP will attempt this connection type when making connections. This means that + * this connection is possible, but is not guaranteed, as there are other factors that may prevent this + * connection type, Disabled: UDP will not attempt this connection type when making connections. + * + * @param relayUdp Default: AVD-wide settings are used to determine connection availability, Enabled: UDP + * will attempt this connection type when making connections. This means that this connection is possible, + * but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP + * will not attempt this connection type when making connections. + * @return the next definition stage. + */ + Update withRelayUdp(RelayUdp relayUdp); + } } /** diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolPatch.java index 66bd112d6ccc..050c456bf497 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolPatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolPatch.java @@ -309,7 +309,8 @@ public HostPoolPatch withValidationEnvironment(Boolean validationEnvironment) { } /** - * Get the registrationInfo property: The registration info of HostPool. + * Get the registrationInfo property: The registration info of HostPool. This is not returned on GET. In order to + * get the registration token use the retrieveRegistrationToken or listRegistrationTokens POST calls. * * @return the registrationInfo value. */ @@ -318,7 +319,8 @@ public RegistrationInfoPatch registrationInfo() { } /** - * Set the registrationInfo property: The registration info of HostPool. + * Set the registrationInfo property: The registration info of HostPool. This is not returned on GET. In order to + * get the registration token use the retrieveRegistrationToken or listRegistrationTokens POST calls. * * @param registrationInfo the registrationInfo value to set. * @return the HostPoolPatch object itself. @@ -544,6 +546,122 @@ public HostPoolPatch withAgentUpdate(AgentUpdatePatchProperties agentUpdate) { return this; } + /** + * Get the managedPrivateUdp property: Default: AVD-wide settings are used to determine connection availability, + * Enabled: UDP will attempt this connection type when making connections. This means that this connection is + * possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP + * will not attempt this connection type when making connections. + * + * @return the managedPrivateUdp value. + */ + public ManagedPrivateUdp managedPrivateUdp() { + return this.innerProperties() == null ? null : this.innerProperties().managedPrivateUdp(); + } + + /** + * Set the managedPrivateUdp property: Default: AVD-wide settings are used to determine connection availability, + * Enabled: UDP will attempt this connection type when making connections. This means that this connection is + * possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP + * will not attempt this connection type when making connections. + * + * @param managedPrivateUdp the managedPrivateUdp value to set. + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withManagedPrivateUdp(ManagedPrivateUdp managedPrivateUdp) { + if (this.innerProperties() == null) { + this.innerProperties = new HostPoolPatchProperties(); + } + this.innerProperties().withManagedPrivateUdp(managedPrivateUdp); + return this; + } + + /** + * Get the directUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: + * UDP will attempt this connection type when making connections. This means that this connection is possible, but + * is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not + * attempt this connection type when making connections. + * + * @return the directUdp value. + */ + public DirectUdp directUdp() { + return this.innerProperties() == null ? null : this.innerProperties().directUdp(); + } + + /** + * Set the directUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: + * UDP will attempt this connection type when making connections. This means that this connection is possible, but + * is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not + * attempt this connection type when making connections. + * + * @param directUdp the directUdp value to set. + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withDirectUdp(DirectUdp directUdp) { + if (this.innerProperties() == null) { + this.innerProperties = new HostPoolPatchProperties(); + } + this.innerProperties().withDirectUdp(directUdp); + return this; + } + + /** + * Get the publicUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: + * UDP will attempt this connection type when making connections. This means that this connection is possible, but + * is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not + * attempt this connection type when making connections. + * + * @return the publicUdp value. + */ + public PublicUdp publicUdp() { + return this.innerProperties() == null ? null : this.innerProperties().publicUdp(); + } + + /** + * Set the publicUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: + * UDP will attempt this connection type when making connections. This means that this connection is possible, but + * is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not + * attempt this connection type when making connections. + * + * @param publicUdp the publicUdp value to set. + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withPublicUdp(PublicUdp publicUdp) { + if (this.innerProperties() == null) { + this.innerProperties = new HostPoolPatchProperties(); + } + this.innerProperties().withPublicUdp(publicUdp); + return this; + } + + /** + * Get the relayUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: UDP + * will attempt this connection type when making connections. This means that this connection is possible, but is + * not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt + * this connection type when making connections. + * + * @return the relayUdp value. + */ + public RelayUdp relayUdp() { + return this.innerProperties() == null ? null : this.innerProperties().relayUdp(); + } + + /** + * Set the relayUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: UDP + * will attempt this connection type when making connections. This means that this connection is possible, but is + * not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt + * this connection type when making connections. + * + * @param relayUdp the relayUdp value to set. + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withRelayUdp(RelayUdp relayUdp) { + if (this.innerProperties() == null) { + this.innerProperties = new HostPoolPatchProperties(); + } + this.innerProperties().withRelayUdp(relayUdp); + return this; + } + /** * Validates the instance. * diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolProperties.java index 52393af79cba..fd793746aa51 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolProperties.java @@ -82,7 +82,8 @@ public interface HostPoolProperties { Boolean validationEnvironment(); /** - * Gets the registrationInfo property: The registration info of HostPool. + * Gets the registrationInfo property: The registration info of HostPool. This is not returned on GET. In order to + * get the registration token use the retrieveRegistrationToken or listRegistrationTokens POST calls. * * @return the registrationInfo value. */ @@ -95,6 +96,14 @@ public interface HostPoolProperties { */ String vmTemplate(); + /** + * Gets the managementType property: The type of management for this hostpool, Automated or Standard. The default + * value is Automated. + * + * @return the managementType value. + */ + ManagementType managementType(); + /** * Gets the applicationGroupReferences property: List of applicationGroup links. * @@ -184,6 +193,46 @@ public interface HostPoolProperties { */ List privateEndpointConnections(); + /** + * Gets the managedPrivateUdp property: Default: AVD-wide settings are used to determine connection availability, + * Enabled: UDP will attempt this connection type when making connections. This means that this connection is + * possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP + * will not attempt this connection type when making connections. + * + * @return the managedPrivateUdp value. + */ + ManagedPrivateUdp managedPrivateUdp(); + + /** + * Gets the directUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: + * UDP will attempt this connection type when making connections. This means that this connection is possible, but + * is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not + * attempt this connection type when making connections. + * + * @return the directUdp value. + */ + DirectUdp directUdp(); + + /** + * Gets the publicUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: + * UDP will attempt this connection type when making connections. This means that this connection is possible, but + * is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not + * attempt this connection type when making connections. + * + * @return the publicUdp value. + */ + PublicUdp publicUdp(); + + /** + * Gets the relayUdp property: Default: AVD-wide settings are used to determine connection availability, Enabled: + * UDP will attempt this connection type when making connections. This means that this connection is possible, but + * is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not + * attempt this connection type when making connections. + * + * @return the relayUdp value. + */ + RelayUdp relayUdp(); + /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.HostPoolPropertiesInner object. * diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolUpdateAction.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolUpdateAction.java new file mode 100644 index 000000000000..5ee995eb4a52 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolUpdateAction.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Action types for controlling hostpool update. + */ +public final class HostPoolUpdateAction extends ExpandableStringEnum { + /** + * Static value Start for HostPoolUpdateAction. + */ + public static final HostPoolUpdateAction START = fromString("Start"); + + /** + * Static value Pause for HostPoolUpdateAction. + */ + public static final HostPoolUpdateAction PAUSE = fromString("Pause"); + + /** + * Static value Cancel for HostPoolUpdateAction. + */ + public static final HostPoolUpdateAction CANCEL = fromString("Cancel"); + + /** + * Static value Retry for HostPoolUpdateAction. + */ + public static final HostPoolUpdateAction RETRY = fromString("Retry"); + + /** + * Static value Resume for HostPoolUpdateAction. + */ + public static final HostPoolUpdateAction RESUME = fromString("Resume"); + + /** + * Creates a new instance of HostPoolUpdateAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HostPoolUpdateAction() { + } + + /** + * Creates or finds a HostPoolUpdateAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding HostPoolUpdateAction. + */ + public static HostPoolUpdateAction fromString(String name) { + return fromString(name, HostPoolUpdateAction.class); + } + + /** + * Gets known HostPoolUpdateAction values. + * + * @return known HostPoolUpdateAction values. + */ + public static Collection values() { + return values(HostPoolUpdateAction.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolUpdateConfigurationPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolUpdateConfigurationPatchProperties.java new file mode 100644 index 000000000000..65b13b5f4247 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolUpdateConfigurationPatchProperties.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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 configurations of a hostpool update. + */ +@Fluent +public final class HostPoolUpdateConfigurationPatchProperties + implements JsonSerializable { + /* + * Whether not to save original disk. False by default. + */ + private Boolean deleteOriginalVm; + + /* + * The maximum number of virtual machines to be removed during hostpool update. + */ + private Integer maxVmsRemoved; + + /* + * Grace period before logging off users in minutes. + */ + private Integer logOffDelayMinutes; + + /* + * Log off message sent to user for logoff. + */ + private String logOffMessage; + + /** + * Creates an instance of HostPoolUpdateConfigurationPatchProperties class. + */ + public HostPoolUpdateConfigurationPatchProperties() { + } + + /** + * Get the deleteOriginalVm property: Whether not to save original disk. False by default. + * + * @return the deleteOriginalVm value. + */ + public Boolean deleteOriginalVm() { + return this.deleteOriginalVm; + } + + /** + * Set the deleteOriginalVm property: Whether not to save original disk. False by default. + * + * @param deleteOriginalVm the deleteOriginalVm value to set. + * @return the HostPoolUpdateConfigurationPatchProperties object itself. + */ + public HostPoolUpdateConfigurationPatchProperties withDeleteOriginalVm(Boolean deleteOriginalVm) { + this.deleteOriginalVm = deleteOriginalVm; + return this; + } + + /** + * Get the maxVmsRemoved property: The maximum number of virtual machines to be removed during hostpool update. + * + * @return the maxVmsRemoved value. + */ + public Integer maxVmsRemoved() { + return this.maxVmsRemoved; + } + + /** + * Set the maxVmsRemoved property: The maximum number of virtual machines to be removed during hostpool update. + * + * @param maxVmsRemoved the maxVmsRemoved value to set. + * @return the HostPoolUpdateConfigurationPatchProperties object itself. + */ + public HostPoolUpdateConfigurationPatchProperties withMaxVmsRemoved(Integer maxVmsRemoved) { + this.maxVmsRemoved = maxVmsRemoved; + return this; + } + + /** + * Get the logOffDelayMinutes property: Grace period before logging off users in minutes. + * + * @return the logOffDelayMinutes value. + */ + public Integer logOffDelayMinutes() { + return this.logOffDelayMinutes; + } + + /** + * Set the logOffDelayMinutes property: Grace period before logging off users in minutes. + * + * @param logOffDelayMinutes the logOffDelayMinutes value to set. + * @return the HostPoolUpdateConfigurationPatchProperties object itself. + */ + public HostPoolUpdateConfigurationPatchProperties withLogOffDelayMinutes(Integer logOffDelayMinutes) { + this.logOffDelayMinutes = logOffDelayMinutes; + return this; + } + + /** + * Get the logOffMessage property: Log off message sent to user for logoff. + * + * @return the logOffMessage value. + */ + public String logOffMessage() { + return this.logOffMessage; + } + + /** + * Set the logOffMessage property: Log off message sent to user for logoff. + * + * @param logOffMessage the logOffMessage value to set. + * @return the HostPoolUpdateConfigurationPatchProperties object itself. + */ + public HostPoolUpdateConfigurationPatchProperties withLogOffMessage(String logOffMessage) { + this.logOffMessage = logOffMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("deleteOriginalVm", this.deleteOriginalVm); + jsonWriter.writeNumberField("maxVmsRemoved", this.maxVmsRemoved); + jsonWriter.writeNumberField("logOffDelayMinutes", this.logOffDelayMinutes); + jsonWriter.writeStringField("logOffMessage", this.logOffMessage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostPoolUpdateConfigurationPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostPoolUpdateConfigurationPatchProperties 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 HostPoolUpdateConfigurationPatchProperties. + */ + public static HostPoolUpdateConfigurationPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostPoolUpdateConfigurationPatchProperties deserializedHostPoolUpdateConfigurationPatchProperties + = new HostPoolUpdateConfigurationPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deleteOriginalVm".equals(fieldName)) { + deserializedHostPoolUpdateConfigurationPatchProperties.deleteOriginalVm + = reader.getNullable(JsonReader::getBoolean); + } else if ("maxVmsRemoved".equals(fieldName)) { + deserializedHostPoolUpdateConfigurationPatchProperties.maxVmsRemoved + = reader.getNullable(JsonReader::getInt); + } else if ("logOffDelayMinutes".equals(fieldName)) { + deserializedHostPoolUpdateConfigurationPatchProperties.logOffDelayMinutes + = reader.getNullable(JsonReader::getInt); + } else if ("logOffMessage".equals(fieldName)) { + deserializedHostPoolUpdateConfigurationPatchProperties.logOffMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHostPoolUpdateConfigurationPatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolUpdateConfigurationProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolUpdateConfigurationProperties.java new file mode 100644 index 000000000000..6f83204f008a --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolUpdateConfigurationProperties.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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 configurations of a hostpool update. + */ +@Fluent +public final class HostPoolUpdateConfigurationProperties + implements JsonSerializable { + /* + * Whether not to save original disk. False by default. + */ + private Boolean deleteOriginalVm; + + /* + * The maximum number of virtual machines to be removed during hostpool update. + */ + private int maxVmsRemoved; + + /* + * Grace period before logging off users in minutes. + */ + private int logOffDelayMinutes; + + /* + * Log off message sent to user for logoff. Default value is an empty string. + */ + private String logOffMessage; + + /** + * Creates an instance of HostPoolUpdateConfigurationProperties class. + */ + public HostPoolUpdateConfigurationProperties() { + } + + /** + * Get the deleteOriginalVm property: Whether not to save original disk. False by default. + * + * @return the deleteOriginalVm value. + */ + public Boolean deleteOriginalVm() { + return this.deleteOriginalVm; + } + + /** + * Set the deleteOriginalVm property: Whether not to save original disk. False by default. + * + * @param deleteOriginalVm the deleteOriginalVm value to set. + * @return the HostPoolUpdateConfigurationProperties object itself. + */ + public HostPoolUpdateConfigurationProperties withDeleteOriginalVm(Boolean deleteOriginalVm) { + this.deleteOriginalVm = deleteOriginalVm; + return this; + } + + /** + * Get the maxVmsRemoved property: The maximum number of virtual machines to be removed during hostpool update. + * + * @return the maxVmsRemoved value. + */ + public int maxVmsRemoved() { + return this.maxVmsRemoved; + } + + /** + * Set the maxVmsRemoved property: The maximum number of virtual machines to be removed during hostpool update. + * + * @param maxVmsRemoved the maxVmsRemoved value to set. + * @return the HostPoolUpdateConfigurationProperties object itself. + */ + public HostPoolUpdateConfigurationProperties withMaxVmsRemoved(int maxVmsRemoved) { + this.maxVmsRemoved = maxVmsRemoved; + return this; + } + + /** + * Get the logOffDelayMinutes property: Grace period before logging off users in minutes. + * + * @return the logOffDelayMinutes value. + */ + public int logOffDelayMinutes() { + return this.logOffDelayMinutes; + } + + /** + * Set the logOffDelayMinutes property: Grace period before logging off users in minutes. + * + * @param logOffDelayMinutes the logOffDelayMinutes value to set. + * @return the HostPoolUpdateConfigurationProperties object itself. + */ + public HostPoolUpdateConfigurationProperties withLogOffDelayMinutes(int logOffDelayMinutes) { + this.logOffDelayMinutes = logOffDelayMinutes; + return this; + } + + /** + * Get the logOffMessage property: Log off message sent to user for logoff. Default value is an empty string. + * + * @return the logOffMessage value. + */ + public String logOffMessage() { + return this.logOffMessage; + } + + /** + * Set the logOffMessage property: Log off message sent to user for logoff. Default value is an empty string. + * + * @param logOffMessage the logOffMessage value to set. + * @return the HostPoolUpdateConfigurationProperties object itself. + */ + public HostPoolUpdateConfigurationProperties withLogOffMessage(String logOffMessage) { + this.logOffMessage = logOffMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("maxVmsRemoved", this.maxVmsRemoved); + jsonWriter.writeIntField("logOffDelayMinutes", this.logOffDelayMinutes); + jsonWriter.writeBooleanField("deleteOriginalVm", this.deleteOriginalVm); + jsonWriter.writeStringField("logOffMessage", this.logOffMessage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostPoolUpdateConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostPoolUpdateConfigurationProperties 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 HostPoolUpdateConfigurationProperties. + */ + public static HostPoolUpdateConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostPoolUpdateConfigurationProperties deserializedHostPoolUpdateConfigurationProperties + = new HostPoolUpdateConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxVmsRemoved".equals(fieldName)) { + deserializedHostPoolUpdateConfigurationProperties.maxVmsRemoved = reader.getInt(); + } else if ("logOffDelayMinutes".equals(fieldName)) { + deserializedHostPoolUpdateConfigurationProperties.logOffDelayMinutes = reader.getInt(); + } else if ("deleteOriginalVm".equals(fieldName)) { + deserializedHostPoolUpdateConfigurationProperties.deleteOriginalVm + = reader.getNullable(JsonReader::getBoolean); + } else if ("logOffMessage".equals(fieldName)) { + deserializedHostPoolUpdateConfigurationProperties.logOffMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHostPoolUpdateConfigurationProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolUpdateControlParameter.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolUpdateControlParameter.java new file mode 100644 index 000000000000..47952bf16150 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolUpdateControlParameter.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents properties for a hostpool update control request. + */ +@Fluent +public final class HostPoolUpdateControlParameter implements JsonSerializable { + /* + * Action types for controlling hostpool update. + */ + private HostPoolUpdateAction action; + + /* + * The cancel message sent to the user on the session host. This is can only be specified if the action is 'Cancel'. + */ + private String cancelMessage; + + /** + * Creates an instance of HostPoolUpdateControlParameter class. + */ + public HostPoolUpdateControlParameter() { + } + + /** + * Get the action property: Action types for controlling hostpool update. + * + * @return the action value. + */ + public HostPoolUpdateAction action() { + return this.action; + } + + /** + * Set the action property: Action types for controlling hostpool update. + * + * @param action the action value to set. + * @return the HostPoolUpdateControlParameter object itself. + */ + public HostPoolUpdateControlParameter withAction(HostPoolUpdateAction action) { + this.action = action; + return this; + } + + /** + * Get the cancelMessage property: The cancel message sent to the user on the session host. This is can only be + * specified if the action is 'Cancel'. + * + * @return the cancelMessage value. + */ + public String cancelMessage() { + return this.cancelMessage; + } + + /** + * Set the cancelMessage property: The cancel message sent to the user on the session host. This is can only be + * specified if the action is 'Cancel'. + * + * @param cancelMessage the cancelMessage value to set. + * @return the HostPoolUpdateControlParameter object itself. + */ + public HostPoolUpdateControlParameter withCancelMessage(String cancelMessage) { + this.cancelMessage = cancelMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (action() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property action in model HostPoolUpdateControlParameter")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HostPoolUpdateControlParameter.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeStringField("cancelMessage", this.cancelMessage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostPoolUpdateControlParameter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostPoolUpdateControlParameter 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 HostPoolUpdateControlParameter. + */ + public static HostPoolUpdateControlParameter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostPoolUpdateControlParameter deserializedHostPoolUpdateControlParameter + = new HostPoolUpdateControlParameter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("action".equals(fieldName)) { + deserializedHostPoolUpdateControlParameter.action + = HostPoolUpdateAction.fromString(reader.getString()); + } else if ("cancelMessage".equals(fieldName)) { + deserializedHostPoolUpdateControlParameter.cancelMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHostPoolUpdateControlParameter; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Identity.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Identity.java deleted file mode 100644 index ab8a464ea9b0..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Identity.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.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; - -/** - * Identity for the resource. - */ -@Fluent -public class Identity implements JsonSerializable { - /* - * The principal ID of resource identity. The value must be an UUID. - */ - private String principalId; - - /* - * The tenant ID of resource. The value must be an UUID. - */ - private String tenantId; - - /* - * The identity type. - */ - private ResourceIdentityType type; - - /** - * Creates an instance of Identity class. - */ - public Identity() { - } - - /** - * Get the principalId property: The principal ID of resource identity. The value must be an UUID. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Set the principalId property: The principal ID of resource identity. The value must be an UUID. - * - * @param principalId the principalId value to set. - * @return the Identity object itself. - */ - Identity withPrincipalId(String principalId) { - this.principalId = principalId; - return this; - } - - /** - * Get the tenantId property: The tenant ID of resource. The value must be an UUID. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Set the tenantId property: The tenant ID of resource. The value must be an UUID. - * - * @param tenantId the tenantId value to set. - * @return the Identity object itself. - */ - Identity withTenantId(String tenantId) { - this.tenantId = tenantId; - return this; - } - - /** - * Get the type property: The identity type. - * - * @return the type value. - */ - public ResourceIdentityType type() { - return this.type; - } - - /** - * Set the type property: The identity type. - * - * @param type the type value to set. - * @return the Identity object itself. - */ - public Identity withType(ResourceIdentityType type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Identity from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Identity 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 Identity. - */ - public static Identity fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Identity deserializedIdentity = new Identity(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("principalId".equals(fieldName)) { - deserializedIdentity.principalId = reader.getString(); - } else if ("tenantId".equals(fieldName)) { - deserializedIdentity.tenantId = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedIdentity.type = ResourceIdentityType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedIdentity; - }); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ImageInfoPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ImageInfoPatchProperties.java new file mode 100644 index 000000000000..031607c84870 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ImageInfoPatchProperties.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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; + +/** + * Image configurations of session host in a HostPool. + */ +@Fluent +public final class ImageInfoPatchProperties implements JsonSerializable { + /* + * The type of image session hosts use in the hostpool. + */ + private Type imageType; + + /* + * The values to uniquely identify a marketplace image. Only one should be populated based on the image type. + */ + private MarketplaceInfoPatchProperties marketplaceInfo; + + /* + * The values to uniquely identify a custom image. Only one should be populated based on the image type. + */ + private CustomInfoPatchProperties customInfo; + + /** + * Creates an instance of ImageInfoPatchProperties class. + */ + public ImageInfoPatchProperties() { + } + + /** + * Get the imageType property: The type of image session hosts use in the hostpool. + * + * @return the imageType value. + */ + public Type imageType() { + return this.imageType; + } + + /** + * Set the imageType property: The type of image session hosts use in the hostpool. + * + * @param imageType the imageType value to set. + * @return the ImageInfoPatchProperties object itself. + */ + public ImageInfoPatchProperties withImageType(Type imageType) { + this.imageType = imageType; + return this; + } + + /** + * Get the marketplaceInfo property: The values to uniquely identify a marketplace image. Only one should be + * populated based on the image type. + * + * @return the marketplaceInfo value. + */ + public MarketplaceInfoPatchProperties marketplaceInfo() { + return this.marketplaceInfo; + } + + /** + * Set the marketplaceInfo property: The values to uniquely identify a marketplace image. Only one should be + * populated based on the image type. + * + * @param marketplaceInfo the marketplaceInfo value to set. + * @return the ImageInfoPatchProperties object itself. + */ + public ImageInfoPatchProperties withMarketplaceInfo(MarketplaceInfoPatchProperties marketplaceInfo) { + this.marketplaceInfo = marketplaceInfo; + return this; + } + + /** + * Get the customInfo property: The values to uniquely identify a custom image. Only one should be populated based + * on the image type. + * + * @return the customInfo value. + */ + public CustomInfoPatchProperties customInfo() { + return this.customInfo; + } + + /** + * Set the customInfo property: The values to uniquely identify a custom image. Only one should be populated based + * on the image type. + * + * @param customInfo the customInfo value to set. + * @return the ImageInfoPatchProperties object itself. + */ + public ImageInfoPatchProperties withCustomInfo(CustomInfoPatchProperties customInfo) { + this.customInfo = customInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (marketplaceInfo() != null) { + marketplaceInfo().validate(); + } + if (customInfo() != null) { + customInfo().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.imageType == null ? null : this.imageType.toString()); + jsonWriter.writeJsonField("marketplaceInfo", this.marketplaceInfo); + jsonWriter.writeJsonField("customInfo", this.customInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageInfoPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageInfoPatchProperties 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 ImageInfoPatchProperties. + */ + public static ImageInfoPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageInfoPatchProperties deserializedImageInfoPatchProperties = new ImageInfoPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedImageInfoPatchProperties.imageType = Type.fromString(reader.getString()); + } else if ("marketplaceInfo".equals(fieldName)) { + deserializedImageInfoPatchProperties.marketplaceInfo + = MarketplaceInfoPatchProperties.fromJson(reader); + } else if ("customInfo".equals(fieldName)) { + deserializedImageInfoPatchProperties.customInfo = CustomInfoPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedImageInfoPatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ImageInfoProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ImageInfoProperties.java new file mode 100644 index 000000000000..74a2fbe15924 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ImageInfoProperties.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Image configurations of session host in a HostPool. + */ +@Fluent +public final class ImageInfoProperties implements JsonSerializable { + /* + * The type of image session hosts use in the hostpool. + */ + private Type imageType; + + /* + * The values to uniquely identify a marketplace image. Only one should be populated based on the image type. + */ + private MarketplaceInfoProperties marketplaceInfo; + + /* + * The values to uniquely identify a custom image. Only one should be populated based on the image type. + */ + private CustomInfoProperties customInfo; + + /** + * Creates an instance of ImageInfoProperties class. + */ + public ImageInfoProperties() { + } + + /** + * Get the imageType property: The type of image session hosts use in the hostpool. + * + * @return the imageType value. + */ + public Type imageType() { + return this.imageType; + } + + /** + * Set the imageType property: The type of image session hosts use in the hostpool. + * + * @param imageType the imageType value to set. + * @return the ImageInfoProperties object itself. + */ + public ImageInfoProperties withImageType(Type imageType) { + this.imageType = imageType; + return this; + } + + /** + * Get the marketplaceInfo property: The values to uniquely identify a marketplace image. Only one should be + * populated based on the image type. + * + * @return the marketplaceInfo value. + */ + public MarketplaceInfoProperties marketplaceInfo() { + return this.marketplaceInfo; + } + + /** + * Set the marketplaceInfo property: The values to uniquely identify a marketplace image. Only one should be + * populated based on the image type. + * + * @param marketplaceInfo the marketplaceInfo value to set. + * @return the ImageInfoProperties object itself. + */ + public ImageInfoProperties withMarketplaceInfo(MarketplaceInfoProperties marketplaceInfo) { + this.marketplaceInfo = marketplaceInfo; + return this; + } + + /** + * Get the customInfo property: The values to uniquely identify a custom image. Only one should be populated based + * on the image type. + * + * @return the customInfo value. + */ + public CustomInfoProperties customInfo() { + return this.customInfo; + } + + /** + * Set the customInfo property: The values to uniquely identify a custom image. Only one should be populated based + * on the image type. + * + * @param customInfo the customInfo value to set. + * @return the ImageInfoProperties object itself. + */ + public ImageInfoProperties withCustomInfo(CustomInfoProperties customInfo) { + this.customInfo = customInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (imageType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property imageType in model ImageInfoProperties")); + } + if (marketplaceInfo() != null) { + marketplaceInfo().validate(); + } + if (customInfo() != null) { + customInfo().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImageInfoProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.imageType == null ? null : this.imageType.toString()); + jsonWriter.writeJsonField("marketplaceInfo", this.marketplaceInfo); + jsonWriter.writeJsonField("customInfo", this.customInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageInfoProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageInfoProperties 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 ImageInfoProperties. + */ + public static ImageInfoProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageInfoProperties deserializedImageInfoProperties = new ImageInfoProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedImageInfoProperties.imageType = Type.fromString(reader.getString()); + } else if ("marketplaceInfo".equals(fieldName)) { + deserializedImageInfoProperties.marketplaceInfo = MarketplaceInfoProperties.fromJson(reader); + } else if ("customInfo".equals(fieldName)) { + deserializedImageInfoProperties.customInfo = CustomInfoProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedImageInfoProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/InitiateSessionHostUpdates.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/InitiateSessionHostUpdates.java new file mode 100644 index 000000000000..c9fd3cc336e9 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/InitiateSessionHostUpdates.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of InitiateSessionHostUpdates. + */ +public interface InitiateSessionHostUpdates { + /** + * Initiates a hostpool update or schedule an update for the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param updateSessionHostsRequestBody Object containing the definition for properties to be used in the + * sessionHostUpdate validation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response postWithResponse(String resourceGroupName, String hostPoolName, + UpdateSessionHostsRequestBody updateSessionHostsRequestBody, Context context); + + /** + * Initiates a hostpool update or schedule an update for the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void post(String resourceGroupName, String hostPoolName); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/KeyVaultCredentialsPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/KeyVaultCredentialsPatchProperties.java new file mode 100644 index 000000000000..fd850eeb9259 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/KeyVaultCredentialsPatchProperties.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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; + +/** + * Credentials kept in the keyvault. + */ +@Fluent +public final class KeyVaultCredentialsPatchProperties implements JsonSerializable { + /* + * The uri to access the secret that the username is stored in. + */ + private String usernameKeyVaultSecretUri; + + /* + * The uri to access the secret that the password is stored in. + */ + private String passwordKeyVaultSecretUri; + + /** + * Creates an instance of KeyVaultCredentialsPatchProperties class. + */ + public KeyVaultCredentialsPatchProperties() { + } + + /** + * Get the usernameKeyVaultSecretUri property: The uri to access the secret that the username is stored in. + * + * @return the usernameKeyVaultSecretUri value. + */ + public String usernameKeyVaultSecretUri() { + return this.usernameKeyVaultSecretUri; + } + + /** + * Set the usernameKeyVaultSecretUri property: The uri to access the secret that the username is stored in. + * + * @param usernameKeyVaultSecretUri the usernameKeyVaultSecretUri value to set. + * @return the KeyVaultCredentialsPatchProperties object itself. + */ + public KeyVaultCredentialsPatchProperties withUsernameKeyVaultSecretUri(String usernameKeyVaultSecretUri) { + this.usernameKeyVaultSecretUri = usernameKeyVaultSecretUri; + return this; + } + + /** + * Get the passwordKeyVaultSecretUri property: The uri to access the secret that the password is stored in. + * + * @return the passwordKeyVaultSecretUri value. + */ + public String passwordKeyVaultSecretUri() { + return this.passwordKeyVaultSecretUri; + } + + /** + * Set the passwordKeyVaultSecretUri property: The uri to access the secret that the password is stored in. + * + * @param passwordKeyVaultSecretUri the passwordKeyVaultSecretUri value to set. + * @return the KeyVaultCredentialsPatchProperties object itself. + */ + public KeyVaultCredentialsPatchProperties withPasswordKeyVaultSecretUri(String passwordKeyVaultSecretUri) { + this.passwordKeyVaultSecretUri = passwordKeyVaultSecretUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("usernameKeyVaultSecretUri", this.usernameKeyVaultSecretUri); + jsonWriter.writeStringField("passwordKeyVaultSecretUri", this.passwordKeyVaultSecretUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyVaultCredentialsPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyVaultCredentialsPatchProperties 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 KeyVaultCredentialsPatchProperties. + */ + public static KeyVaultCredentialsPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyVaultCredentialsPatchProperties deserializedKeyVaultCredentialsPatchProperties + = new KeyVaultCredentialsPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("usernameKeyVaultSecretUri".equals(fieldName)) { + deserializedKeyVaultCredentialsPatchProperties.usernameKeyVaultSecretUri = reader.getString(); + } else if ("passwordKeyVaultSecretUri".equals(fieldName)) { + deserializedKeyVaultCredentialsPatchProperties.passwordKeyVaultSecretUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyVaultCredentialsPatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/KeyVaultCredentialsProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/KeyVaultCredentialsProperties.java new file mode 100644 index 000000000000..b06b3f93425d --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/KeyVaultCredentialsProperties.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Credentials kept in the keyvault. + */ +@Fluent +public final class KeyVaultCredentialsProperties implements JsonSerializable { + /* + * The uri to access the secret that the username is stored in. + */ + private String usernameKeyVaultSecretUri; + + /* + * The uri to access the secret that the password is stored in. + */ + private String passwordKeyVaultSecretUri; + + /** + * Creates an instance of KeyVaultCredentialsProperties class. + */ + public KeyVaultCredentialsProperties() { + } + + /** + * Get the usernameKeyVaultSecretUri property: The uri to access the secret that the username is stored in. + * + * @return the usernameKeyVaultSecretUri value. + */ + public String usernameKeyVaultSecretUri() { + return this.usernameKeyVaultSecretUri; + } + + /** + * Set the usernameKeyVaultSecretUri property: The uri to access the secret that the username is stored in. + * + * @param usernameKeyVaultSecretUri the usernameKeyVaultSecretUri value to set. + * @return the KeyVaultCredentialsProperties object itself. + */ + public KeyVaultCredentialsProperties withUsernameKeyVaultSecretUri(String usernameKeyVaultSecretUri) { + this.usernameKeyVaultSecretUri = usernameKeyVaultSecretUri; + return this; + } + + /** + * Get the passwordKeyVaultSecretUri property: The uri to access the secret that the password is stored in. + * + * @return the passwordKeyVaultSecretUri value. + */ + public String passwordKeyVaultSecretUri() { + return this.passwordKeyVaultSecretUri; + } + + /** + * Set the passwordKeyVaultSecretUri property: The uri to access the secret that the password is stored in. + * + * @param passwordKeyVaultSecretUri the passwordKeyVaultSecretUri value to set. + * @return the KeyVaultCredentialsProperties object itself. + */ + public KeyVaultCredentialsProperties withPasswordKeyVaultSecretUri(String passwordKeyVaultSecretUri) { + this.passwordKeyVaultSecretUri = passwordKeyVaultSecretUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (usernameKeyVaultSecretUri() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property usernameKeyVaultSecretUri in model KeyVaultCredentialsProperties")); + } + if (passwordKeyVaultSecretUri() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property passwordKeyVaultSecretUri in model KeyVaultCredentialsProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyVaultCredentialsProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("usernameKeyVaultSecretUri", this.usernameKeyVaultSecretUri); + jsonWriter.writeStringField("passwordKeyVaultSecretUri", this.passwordKeyVaultSecretUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyVaultCredentialsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyVaultCredentialsProperties 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 KeyVaultCredentialsProperties. + */ + public static KeyVaultCredentialsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyVaultCredentialsProperties deserializedKeyVaultCredentialsProperties + = new KeyVaultCredentialsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("usernameKeyVaultSecretUri".equals(fieldName)) { + deserializedKeyVaultCredentialsProperties.usernameKeyVaultSecretUri = reader.getString(); + } else if ("passwordKeyVaultSecretUri".equals(fieldName)) { + deserializedKeyVaultCredentialsProperties.passwordKeyVaultSecretUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyVaultCredentialsProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/LoadBalancerType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/LoadBalancerType.java index f147cea0d2dc..c8cbdb79cad0 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/LoadBalancerType.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/LoadBalancerType.java @@ -26,6 +26,11 @@ public final class LoadBalancerType extends ExpandableStringEnum { + /** + * Static value Default for ManagedPrivateUdp. + */ + public static final ManagedPrivateUdp DEFAULT = fromString("Default"); + + /** + * Static value Enabled for ManagedPrivateUdp. + */ + public static final ManagedPrivateUdp ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for ManagedPrivateUdp. + */ + public static final ManagedPrivateUdp DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of ManagedPrivateUdp value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedPrivateUdp() { + } + + /** + * Creates or finds a ManagedPrivateUdp from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedPrivateUdp. + */ + public static ManagedPrivateUdp fromString(String name) { + return fromString(name, ManagedPrivateUdp.class); + } + + /** + * Gets known ManagedPrivateUdp values. + * + * @return known ManagedPrivateUdp values. + */ + public static Collection values() { + return values(ManagedPrivateUdp.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ManagedServiceIdentity.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..8f0e6a2d7c30 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ManagedServiceIdentity.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +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; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + private ManagedServiceIdentityType type; + + /* + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will + * be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ + * userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. + */ + 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: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @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 set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); + + /** + * {@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/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ManagedServiceIdentityType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..27371b06ff30 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ManagedServiceIdentityType.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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 { + /** + * Static value None for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * Static value SystemAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Static value UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType. + */ + 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/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ManagementType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ManagementType.java new file mode 100644 index 000000000000..fe8b84847559 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ManagementType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of management for this hostpool, Automated or Standard. The default value is Automated. + */ +public final class ManagementType extends ExpandableStringEnum { + /** + * Static value Automated for ManagementType. + */ + public static final ManagementType AUTOMATED = fromString("Automated"); + + /** + * Static value Standard for ManagementType. + */ + public static final ManagementType STANDARD = fromString("Standard"); + + /** + * Creates a new instance of ManagementType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagementType() { + } + + /** + * Creates or finds a ManagementType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagementType. + */ + public static ManagementType fromString(String name) { + return fromString(name, ManagementType.class); + } + + /** + * Gets known ManagementType values. + * + * @return known ManagementType values. + */ + public static Collection values() { + return values(ManagementType.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MarketplaceInfoPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MarketplaceInfoPatchProperties.java new file mode 100644 index 000000000000..c1b1601f2f86 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MarketplaceInfoPatchProperties.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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; + +/** + * Marketplace image information. + */ +@Fluent +public final class MarketplaceInfoPatchProperties implements JsonSerializable { + /* + * The offer of the image. + */ + private String offer; + + /* + * The publisher of the image. + */ + private String publisher; + + /* + * The sku of the image. + */ + private String sku; + + /* + * The exact version of the image. + */ + private String exactVersion; + + /** + * Creates an instance of MarketplaceInfoPatchProperties class. + */ + public MarketplaceInfoPatchProperties() { + } + + /** + * Get the offer property: The offer of the image. + * + * @return the offer value. + */ + public String offer() { + return this.offer; + } + + /** + * Set the offer property: The offer of the image. + * + * @param offer the offer value to set. + * @return the MarketplaceInfoPatchProperties object itself. + */ + public MarketplaceInfoPatchProperties withOffer(String offer) { + this.offer = offer; + return this; + } + + /** + * Get the publisher property: The publisher of the image. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The publisher of the image. + * + * @param publisher the publisher value to set. + * @return the MarketplaceInfoPatchProperties object itself. + */ + public MarketplaceInfoPatchProperties withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the sku property: The sku of the image. + * + * @return the sku value. + */ + public String sku() { + return this.sku; + } + + /** + * Set the sku property: The sku of the image. + * + * @param sku the sku value to set. + * @return the MarketplaceInfoPatchProperties object itself. + */ + public MarketplaceInfoPatchProperties withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Get the exactVersion property: The exact version of the image. + * + * @return the exactVersion value. + */ + public String exactVersion() { + return this.exactVersion; + } + + /** + * Set the exactVersion property: The exact version of the image. + * + * @param exactVersion the exactVersion value to set. + * @return the MarketplaceInfoPatchProperties object itself. + */ + public MarketplaceInfoPatchProperties withExactVersion(String exactVersion) { + this.exactVersion = exactVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("offer", this.offer); + jsonWriter.writeStringField("publisher", this.publisher); + jsonWriter.writeStringField("sku", this.sku); + jsonWriter.writeStringField("exactVersion", this.exactVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MarketplaceInfoPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarketplaceInfoPatchProperties 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 MarketplaceInfoPatchProperties. + */ + public static MarketplaceInfoPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarketplaceInfoPatchProperties deserializedMarketplaceInfoPatchProperties + = new MarketplaceInfoPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("offer".equals(fieldName)) { + deserializedMarketplaceInfoPatchProperties.offer = reader.getString(); + } else if ("publisher".equals(fieldName)) { + deserializedMarketplaceInfoPatchProperties.publisher = reader.getString(); + } else if ("sku".equals(fieldName)) { + deserializedMarketplaceInfoPatchProperties.sku = reader.getString(); + } else if ("exactVersion".equals(fieldName)) { + deserializedMarketplaceInfoPatchProperties.exactVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMarketplaceInfoPatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MarketplaceInfoProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MarketplaceInfoProperties.java new file mode 100644 index 000000000000..de987b8bbcd5 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MarketplaceInfoProperties.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Marketplace image information. + */ +@Fluent +public final class MarketplaceInfoProperties implements JsonSerializable { + /* + * The offer of the image. + */ + private String offer; + + /* + * The publisher of the image. + */ + private String publisher; + + /* + * The sku of the image. + */ + private String sku; + + /* + * The exact version of the image. + */ + private String exactVersion; + + /** + * Creates an instance of MarketplaceInfoProperties class. + */ + public MarketplaceInfoProperties() { + } + + /** + * Get the offer property: The offer of the image. + * + * @return the offer value. + */ + public String offer() { + return this.offer; + } + + /** + * Set the offer property: The offer of the image. + * + * @param offer the offer value to set. + * @return the MarketplaceInfoProperties object itself. + */ + public MarketplaceInfoProperties withOffer(String offer) { + this.offer = offer; + return this; + } + + /** + * Get the publisher property: The publisher of the image. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The publisher of the image. + * + * @param publisher the publisher value to set. + * @return the MarketplaceInfoProperties object itself. + */ + public MarketplaceInfoProperties withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the sku property: The sku of the image. + * + * @return the sku value. + */ + public String sku() { + return this.sku; + } + + /** + * Set the sku property: The sku of the image. + * + * @param sku the sku value to set. + * @return the MarketplaceInfoProperties object itself. + */ + public MarketplaceInfoProperties withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Get the exactVersion property: The exact version of the image. + * + * @return the exactVersion value. + */ + public String exactVersion() { + return this.exactVersion; + } + + /** + * Set the exactVersion property: The exact version of the image. + * + * @param exactVersion the exactVersion value to set. + * @return the MarketplaceInfoProperties object itself. + */ + public MarketplaceInfoProperties withExactVersion(String exactVersion) { + this.exactVersion = exactVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (offer() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property offer in model MarketplaceInfoProperties")); + } + if (publisher() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property publisher in model MarketplaceInfoProperties")); + } + if (sku() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property sku in model MarketplaceInfoProperties")); + } + if (exactVersion() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property exactVersion in model MarketplaceInfoProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MarketplaceInfoProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("offer", this.offer); + jsonWriter.writeStringField("publisher", this.publisher); + jsonWriter.writeStringField("sku", this.sku); + jsonWriter.writeStringField("exactVersion", this.exactVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MarketplaceInfoProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarketplaceInfoProperties 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 MarketplaceInfoProperties. + */ + public static MarketplaceInfoProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarketplaceInfoProperties deserializedMarketplaceInfoProperties = new MarketplaceInfoProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("offer".equals(fieldName)) { + deserializedMarketplaceInfoProperties.offer = reader.getString(); + } else if ("publisher".equals(fieldName)) { + deserializedMarketplaceInfoProperties.publisher = reader.getString(); + } else if ("sku".equals(fieldName)) { + deserializedMarketplaceInfoProperties.sku = reader.getString(); + } else if ("exactVersion".equals(fieldName)) { + deserializedMarketplaceInfoProperties.exactVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMarketplaceInfoProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackage.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackage.java index b8747028e4ef..965fa626c20b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackage.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackage.java @@ -100,7 +100,7 @@ public interface MsixPackage { List packageDependencies(); /** - * Gets the version property: Package version found in the appxmanifest.xml. + * Gets the version property: Package Version found in the appxmanifest.xml. * * @return the version value. */ @@ -301,9 +301,9 @@ interface WithPackageDependencies { */ interface WithVersion { /** - * Specifies the version property: Package version found in the appxmanifest.xml. . + * Specifies the version property: Package Version found in the appxmanifest.xml. . * - * @param version Package version found in the appxmanifest.xml. + * @param version Package Version found in the appxmanifest.xml. * @return the next definition stage. */ WithCreate withVersion(String version); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageDependencies.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageDependencies.java index 8ca5b3da9a52..4ac69340d053 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageDependencies.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageDependencies.java @@ -17,7 +17,8 @@ @Fluent public final class MsixPackageDependencies implements JsonSerializable { /* - * Name of package dependency. + * Name of the package dependency. For Msix packages, this is the other packages this package depends upon, for + * APP-V packages this is the locations of the user and deployment config files */ private String dependencyName; @@ -38,7 +39,8 @@ public MsixPackageDependencies() { } /** - * Get the dependencyName property: Name of package dependency. + * Get the dependencyName property: Name of the package dependency. For Msix packages, this is the other packages + * this package depends upon, for APP-V packages this is the locations of the user and deployment config files. * * @return the dependencyName value. */ @@ -47,7 +49,8 @@ public String dependencyName() { } /** - * Set the dependencyName property: Name of package dependency. + * Set the dependencyName property: Name of the package dependency. For Msix packages, this is the other packages + * this package depends upon, for APP-V packages this is the locations of the user and deployment config files. * * @param dependencyName the dependencyName value to set. * @return the MsixPackageDependencies object itself. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/NetworkInfoPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/NetworkInfoPatchProperties.java new file mode 100644 index 000000000000..514497d4551a --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/NetworkInfoPatchProperties.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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; + +/** + * Network information. + */ +@Fluent +public final class NetworkInfoPatchProperties implements JsonSerializable { + /* + * The resource ID of the subnet. + */ + private String subnetId; + + /* + * The resource ID of the security group. Any allowable/open ports should be specified in the Network Security + * Group(NSG). + */ + private String securityGroupId; + + /** + * Creates an instance of NetworkInfoPatchProperties class. + */ + public NetworkInfoPatchProperties() { + } + + /** + * Get the subnetId property: The resource ID of the subnet. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The resource ID of the subnet. + * + * @param subnetId the subnetId value to set. + * @return the NetworkInfoPatchProperties object itself. + */ + public NetworkInfoPatchProperties withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the securityGroupId property: The resource ID of the security group. Any allowable/open ports should be + * specified in the Network Security Group(NSG). + * + * @return the securityGroupId value. + */ + public String securityGroupId() { + return this.securityGroupId; + } + + /** + * Set the securityGroupId property: The resource ID of the security group. Any allowable/open ports should be + * specified in the Network Security Group(NSG). + * + * @param securityGroupId the securityGroupId value to set. + * @return the NetworkInfoPatchProperties object itself. + */ + public NetworkInfoPatchProperties withSecurityGroupId(String securityGroupId) { + this.securityGroupId = securityGroupId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subnetId", this.subnetId); + jsonWriter.writeStringField("securityGroupId", this.securityGroupId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInfoPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInfoPatchProperties 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 NetworkInfoPatchProperties. + */ + public static NetworkInfoPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInfoPatchProperties deserializedNetworkInfoPatchProperties = new NetworkInfoPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnetId".equals(fieldName)) { + deserializedNetworkInfoPatchProperties.subnetId = reader.getString(); + } else if ("securityGroupId".equals(fieldName)) { + deserializedNetworkInfoPatchProperties.securityGroupId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInfoPatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/NetworkInfoProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/NetworkInfoProperties.java new file mode 100644 index 000000000000..9a3aef058dfe --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/NetworkInfoProperties.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Network information. + */ +@Fluent +public final class NetworkInfoProperties implements JsonSerializable { + /* + * The resource ID of the subnet. + */ + private String subnetId; + + /* + * The resource ID of the security group. Any allowable/open ports should be specified in the Network Security + * Group(NSG). + */ + private String securityGroupId; + + /** + * Creates an instance of NetworkInfoProperties class. + */ + public NetworkInfoProperties() { + } + + /** + * Get the subnetId property: The resource ID of the subnet. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The resource ID of the subnet. + * + * @param subnetId the subnetId value to set. + * @return the NetworkInfoProperties object itself. + */ + public NetworkInfoProperties withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the securityGroupId property: The resource ID of the security group. Any allowable/open ports should be + * specified in the Network Security Group(NSG). + * + * @return the securityGroupId value. + */ + public String securityGroupId() { + return this.securityGroupId; + } + + /** + * Set the securityGroupId property: The resource ID of the security group. Any allowable/open ports should be + * specified in the Network Security Group(NSG). + * + * @param securityGroupId the securityGroupId value to set. + * @return the NetworkInfoProperties object itself. + */ + public NetworkInfoProperties withSecurityGroupId(String securityGroupId) { + this.securityGroupId = securityGroupId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnetId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property subnetId in model NetworkInfoProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkInfoProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subnetId", this.subnetId); + jsonWriter.writeStringField("securityGroupId", this.securityGroupId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInfoProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInfoProperties 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 NetworkInfoProperties. + */ + public static NetworkInfoProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInfoProperties deserializedNetworkInfoProperties = new NetworkInfoProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnetId".equals(fieldName)) { + deserializedNetworkInfoProperties.subnetId = reader.getString(); + } else if ("securityGroupId".equals(fieldName)) { + deserializedNetworkInfoProperties.securityGroupId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInfoProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Plan.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Plan.java index 186476fb04f4..a1e82c59c776 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Plan.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Plan.java @@ -16,7 +16,7 @@ * Plan for the resource. */ @Fluent -public class Plan implements JsonSerializable { +public final class Plan implements JsonSerializable { /* * A user defined name of the 3rd Party Artifact that is being procured. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ProvisioningStateShc.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ProvisioningStateShc.java new file mode 100644 index 000000000000..0cf51541d59b --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ProvisioningStateShc.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of the Session Host Configuration. + */ +public final class ProvisioningStateShc extends ExpandableStringEnum { + /** + * Static value Succeeded for ProvisioningStateShc. + */ + public static final ProvisioningStateShc SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for ProvisioningStateShc. + */ + public static final ProvisioningStateShc FAILED = fromString("Failed"); + + /** + * Static value Canceled for ProvisioningStateShc. + */ + public static final ProvisioningStateShc CANCELED = fromString("Canceled"); + + /** + * Static value Provisioning for ProvisioningStateShc. + */ + public static final ProvisioningStateShc PROVISIONING = fromString("Provisioning"); + + /** + * Creates a new instance of ProvisioningStateShc value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningStateShc() { + } + + /** + * Creates or finds a ProvisioningStateShc from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningStateShc. + */ + public static ProvisioningStateShc fromString(String name) { + return fromString(name, ProvisioningStateShc.class); + } + + /** + * Gets known ProvisioningStateShc values. + * + * @return known ProvisioningStateShc values. + */ + public static Collection values() { + return values(ProvisioningStateShc.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PublicUdp.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PublicUdp.java new file mode 100644 index 000000000000..dc6f647844a9 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PublicUdp.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection + * type when making connections. This means that this connection is possible, but is not guaranteed, as there are other + * factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making + * connections. + */ +public final class PublicUdp extends ExpandableStringEnum { + /** + * Static value Default for PublicUdp. + */ + public static final PublicUdp DEFAULT = fromString("Default"); + + /** + * Static value Enabled for PublicUdp. + */ + public static final PublicUdp ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for PublicUdp. + */ + public static final PublicUdp DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of PublicUdp value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicUdp() { + } + + /** + * Creates or finds a PublicUdp from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicUdp. + */ + public static PublicUdp fromString(String name) { + return fromString(name, PublicUdp.class); + } + + /** + * Gets known PublicUdp values. + * + * @return known PublicUdp values. + */ + public static Collection values() { + return values(PublicUdp.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfoPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfoPatch.java index 62437ac69794..ea65f0b88feb 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfoPatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfoPatch.java @@ -15,7 +15,8 @@ import java.time.format.DateTimeFormatter; /** - * Represents a RegistrationInfo definition. + * Represents a RegistrationInfo definition. This is not returned on HostPool GET. In order to get the registration + * token use the retrieveRegistrationToken or listRegistrationTokens POST calls. */ @Fluent public final class RegistrationInfoPatch implements JsonSerializable { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RelayUdp.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RelayUdp.java new file mode 100644 index 000000000000..4d12e72bfa30 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RelayUdp.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection + * type when making connections. This means that this connection is possible, but is not guaranteed, as there are other + * factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making + * connections. + */ +public final class RelayUdp extends ExpandableStringEnum { + /** + * Static value Default for RelayUdp. + */ + public static final RelayUdp DEFAULT = fromString("Default"); + + /** + * Static value Enabled for RelayUdp. + */ + public static final RelayUdp ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for RelayUdp. + */ + public static final RelayUdp DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of RelayUdp value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RelayUdp() { + } + + /** + * Creates or finds a RelayUdp from its string representation. + * + * @param name a name to look for. + * @return the corresponding RelayUdp. + */ + public static RelayUdp fromString(String name) { + return fromString(name, RelayUdp.class); + } + + /** + * Gets known RelayUdp values. + * + * @return known RelayUdp values. + */ + public static Collection values() { + return values(RelayUdp.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceIdentityType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceIdentityType.java deleted file mode 100644 index dff980ba0041..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceIdentityType.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.models; - -/** - * The identity type. - */ -public enum ResourceIdentityType { - /** - * Enum value SystemAssigned. - */ - SYSTEM_ASSIGNED("SystemAssigned"); - - /** - * The actual serialized value for a ResourceIdentityType instance. - */ - private final String value; - - ResourceIdentityType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ResourceIdentityType instance. - * - * @param value the serialized value to parse. - * @return the parsed ResourceIdentityType object, or null if unable to parse. - */ - public static ResourceIdentityType fromString(String value) { - if (value == null) { - return null; - } - ResourceIdentityType[] items = ResourceIdentityType.values(); - for (ResourceIdentityType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySet.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySet.java index 9aedb9b65aec..4c59d68e7666 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySet.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySet.java @@ -42,19 +42,19 @@ public class ResourceModelWithAllowedPropertySet extends Resource { private String etag; /* - * The identity property. + * Managed service identity (system assigned and/or user assigned identities) */ - private ResourceModelWithAllowedPropertySetIdentity identity; + private ManagedServiceIdentity identity; /* - * The sku property. + * The resource model definition representing SKU */ - private ResourceModelWithAllowedPropertySetSku sku; + private Sku sku; /* - * The plan property. + * Plan for the resource. */ - private ResourceModelWithAllowedPropertySetPlan plan; + private Plan plan; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -157,61 +157,61 @@ ResourceModelWithAllowedPropertySet withEtag(String etag) { } /** - * Get the identity property: The identity property. + * Get the identity property: Managed service identity (system assigned and/or user assigned identities). * * @return the identity value. */ - public ResourceModelWithAllowedPropertySetIdentity identity() { + public ManagedServiceIdentity identity() { return this.identity; } /** - * Set the identity property: The identity property. + * Set the identity property: Managed service identity (system assigned and/or user assigned identities). * * @param identity the identity value to set. * @return the ResourceModelWithAllowedPropertySet object itself. */ - public ResourceModelWithAllowedPropertySet withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { + public ResourceModelWithAllowedPropertySet withIdentity(ManagedServiceIdentity identity) { this.identity = identity; return this; } /** - * Get the sku property: The sku property. + * Get the sku property: The resource model definition representing SKU. * * @return the sku value. */ - public ResourceModelWithAllowedPropertySetSku sku() { + public Sku sku() { return this.sku; } /** - * Set the sku property: The sku property. + * Set the sku property: The resource model definition representing SKU. * * @param sku the sku value to set. * @return the ResourceModelWithAllowedPropertySet object itself. */ - public ResourceModelWithAllowedPropertySet withSku(ResourceModelWithAllowedPropertySetSku sku) { + public ResourceModelWithAllowedPropertySet withSku(Sku sku) { this.sku = sku; return this; } /** - * Get the plan property: The plan property. + * Get the plan property: Plan for the resource. * * @return the plan value. */ - public ResourceModelWithAllowedPropertySetPlan plan() { + public Plan plan() { return this.plan; } /** - * Set the plan property: The plan property. + * Set the plan property: Plan for the resource. * * @param plan the plan value to set. * @return the ResourceModelWithAllowedPropertySet object itself. */ - public ResourceModelWithAllowedPropertySet withPlan(ResourceModelWithAllowedPropertySetPlan plan) { + public ResourceModelWithAllowedPropertySet withPlan(Plan plan) { this.plan = plan; return this; } @@ -352,14 +352,11 @@ public static ResourceModelWithAllowedPropertySet fromJson(JsonReader jsonReader } else if ("etag".equals(fieldName)) { deserializedResourceModelWithAllowedPropertySet.etag = reader.getString(); } else if ("identity".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySet.identity - = ResourceModelWithAllowedPropertySetIdentity.fromJson(reader); + deserializedResourceModelWithAllowedPropertySet.identity = ManagedServiceIdentity.fromJson(reader); } else if ("sku".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySet.sku - = ResourceModelWithAllowedPropertySetSku.fromJson(reader); + deserializedResourceModelWithAllowedPropertySet.sku = Sku.fromJson(reader); } else if ("plan".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySet.plan - = ResourceModelWithAllowedPropertySetPlan.fromJson(reader); + deserializedResourceModelWithAllowedPropertySet.plan = Plan.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedResourceModelWithAllowedPropertySet.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetIdentity.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetIdentity.java deleted file mode 100644 index b99fa42e67c4..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetIdentity.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ResourceModelWithAllowedPropertySetIdentity model. - */ -@Fluent -public final class ResourceModelWithAllowedPropertySetIdentity extends Identity { - /* - * The tenant ID of resource. The value must be an UUID. - */ - private String tenantId; - - /* - * The principal ID of resource identity. The value must be an UUID. - */ - private String principalId; - - /** - * Creates an instance of ResourceModelWithAllowedPropertySetIdentity class. - */ - public ResourceModelWithAllowedPropertySetIdentity() { - } - - /** - * Get the tenantId property: The tenant ID of resource. The value must be an UUID. - * - * @return the tenantId value. - */ - @Override - public String tenantId() { - return this.tenantId; - } - - /** - * Get the principalId property: The principal ID of resource identity. The value must be an UUID. - * - * @return the principalId value. - */ - @Override - public String principalId() { - return this.principalId; - } - - /** - * {@inheritDoc} - */ - @Override - public ResourceModelWithAllowedPropertySetIdentity withType(ResourceIdentityType type) { - super.withType(type); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", type() == null ? null : type().toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceModelWithAllowedPropertySetIdentity from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceModelWithAllowedPropertySetIdentity 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 ResourceModelWithAllowedPropertySetIdentity. - */ - public static ResourceModelWithAllowedPropertySetIdentity fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceModelWithAllowedPropertySetIdentity deserializedResourceModelWithAllowedPropertySetIdentity - = new ResourceModelWithAllowedPropertySetIdentity(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("principalId".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySetIdentity.principalId = reader.getString(); - } else if ("tenantId".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySetIdentity.tenantId = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySetIdentity - .withType(ResourceIdentityType.fromString(reader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedResourceModelWithAllowedPropertySetIdentity; - }); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetPlan.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetPlan.java deleted file mode 100644 index 730de7e2e1c1..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetPlan.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ResourceModelWithAllowedPropertySetPlan model. - */ -@Fluent -public final class ResourceModelWithAllowedPropertySetPlan extends Plan { - /** - * Creates an instance of ResourceModelWithAllowedPropertySetPlan class. - */ - public ResourceModelWithAllowedPropertySetPlan() { - } - - /** - * {@inheritDoc} - */ - @Override - public ResourceModelWithAllowedPropertySetPlan withName(String name) { - super.withName(name); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ResourceModelWithAllowedPropertySetPlan withPublisher(String publisher) { - super.withPublisher(publisher); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ResourceModelWithAllowedPropertySetPlan withProduct(String product) { - super.withProduct(product); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ResourceModelWithAllowedPropertySetPlan withPromotionCode(String promotionCode) { - super.withPromotionCode(promotionCode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ResourceModelWithAllowedPropertySetPlan withVersion(String version) { - super.withVersion(version); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (name() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property name in model ResourceModelWithAllowedPropertySetPlan")); - } - if (publisher() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property publisher in model ResourceModelWithAllowedPropertySetPlan")); - } - if (product() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property product in model ResourceModelWithAllowedPropertySetPlan")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ResourceModelWithAllowedPropertySetPlan.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", name()); - jsonWriter.writeStringField("publisher", publisher()); - jsonWriter.writeStringField("product", product()); - jsonWriter.writeStringField("promotionCode", promotionCode()); - jsonWriter.writeStringField("version", version()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceModelWithAllowedPropertySetPlan from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceModelWithAllowedPropertySetPlan 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 ResourceModelWithAllowedPropertySetPlan. - */ - public static ResourceModelWithAllowedPropertySetPlan fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceModelWithAllowedPropertySetPlan deserializedResourceModelWithAllowedPropertySetPlan - = new ResourceModelWithAllowedPropertySetPlan(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySetPlan.withName(reader.getString()); - } else if ("publisher".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySetPlan.withPublisher(reader.getString()); - } else if ("product".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySetPlan.withProduct(reader.getString()); - } else if ("promotionCode".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySetPlan.withPromotionCode(reader.getString()); - } else if ("version".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySetPlan.withVersion(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedResourceModelWithAllowedPropertySetPlan; - }); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetSku.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetSku.java deleted file mode 100644 index 89db30dd82de..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetSku.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ResourceModelWithAllowedPropertySetSku model. - */ -@Fluent -public final class ResourceModelWithAllowedPropertySetSku extends Sku { - /** - * Creates an instance of ResourceModelWithAllowedPropertySetSku class. - */ - public ResourceModelWithAllowedPropertySetSku() { - } - - /** - * {@inheritDoc} - */ - @Override - public ResourceModelWithAllowedPropertySetSku withName(String name) { - super.withName(name); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ResourceModelWithAllowedPropertySetSku withTier(SkuTier tier) { - super.withTier(tier); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ResourceModelWithAllowedPropertySetSku withSize(String size) { - super.withSize(size); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ResourceModelWithAllowedPropertySetSku withFamily(String family) { - super.withFamily(family); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ResourceModelWithAllowedPropertySetSku withCapacity(Integer capacity) { - super.withCapacity(capacity); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (name() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property name in model ResourceModelWithAllowedPropertySetSku")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ResourceModelWithAllowedPropertySetSku.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", name()); - jsonWriter.writeStringField("tier", tier() == null ? null : tier().toString()); - jsonWriter.writeStringField("size", size()); - jsonWriter.writeStringField("family", family()); - jsonWriter.writeNumberField("capacity", capacity()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceModelWithAllowedPropertySetSku from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceModelWithAllowedPropertySetSku 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 ResourceModelWithAllowedPropertySetSku. - */ - public static ResourceModelWithAllowedPropertySetSku fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceModelWithAllowedPropertySetSku deserializedResourceModelWithAllowedPropertySetSku - = new ResourceModelWithAllowedPropertySetSku(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySetSku.withName(reader.getString()); - } else if ("tier".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySetSku.withTier(SkuTier.fromString(reader.getString())); - } else if ("size".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySetSku.withSize(reader.getString()); - } else if ("family".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySetSku.withFamily(reader.getString()); - } else if ("capacity".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySetSku - .withCapacity(reader.getNullable(JsonReader::getInt)); - } else { - reader.skipChildren(); - } - } - - return deserializedResourceModelWithAllowedPropertySetSku; - }); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingHostPoolType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingHostPoolType.java index a0adf00e37b5..fe77b7a9fcc7 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingHostPoolType.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingHostPoolType.java @@ -16,6 +16,11 @@ public final class ScalingHostPoolType extends ExpandableStringEnum { + /** + * Static value PowerManage for ScalingMethod. + */ + public static final ScalingMethod POWER_MANAGE = fromString("PowerManage"); + + /** + * Static value CreateDeletePowerManage for ScalingMethod. + */ + public static final ScalingMethod CREATE_DELETE_POWER_MANAGE = fromString("CreateDeletePowerManage"); + + /** + * Creates a new instance of ScalingMethod value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScalingMethod() { + } + + /** + * Creates or finds a ScalingMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScalingMethod. + */ + public static ScalingMethod fromString(String name) { + return fromString(name, ScalingMethod.class); + } + + /** + * Gets known ScalingMethod values. + * + * @return known ScalingMethod values. + */ + public static Collection values() { + return values(ScalingMethod.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlan.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlan.java index 1c7e1041fdfc..3f5d875940c5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlan.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlan.java @@ -79,25 +79,25 @@ public interface ScalingPlan { String etag(); /** - * Gets the identity property: The identity property. + * Gets the identity property: Managed service identity (system assigned and/or user assigned identities). * * @return the identity value. */ - ResourceModelWithAllowedPropertySetIdentity identity(); + ManagedServiceIdentity identity(); /** - * Gets the sku property: The sku property. + * Gets the sku property: The resource model definition representing SKU. * * @return the sku value. */ - ResourceModelWithAllowedPropertySetSku sku(); + Sku sku(); /** - * Gets the plan property: The plan property. + * Gets the plan property: Plan for the resource. * * @return the plan value. */ - ResourceModelWithAllowedPropertySetPlan plan(); + Plan plan(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -149,7 +149,7 @@ public interface ScalingPlan { String exclusionTag(); /** - * Gets the schedules property: List of ScalingPlanPooledSchedule definitions. + * Gets the schedules property: List of Pooled ScalingSchedule definitions. * * @return the schedules value. */ @@ -332,12 +332,13 @@ interface WithKind { */ interface WithIdentity { /** - * Specifies the identity property: The identity property.. + * Specifies the identity property: Managed service identity (system assigned and/or user assigned + * identities). * - * @param identity The identity property. + * @param identity Managed service identity (system assigned and/or user assigned identities). * @return the next definition stage. */ - WithCreate withIdentity(ResourceModelWithAllowedPropertySetIdentity identity); + WithCreate withIdentity(ManagedServiceIdentity identity); } /** @@ -345,12 +346,12 @@ interface WithIdentity { */ interface WithSku { /** - * Specifies the sku property: The sku property.. + * Specifies the sku property: The resource model definition representing SKU. * - * @param sku The sku property. + * @param sku The resource model definition representing SKU. * @return the next definition stage. */ - WithCreate withSku(ResourceModelWithAllowedPropertySetSku sku); + WithCreate withSku(Sku sku); } /** @@ -358,12 +359,12 @@ interface WithSku { */ interface WithPlan { /** - * Specifies the plan property: The plan property.. + * Specifies the plan property: Plan for the resource.. * - * @param plan The plan property. + * @param plan Plan for the resource. * @return the next definition stage. */ - WithCreate withPlan(ResourceModelWithAllowedPropertySetPlan plan); + WithCreate withPlan(Plan plan); } /** @@ -423,9 +424,9 @@ interface WithExclusionTag { */ interface WithSchedules { /** - * Specifies the schedules property: List of ScalingPlanPooledSchedule definitions.. + * Specifies the schedules property: List of Pooled ScalingSchedule definitions.. * - * @param schedules List of ScalingPlanPooledSchedule definitions. + * @param schedules List of Pooled ScalingSchedule definitions. * @return the next definition stage. */ WithCreate withSchedules(List schedules); @@ -548,9 +549,9 @@ interface WithExclusionTag { */ interface WithSchedules { /** - * Specifies the schedules property: List of ScalingSchedule definitions.. + * Specifies the schedules property: List Pooled ScalingSchedule definitions.. * - * @param schedules List of ScalingSchedule definitions. + * @param schedules List Pooled ScalingSchedule definitions. * @return the next definition stage. */ Update withSchedules(List schedules); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPatch.java index 76138d328cca..de2b2c9c9714 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPatch.java @@ -157,7 +157,7 @@ public ScalingPlanPatch withExclusionTag(String exclusionTag) { } /** - * Get the schedules property: List of ScalingSchedule definitions. + * Get the schedules property: List Pooled ScalingSchedule definitions. * * @return the schedules value. */ @@ -166,7 +166,7 @@ public List schedules() { } /** - * Set the schedules property: List of ScalingSchedule definitions. + * Set the schedules property: List Pooled ScalingSchedule definitions. * * @param schedules the schedules value to set. * @return the ScalingPlanPatch object itself. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedule.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedule.java index 5db3c022ee7d..d7f56ab2d7d7 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedule.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedule.java @@ -257,8 +257,9 @@ public interface ScalingPlanPersonalSchedule { /** * The entirety of the ScalingPlanPersonalSchedule definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithDaysOfWeek, DefinitionStages.WithRampUpStartTime, DefinitionStages.WithPeakStartTime, + DefinitionStages.WithRampDownStartTime, DefinitionStages.WithOffPeakStartTime, DefinitionStages.WithCreate { } /** @@ -282,66 +283,103 @@ interface WithParentResource { * @param scalingPlanName The name of the scaling plan. * @return the next definition stage. */ - WithCreate withExistingScalingPlan(String resourceGroupName, String scalingPlanName); + WithDaysOfWeek withExistingScalingPlan(String resourceGroupName, String scalingPlanName); } /** - * The stage of the ScalingPlanPersonalSchedule 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. + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify daysOfWeek. */ - interface WithCreate extends DefinitionStages.WithDaysOfWeek, DefinitionStages.WithRampUpStartTime, - DefinitionStages.WithRampUpAutoStartHosts, DefinitionStages.WithRampUpStartVMOnConnect, - DefinitionStages.WithRampUpActionOnDisconnect, DefinitionStages.WithRampUpMinutesToWaitOnDisconnect, - DefinitionStages.WithRampUpActionOnLogoff, DefinitionStages.WithRampUpMinutesToWaitOnLogoff, - DefinitionStages.WithPeakStartTime, DefinitionStages.WithPeakStartVMOnConnect, - DefinitionStages.WithPeakActionOnDisconnect, DefinitionStages.WithPeakMinutesToWaitOnDisconnect, - DefinitionStages.WithPeakActionOnLogoff, DefinitionStages.WithPeakMinutesToWaitOnLogoff, - DefinitionStages.WithRampDownStartTime, DefinitionStages.WithRampDownStartVMOnConnect, - DefinitionStages.WithRampDownActionOnDisconnect, DefinitionStages.WithRampDownMinutesToWaitOnDisconnect, - DefinitionStages.WithRampDownActionOnLogoff, DefinitionStages.WithRampDownMinutesToWaitOnLogoff, - DefinitionStages.WithOffPeakStartTime, DefinitionStages.WithOffPeakStartVMOnConnect, - DefinitionStages.WithOffPeakActionOnDisconnect, DefinitionStages.WithOffPeakMinutesToWaitOnDisconnect, - DefinitionStages.WithOffPeakActionOnLogoff, DefinitionStages.WithOffPeakMinutesToWaitOnLogoff { + interface WithDaysOfWeek { /** - * Executes the create request. + * Specifies the daysOfWeek property: Set of days of the week on which this schedule is active.. * - * @return the created resource. + * @param daysOfWeek Set of days of the week on which this schedule is active. + * @return the next definition stage. */ - ScalingPlanPersonalSchedule create(); + WithRampUpStartTime withDaysOfWeek(List daysOfWeek); + } + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampUpStartTime. + */ + interface WithRampUpStartTime { /** - * Executes the create request. + * Specifies the rampUpStartTime property: Starting time for ramp up period.. * - * @param context The context to associate with this operation. - * @return the created resource. + * @param rampUpStartTime Starting time for ramp up period. + * @return the next definition stage. */ - ScalingPlanPersonalSchedule create(Context context); + WithPeakStartTime withRampUpStartTime(Time rampUpStartTime); } /** - * The stage of the ScalingPlanPersonalSchedule definition allowing to specify daysOfWeek. + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify peakStartTime. */ - interface WithDaysOfWeek { + interface WithPeakStartTime { /** - * Specifies the daysOfWeek property: Set of days of the week on which this schedule is active.. + * Specifies the peakStartTime property: Starting time for peak period.. * - * @param daysOfWeek Set of days of the week on which this schedule is active. + * @param peakStartTime Starting time for peak period. * @return the next definition stage. */ - WithCreate withDaysOfWeek(List daysOfWeek); + WithRampDownStartTime withPeakStartTime(Time peakStartTime); } /** - * The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampUpStartTime. + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampDownStartTime. */ - interface WithRampUpStartTime { + interface WithRampDownStartTime { /** - * Specifies the rampUpStartTime property: Starting time for ramp up period.. + * Specifies the rampDownStartTime property: Starting time for ramp down period.. * - * @param rampUpStartTime Starting time for ramp up period. + * @param rampDownStartTime Starting time for ramp down period. * @return the next definition stage. */ - WithCreate withRampUpStartTime(Time rampUpStartTime); + WithOffPeakStartTime withRampDownStartTime(Time rampDownStartTime); + } + + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify offPeakStartTime. + */ + interface WithOffPeakStartTime { + /** + * Specifies the offPeakStartTime property: Starting time for off-peak period.. + * + * @param offPeakStartTime Starting time for off-peak period. + * @return the next definition stage. + */ + WithCreate withOffPeakStartTime(Time offPeakStartTime); + } + + /** + * The stage of the ScalingPlanPersonalSchedule 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.WithRampUpAutoStartHosts, + DefinitionStages.WithRampUpStartVMOnConnect, DefinitionStages.WithRampUpActionOnDisconnect, + DefinitionStages.WithRampUpMinutesToWaitOnDisconnect, DefinitionStages.WithRampUpActionOnLogoff, + DefinitionStages.WithRampUpMinutesToWaitOnLogoff, DefinitionStages.WithPeakStartVMOnConnect, + DefinitionStages.WithPeakActionOnDisconnect, DefinitionStages.WithPeakMinutesToWaitOnDisconnect, + DefinitionStages.WithPeakActionOnLogoff, DefinitionStages.WithPeakMinutesToWaitOnLogoff, + DefinitionStages.WithRampDownStartVMOnConnect, DefinitionStages.WithRampDownActionOnDisconnect, + DefinitionStages.WithRampDownMinutesToWaitOnDisconnect, DefinitionStages.WithRampDownActionOnLogoff, + DefinitionStages.WithRampDownMinutesToWaitOnLogoff, DefinitionStages.WithOffPeakStartVMOnConnect, + DefinitionStages.WithOffPeakActionOnDisconnect, DefinitionStages.WithOffPeakMinutesToWaitOnDisconnect, + DefinitionStages.WithOffPeakActionOnLogoff, DefinitionStages.WithOffPeakMinutesToWaitOnLogoff { + /** + * Executes the create request. + * + * @return the created resource. + */ + ScalingPlanPersonalSchedule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ScalingPlanPersonalSchedule create(Context context); } /** @@ -434,19 +472,6 @@ interface WithRampUpMinutesToWaitOnLogoff { WithCreate withRampUpMinutesToWaitOnLogoff(Integer rampUpMinutesToWaitOnLogoff); } - /** - * The stage of the ScalingPlanPersonalSchedule definition allowing to specify peakStartTime. - */ - interface WithPeakStartTime { - /** - * Specifies the peakStartTime property: Starting time for peak period.. - * - * @param peakStartTime Starting time for peak period. - * @return the next definition stage. - */ - WithCreate withPeakStartTime(Time peakStartTime); - } - /** * The stage of the ScalingPlanPersonalSchedule definition allowing to specify peakStartVMOnConnect. */ @@ -519,19 +544,6 @@ interface WithPeakMinutesToWaitOnLogoff { WithCreate withPeakMinutesToWaitOnLogoff(Integer peakMinutesToWaitOnLogoff); } - /** - * The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampDownStartTime. - */ - interface WithRampDownStartTime { - /** - * Specifies the rampDownStartTime property: Starting time for ramp down period.. - * - * @param rampDownStartTime Starting time for ramp down period. - * @return the next definition stage. - */ - WithCreate withRampDownStartTime(Time rampDownStartTime); - } - /** * The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampDownStartVMOnConnect. */ @@ -606,19 +618,6 @@ interface WithRampDownMinutesToWaitOnLogoff { WithCreate withRampDownMinutesToWaitOnLogoff(Integer rampDownMinutesToWaitOnLogoff); } - /** - * The stage of the ScalingPlanPersonalSchedule definition allowing to specify offPeakStartTime. - */ - interface WithOffPeakStartTime { - /** - * Specifies the offPeakStartTime property: Starting time for off-peak period.. - * - * @param offPeakStartTime Starting time for off-peak period. - * @return the next definition stage. - */ - WithCreate withOffPeakStartTime(Time offPeakStartTime); - } - /** * The stage of the ScalingPlanPersonalSchedule definition allowing to specify offPeakStartVMOnConnect. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedulePatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedulePatch.java index 3fcce4e285df..5122546c4f4d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedulePatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedulePatch.java @@ -9,7 +9,7 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPersonalScheduleProperties; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPersonalSchedulePatchProperties; import java.io.IOException; import java.util.List; @@ -21,7 +21,7 @@ public final class ScalingPlanPersonalSchedulePatch implements JsonSerializable< /* * Detailed properties for ScalingPlanPersonalSchedule */ - private ScalingPlanPersonalScheduleProperties innerProperties; + private ScalingPlanPersonalSchedulePatchProperties innerProperties; /** * Creates an instance of ScalingPlanPersonalSchedulePatch class. @@ -34,7 +34,7 @@ public ScalingPlanPersonalSchedulePatch() { * * @return the innerProperties value. */ - private ScalingPlanPersonalScheduleProperties innerProperties() { + private ScalingPlanPersonalSchedulePatchProperties innerProperties() { return this.innerProperties; } @@ -55,7 +55,7 @@ public List daysOfWeek() { */ public ScalingPlanPersonalSchedulePatch withDaysOfWeek(List daysOfWeek) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withDaysOfWeek(daysOfWeek); return this; @@ -78,7 +78,7 @@ public Time rampUpStartTime() { */ public ScalingPlanPersonalSchedulePatch withRampUpStartTime(Time rampUpStartTime) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withRampUpStartTime(rampUpStartTime); return this; @@ -103,7 +103,7 @@ public StartupBehavior rampUpAutoStartHosts() { */ public ScalingPlanPersonalSchedulePatch withRampUpAutoStartHosts(StartupBehavior rampUpAutoStartHosts) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withRampUpAutoStartHosts(rampUpAutoStartHosts); return this; @@ -130,7 +130,7 @@ public SetStartVMOnConnect rampUpStartVMOnConnect() { */ public ScalingPlanPersonalSchedulePatch withRampUpStartVMOnConnect(SetStartVMOnConnect rampUpStartVMOnConnect) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withRampUpStartVMOnConnect(rampUpStartVMOnConnect); return this; @@ -154,7 +154,7 @@ public SessionHandlingOperation rampUpActionOnDisconnect() { public ScalingPlanPersonalSchedulePatch withRampUpActionOnDisconnect(SessionHandlingOperation rampUpActionOnDisconnect) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withRampUpActionOnDisconnect(rampUpActionOnDisconnect); return this; @@ -180,7 +180,7 @@ public Integer rampUpMinutesToWaitOnDisconnect() { public ScalingPlanPersonalSchedulePatch withRampUpMinutesToWaitOnDisconnect(Integer rampUpMinutesToWaitOnDisconnect) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withRampUpMinutesToWaitOnDisconnect(rampUpMinutesToWaitOnDisconnect); return this; @@ -203,7 +203,7 @@ public SessionHandlingOperation rampUpActionOnLogoff() { */ public ScalingPlanPersonalSchedulePatch withRampUpActionOnLogoff(SessionHandlingOperation rampUpActionOnLogoff) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withRampUpActionOnLogoff(rampUpActionOnLogoff); return this; @@ -228,7 +228,7 @@ public Integer rampUpMinutesToWaitOnLogoff() { */ public ScalingPlanPersonalSchedulePatch withRampUpMinutesToWaitOnLogoff(Integer rampUpMinutesToWaitOnLogoff) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withRampUpMinutesToWaitOnLogoff(rampUpMinutesToWaitOnLogoff); return this; @@ -251,7 +251,7 @@ public Time peakStartTime() { */ public ScalingPlanPersonalSchedulePatch withPeakStartTime(Time peakStartTime) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withPeakStartTime(peakStartTime); return this; @@ -276,7 +276,7 @@ public SetStartVMOnConnect peakStartVMOnConnect() { */ public ScalingPlanPersonalSchedulePatch withPeakStartVMOnConnect(SetStartVMOnConnect peakStartVMOnConnect) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withPeakStartVMOnConnect(peakStartVMOnConnect); return this; @@ -300,7 +300,7 @@ public SessionHandlingOperation peakActionOnDisconnect() { public ScalingPlanPersonalSchedulePatch withPeakActionOnDisconnect(SessionHandlingOperation peakActionOnDisconnect) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withPeakActionOnDisconnect(peakActionOnDisconnect); return this; @@ -325,7 +325,7 @@ public Integer peakMinutesToWaitOnDisconnect() { */ public ScalingPlanPersonalSchedulePatch withPeakMinutesToWaitOnDisconnect(Integer peakMinutesToWaitOnDisconnect) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withPeakMinutesToWaitOnDisconnect(peakMinutesToWaitOnDisconnect); return this; @@ -348,7 +348,7 @@ public SessionHandlingOperation peakActionOnLogoff() { */ public ScalingPlanPersonalSchedulePatch withPeakActionOnLogoff(SessionHandlingOperation peakActionOnLogoff) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withPeakActionOnLogoff(peakActionOnLogoff); return this; @@ -373,7 +373,7 @@ public Integer peakMinutesToWaitOnLogoff() { */ public ScalingPlanPersonalSchedulePatch withPeakMinutesToWaitOnLogoff(Integer peakMinutesToWaitOnLogoff) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withPeakMinutesToWaitOnLogoff(peakMinutesToWaitOnLogoff); return this; @@ -396,7 +396,7 @@ public Time rampDownStartTime() { */ public ScalingPlanPersonalSchedulePatch withRampDownStartTime(Time rampDownStartTime) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withRampDownStartTime(rampDownStartTime); return this; @@ -421,7 +421,7 @@ public SetStartVMOnConnect rampDownStartVMOnConnect() { */ public ScalingPlanPersonalSchedulePatch withRampDownStartVMOnConnect(SetStartVMOnConnect rampDownStartVMOnConnect) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withRampDownStartVMOnConnect(rampDownStartVMOnConnect); return this; @@ -447,7 +447,7 @@ public SessionHandlingOperation rampDownActionOnDisconnect() { public ScalingPlanPersonalSchedulePatch withRampDownActionOnDisconnect(SessionHandlingOperation rampDownActionOnDisconnect) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withRampDownActionOnDisconnect(rampDownActionOnDisconnect); return this; @@ -473,7 +473,7 @@ public Integer rampDownMinutesToWaitOnDisconnect() { public ScalingPlanPersonalSchedulePatch withRampDownMinutesToWaitOnDisconnect(Integer rampDownMinutesToWaitOnDisconnect) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withRampDownMinutesToWaitOnDisconnect(rampDownMinutesToWaitOnDisconnect); return this; @@ -497,7 +497,7 @@ public SessionHandlingOperation rampDownActionOnLogoff() { public ScalingPlanPersonalSchedulePatch withRampDownActionOnLogoff(SessionHandlingOperation rampDownActionOnLogoff) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withRampDownActionOnLogoff(rampDownActionOnLogoff); return this; @@ -522,7 +522,7 @@ public Integer rampDownMinutesToWaitOnLogoff() { */ public ScalingPlanPersonalSchedulePatch withRampDownMinutesToWaitOnLogoff(Integer rampDownMinutesToWaitOnLogoff) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withRampDownMinutesToWaitOnLogoff(rampDownMinutesToWaitOnLogoff); return this; @@ -545,7 +545,7 @@ public Time offPeakStartTime() { */ public ScalingPlanPersonalSchedulePatch withOffPeakStartTime(Time offPeakStartTime) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withOffPeakStartTime(offPeakStartTime); return this; @@ -570,7 +570,7 @@ public SetStartVMOnConnect offPeakStartVMOnConnect() { */ public ScalingPlanPersonalSchedulePatch withOffPeakStartVMOnConnect(SetStartVMOnConnect offPeakStartVMOnConnect) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withOffPeakStartVMOnConnect(offPeakStartVMOnConnect); return this; @@ -596,7 +596,7 @@ public SessionHandlingOperation offPeakActionOnDisconnect() { public ScalingPlanPersonalSchedulePatch withOffPeakActionOnDisconnect(SessionHandlingOperation offPeakActionOnDisconnect) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withOffPeakActionOnDisconnect(offPeakActionOnDisconnect); return this; @@ -622,7 +622,7 @@ public Integer offPeakMinutesToWaitOnDisconnect() { public ScalingPlanPersonalSchedulePatch withOffPeakMinutesToWaitOnDisconnect(Integer offPeakMinutesToWaitOnDisconnect) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withOffPeakMinutesToWaitOnDisconnect(offPeakMinutesToWaitOnDisconnect); return this; @@ -645,7 +645,7 @@ public SessionHandlingOperation offPeakActionOnLogoff() { */ public ScalingPlanPersonalSchedulePatch withOffPeakActionOnLogoff(SessionHandlingOperation offPeakActionOnLogoff) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withOffPeakActionOnLogoff(offPeakActionOnLogoff); return this; @@ -670,7 +670,7 @@ public Integer offPeakMinutesToWaitOnLogoff() { */ public ScalingPlanPersonalSchedulePatch withOffPeakMinutesToWaitOnLogoff(Integer offPeakMinutesToWaitOnLogoff) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); + this.innerProperties = new ScalingPlanPersonalSchedulePatchProperties(); } this.innerProperties().withOffPeakMinutesToWaitOnLogoff(offPeakMinutesToWaitOnLogoff); return this; @@ -715,7 +715,7 @@ public static ScalingPlanPersonalSchedulePatch fromJson(JsonReader jsonReader) t if ("properties".equals(fieldName)) { deserializedScalingPlanPersonalSchedulePatch.innerProperties - = ScalingPlanPersonalScheduleProperties.fromJson(reader); + = ScalingPlanPersonalSchedulePatchProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedule.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedule.java index 3d39aa051a9b..240936e1b32e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedule.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedule.java @@ -41,6 +41,13 @@ public interface ScalingPlanPooledSchedule { */ SystemData systemData(); + /** + * Gets the namePropertiesName property: Name of the ScalingPlanPooledSchedule. + * + * @return the namePropertiesName value. + */ + String namePropertiesName(); + /** * Gets the daysOfWeek property: Set of days of the week on which this schedule is active. * @@ -48,6 +55,22 @@ public interface ScalingPlanPooledSchedule { */ List daysOfWeek(); + /** + * Gets the scalingMethod property: The desired scaling method to be used to scale the hosts in the assigned host + * pool. + * + * @return the scalingMethod value. + */ + ScalingMethod scalingMethod(); + + /** + * Gets the createDelete property: The properties that control how Scaling will manage the size of the hostpool by + * creating and deleting hosts. + * + * @return the createDelete value. + */ + CreateDeleteProperties createDelete(); + /** * Gets the rampUpStartTime property: Starting time for ramp up period. * @@ -74,7 +97,7 @@ public interface ScalingPlanPooledSchedule { * * @return the rampUpCapacityThresholdPct value. */ - Integer rampUpCapacityThresholdPct(); + int rampUpCapacityThresholdPct(); /** * Gets the peakStartTime property: Starting time for peak period. @@ -116,7 +139,7 @@ public interface ScalingPlanPooledSchedule { * * @return the rampDownCapacityThresholdPct value. */ - Integer rampDownCapacityThresholdPct(); + int rampDownCapacityThresholdPct(); /** * Gets the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts. @@ -178,8 +201,11 @@ public interface ScalingPlanPooledSchedule { /** * The entirety of the ScalingPlanPooledSchedule definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithDaysOfWeek, DefinitionStages.WithRampUpStartTime, + DefinitionStages.WithRampUpCapacityThresholdPct, DefinitionStages.WithPeakStartTime, + DefinitionStages.WithRampDownStartTime, DefinitionStages.WithRampDownCapacityThresholdPct, + DefinitionStages.WithOffPeakStartTime, DefinitionStages.WithCreate { } /** @@ -203,22 +229,110 @@ interface WithParentResource { * @param scalingPlanName The name of the scaling plan. * @return the next definition stage. */ - WithCreate withExistingScalingPlan(String resourceGroupName, String scalingPlanName); + WithDaysOfWeek withExistingScalingPlan(String resourceGroupName, String scalingPlanName); + } + + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify daysOfWeek. + */ + interface WithDaysOfWeek { + /** + * Specifies the daysOfWeek property: Set of days of the week on which this schedule is active.. + * + * @param daysOfWeek Set of days of the week on which this schedule is active. + * @return the next definition stage. + */ + WithRampUpStartTime withDaysOfWeek(List daysOfWeek); + } + + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampUpStartTime. + */ + interface WithRampUpStartTime { + /** + * Specifies the rampUpStartTime property: Starting time for ramp up period.. + * + * @param rampUpStartTime Starting time for ramp up period. + * @return the next definition stage. + */ + WithRampUpCapacityThresholdPct withRampUpStartTime(Time rampUpStartTime); + } + + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampUpCapacityThresholdPct. + */ + interface WithRampUpCapacityThresholdPct { + /** + * Specifies the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period.. + * + * @param rampUpCapacityThresholdPct Capacity threshold for ramp up period. + * @return the next definition stage. + */ + WithPeakStartTime withRampUpCapacityThresholdPct(int rampUpCapacityThresholdPct); + } + + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify peakStartTime. + */ + interface WithPeakStartTime { + /** + * Specifies the peakStartTime property: Starting time for peak period.. + * + * @param peakStartTime Starting time for peak period. + * @return the next definition stage. + */ + WithRampDownStartTime withPeakStartTime(Time peakStartTime); + } + + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownStartTime. + */ + interface WithRampDownStartTime { + /** + * Specifies the rampDownStartTime property: Starting time for ramp down period.. + * + * @param rampDownStartTime Starting time for ramp down period. + * @return the next definition stage. + */ + WithRampDownCapacityThresholdPct withRampDownStartTime(Time rampDownStartTime); + } + + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownCapacityThresholdPct. + */ + interface WithRampDownCapacityThresholdPct { + /** + * Specifies the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period.. + * + * @param rampDownCapacityThresholdPct Capacity threshold for ramp down period. + * @return the next definition stage. + */ + WithOffPeakStartTime withRampDownCapacityThresholdPct(int rampDownCapacityThresholdPct); + } + + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify offPeakStartTime. + */ + interface WithOffPeakStartTime { + /** + * Specifies the offPeakStartTime property: Starting time for off-peak period.. + * + * @param offPeakStartTime Starting time for off-peak period. + * @return the next definition stage. + */ + WithCreate withOffPeakStartTime(Time offPeakStartTime); } /** * The stage of the ScalingPlanPooledSchedule 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.WithDaysOfWeek, DefinitionStages.WithRampUpStartTime, + interface WithCreate extends DefinitionStages.WithScalingMethod, DefinitionStages.WithCreateDelete, DefinitionStages.WithRampUpLoadBalancingAlgorithm, DefinitionStages.WithRampUpMinimumHostsPct, - DefinitionStages.WithRampUpCapacityThresholdPct, DefinitionStages.WithPeakStartTime, - DefinitionStages.WithPeakLoadBalancingAlgorithm, DefinitionStages.WithRampDownStartTime, - DefinitionStages.WithRampDownLoadBalancingAlgorithm, DefinitionStages.WithRampDownMinimumHostsPct, - DefinitionStages.WithRampDownCapacityThresholdPct, DefinitionStages.WithRampDownForceLogoffUsers, + DefinitionStages.WithPeakLoadBalancingAlgorithm, DefinitionStages.WithRampDownLoadBalancingAlgorithm, + DefinitionStages.WithRampDownMinimumHostsPct, DefinitionStages.WithRampDownForceLogoffUsers, DefinitionStages.WithRampDownStopHostsWhen, DefinitionStages.WithRampDownWaitTimeMinutes, - DefinitionStages.WithRampDownNotificationMessage, DefinitionStages.WithOffPeakStartTime, - DefinitionStages.WithOffPeakLoadBalancingAlgorithm { + DefinitionStages.WithRampDownNotificationMessage, DefinitionStages.WithOffPeakLoadBalancingAlgorithm { /** * Executes the create request. * @@ -236,29 +350,32 @@ interface WithCreate extends DefinitionStages.WithDaysOfWeek, DefinitionStages.W } /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify daysOfWeek. + * The stage of the ScalingPlanPooledSchedule definition allowing to specify scalingMethod. */ - interface WithDaysOfWeek { + interface WithScalingMethod { /** - * Specifies the daysOfWeek property: Set of days of the week on which this schedule is active.. + * Specifies the scalingMethod property: The desired scaling method to be used to scale the hosts in the + * assigned host pool.. * - * @param daysOfWeek Set of days of the week on which this schedule is active. + * @param scalingMethod The desired scaling method to be used to scale the hosts in the assigned host pool. * @return the next definition stage. */ - WithCreate withDaysOfWeek(List daysOfWeek); + WithCreate withScalingMethod(ScalingMethod scalingMethod); } /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampUpStartTime. + * The stage of the ScalingPlanPooledSchedule definition allowing to specify createDelete. */ - interface WithRampUpStartTime { + interface WithCreateDelete { /** - * Specifies the rampUpStartTime property: Starting time for ramp up period.. + * Specifies the createDelete property: The properties that control how Scaling will manage the size of the + * hostpool by creating and deleting hosts.. * - * @param rampUpStartTime Starting time for ramp up period. + * @param createDelete The properties that control how Scaling will manage the size of the hostpool by + * creating and deleting hosts. * @return the next definition stage. */ - WithCreate withRampUpStartTime(Time rampUpStartTime); + WithCreate withCreateDelete(CreateDeleteProperties createDelete); } /** @@ -287,32 +404,6 @@ interface WithRampUpMinimumHostsPct { WithCreate withRampUpMinimumHostsPct(Integer rampUpMinimumHostsPct); } - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampUpCapacityThresholdPct. - */ - interface WithRampUpCapacityThresholdPct { - /** - * Specifies the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period.. - * - * @param rampUpCapacityThresholdPct Capacity threshold for ramp up period. - * @return the next definition stage. - */ - WithCreate withRampUpCapacityThresholdPct(Integer rampUpCapacityThresholdPct); - } - - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify peakStartTime. - */ - interface WithPeakStartTime { - /** - * Specifies the peakStartTime property: Starting time for peak period.. - * - * @param peakStartTime Starting time for peak period. - * @return the next definition stage. - */ - WithCreate withPeakStartTime(Time peakStartTime); - } - /** * The stage of the ScalingPlanPooledSchedule definition allowing to specify peakLoadBalancingAlgorithm. */ @@ -326,19 +417,6 @@ interface WithPeakLoadBalancingAlgorithm { WithCreate withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm); } - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownStartTime. - */ - interface WithRampDownStartTime { - /** - * Specifies the rampDownStartTime property: Starting time for ramp down period.. - * - * @param rampDownStartTime Starting time for ramp down period. - * @return the next definition stage. - */ - WithCreate withRampDownStartTime(Time rampDownStartTime); - } - /** * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownLoadBalancingAlgorithm. */ @@ -366,19 +444,6 @@ interface WithRampDownMinimumHostsPct { WithCreate withRampDownMinimumHostsPct(Integer rampDownMinimumHostsPct); } - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownCapacityThresholdPct. - */ - interface WithRampDownCapacityThresholdPct { - /** - * Specifies the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period.. - * - * @param rampDownCapacityThresholdPct Capacity threshold for ramp down period. - * @return the next definition stage. - */ - WithCreate withRampDownCapacityThresholdPct(Integer rampDownCapacityThresholdPct); - } - /** * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownForceLogoffUsers. */ @@ -433,19 +498,6 @@ interface WithRampDownNotificationMessage { WithCreate withRampDownNotificationMessage(String rampDownNotificationMessage); } - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify offPeakStartTime. - */ - interface WithOffPeakStartTime { - /** - * Specifies the offPeakStartTime property: Starting time for off-peak period.. - * - * @param offPeakStartTime Starting time for off-peak period. - * @return the next definition stage. - */ - WithCreate withOffPeakStartTime(Time offPeakStartTime); - } - /** * The stage of the ScalingPlanPooledSchedule definition allowing to specify offPeakLoadBalancingAlgorithm. */ @@ -471,10 +523,10 @@ interface WithOffPeakLoadBalancingAlgorithm { /** * The template for ScalingPlanPooledSchedule update. */ - interface Update extends UpdateStages.WithDaysOfWeek, UpdateStages.WithRampUpStartTime, - UpdateStages.WithRampUpLoadBalancingAlgorithm, UpdateStages.WithRampUpMinimumHostsPct, - UpdateStages.WithRampUpCapacityThresholdPct, UpdateStages.WithPeakStartTime, - UpdateStages.WithPeakLoadBalancingAlgorithm, UpdateStages.WithRampDownStartTime, + interface Update extends UpdateStages.WithDaysOfWeek, UpdateStages.WithScalingMethod, UpdateStages.WithCreateDelete, + UpdateStages.WithRampUpStartTime, UpdateStages.WithRampUpLoadBalancingAlgorithm, + UpdateStages.WithRampUpMinimumHostsPct, UpdateStages.WithRampUpCapacityThresholdPct, + UpdateStages.WithPeakStartTime, UpdateStages.WithPeakLoadBalancingAlgorithm, UpdateStages.WithRampDownStartTime, UpdateStages.WithRampDownLoadBalancingAlgorithm, UpdateStages.WithRampDownMinimumHostsPct, UpdateStages.WithRampDownCapacityThresholdPct, UpdateStages.WithRampDownForceLogoffUsers, UpdateStages.WithRampDownStopHostsWhen, UpdateStages.WithRampDownWaitTimeMinutes, @@ -513,6 +565,35 @@ interface WithDaysOfWeek { Update withDaysOfWeek(List daysOfWeek); } + /** + * The stage of the ScalingPlanPooledSchedule update allowing to specify scalingMethod. + */ + interface WithScalingMethod { + /** + * Specifies the scalingMethod property: The desired scaling method to be used to scale the hosts in the + * assigned host pool.. + * + * @param scalingMethod The desired scaling method to be used to scale the hosts in the assigned host pool. + * @return the next definition stage. + */ + Update withScalingMethod(ScalingMethod scalingMethod); + } + + /** + * The stage of the ScalingPlanPooledSchedule update allowing to specify createDelete. + */ + interface WithCreateDelete { + /** + * Specifies the createDelete property: The properties that control how Scaling will manage the size of the + * hostpool by creating and deleting hosts.. + * + * @param createDelete The properties that control how Scaling will manage the size of the hostpool by + * creating and deleting hosts. + * @return the next definition stage. + */ + Update withCreateDelete(CreateDeleteProperties createDelete); + } + /** * The stage of the ScalingPlanPooledSchedule update allowing to specify rampUpStartTime. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedulePatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedulePatch.java index 6bdc14b780b1..3acc3ed37026 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedulePatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedulePatch.java @@ -10,7 +10,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPooledScheduleProperties; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPooledSchedulePatchProperties; import java.io.IOException; import java.util.List; @@ -22,7 +22,7 @@ public final class ScalingPlanPooledSchedulePatch extends ProxyResource { /* * Detailed properties for ScalingPlanPooledSchedule */ - private ScalingPlanPooledScheduleProperties innerProperties; + private ScalingPlanPooledSchedulePatchProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -55,7 +55,7 @@ public ScalingPlanPooledSchedulePatch() { * * @return the innerProperties value. */ - private ScalingPlanPooledScheduleProperties innerProperties() { + private ScalingPlanPooledSchedulePatchProperties innerProperties() { return this.innerProperties; } @@ -98,6 +98,15 @@ public String id() { return this.id; } + /** + * Get the name property: Name of the ScalingPlanPooledSchedule. + * + * @return the name value. + */ + public String namePropertiesName() { + return this.innerProperties() == null ? null : this.innerProperties().name(); + } + /** * Get the daysOfWeek property: Set of days of the week on which this schedule is active. * @@ -115,12 +124,62 @@ public List daysOfWeek() { */ public ScalingPlanPooledSchedulePatch withDaysOfWeek(List daysOfWeek) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); + this.innerProperties = new ScalingPlanPooledSchedulePatchProperties(); } this.innerProperties().withDaysOfWeek(daysOfWeek); return this; } + /** + * Get the scalingMethod property: The desired scaling method to be used to scale the hosts in the assigned host + * pool. + * + * @return the scalingMethod value. + */ + public ScalingMethod scalingMethod() { + return this.innerProperties() == null ? null : this.innerProperties().scalingMethod(); + } + + /** + * Set the scalingMethod property: The desired scaling method to be used to scale the hosts in the assigned host + * pool. + * + * @param scalingMethod the scalingMethod value to set. + * @return the ScalingPlanPooledSchedulePatch object itself. + */ + public ScalingPlanPooledSchedulePatch withScalingMethod(ScalingMethod scalingMethod) { + if (this.innerProperties() == null) { + this.innerProperties = new ScalingPlanPooledSchedulePatchProperties(); + } + this.innerProperties().withScalingMethod(scalingMethod); + return this; + } + + /** + * Get the createDelete property: The properties that control how Scaling will manage the size of the hostpool by + * creating and deleting hosts. + * + * @return the createDelete value. + */ + public CreateDeleteProperties createDelete() { + return this.innerProperties() == null ? null : this.innerProperties().createDelete(); + } + + /** + * Set the createDelete property: The properties that control how Scaling will manage the size of the hostpool by + * creating and deleting hosts. + * + * @param createDelete the createDelete value to set. + * @return the ScalingPlanPooledSchedulePatch object itself. + */ + public ScalingPlanPooledSchedulePatch withCreateDelete(CreateDeleteProperties createDelete) { + if (this.innerProperties() == null) { + this.innerProperties = new ScalingPlanPooledSchedulePatchProperties(); + } + this.innerProperties().withCreateDelete(createDelete); + return this; + } + /** * Get the rampUpStartTime property: Starting time for ramp up period. * @@ -138,7 +197,7 @@ public Time rampUpStartTime() { */ public ScalingPlanPooledSchedulePatch withRampUpStartTime(Time rampUpStartTime) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); + this.innerProperties = new ScalingPlanPooledSchedulePatchProperties(); } this.innerProperties().withRampUpStartTime(rampUpStartTime); return this; @@ -162,7 +221,7 @@ public SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm() { public ScalingPlanPooledSchedulePatch withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); + this.innerProperties = new ScalingPlanPooledSchedulePatchProperties(); } this.innerProperties().withRampUpLoadBalancingAlgorithm(rampUpLoadBalancingAlgorithm); return this; @@ -185,7 +244,7 @@ public Integer rampUpMinimumHostsPct() { */ public ScalingPlanPooledSchedulePatch withRampUpMinimumHostsPct(Integer rampUpMinimumHostsPct) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); + this.innerProperties = new ScalingPlanPooledSchedulePatchProperties(); } this.innerProperties().withRampUpMinimumHostsPct(rampUpMinimumHostsPct); return this; @@ -208,7 +267,7 @@ public Integer rampUpCapacityThresholdPct() { */ public ScalingPlanPooledSchedulePatch withRampUpCapacityThresholdPct(Integer rampUpCapacityThresholdPct) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); + this.innerProperties = new ScalingPlanPooledSchedulePatchProperties(); } this.innerProperties().withRampUpCapacityThresholdPct(rampUpCapacityThresholdPct); return this; @@ -231,7 +290,7 @@ public Time peakStartTime() { */ public ScalingPlanPooledSchedulePatch withPeakStartTime(Time peakStartTime) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); + this.innerProperties = new ScalingPlanPooledSchedulePatchProperties(); } this.innerProperties().withPeakStartTime(peakStartTime); return this; @@ -255,7 +314,7 @@ public SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm() { public ScalingPlanPooledSchedulePatch withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); + this.innerProperties = new ScalingPlanPooledSchedulePatchProperties(); } this.innerProperties().withPeakLoadBalancingAlgorithm(peakLoadBalancingAlgorithm); return this; @@ -278,7 +337,7 @@ public Time rampDownStartTime() { */ public ScalingPlanPooledSchedulePatch withRampDownStartTime(Time rampDownStartTime) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); + this.innerProperties = new ScalingPlanPooledSchedulePatchProperties(); } this.innerProperties().withRampDownStartTime(rampDownStartTime); return this; @@ -302,7 +361,7 @@ public SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm() { public ScalingPlanPooledSchedulePatch withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); + this.innerProperties = new ScalingPlanPooledSchedulePatchProperties(); } this.innerProperties().withRampDownLoadBalancingAlgorithm(rampDownLoadBalancingAlgorithm); return this; @@ -325,7 +384,7 @@ public Integer rampDownMinimumHostsPct() { */ public ScalingPlanPooledSchedulePatch withRampDownMinimumHostsPct(Integer rampDownMinimumHostsPct) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); + this.innerProperties = new ScalingPlanPooledSchedulePatchProperties(); } this.innerProperties().withRampDownMinimumHostsPct(rampDownMinimumHostsPct); return this; @@ -348,7 +407,7 @@ public Integer rampDownCapacityThresholdPct() { */ public ScalingPlanPooledSchedulePatch withRampDownCapacityThresholdPct(Integer rampDownCapacityThresholdPct) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); + this.innerProperties = new ScalingPlanPooledSchedulePatchProperties(); } this.innerProperties().withRampDownCapacityThresholdPct(rampDownCapacityThresholdPct); return this; @@ -371,7 +430,7 @@ public Boolean rampDownForceLogoffUsers() { */ public ScalingPlanPooledSchedulePatch withRampDownForceLogoffUsers(Boolean rampDownForceLogoffUsers) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); + this.innerProperties = new ScalingPlanPooledSchedulePatchProperties(); } this.innerProperties().withRampDownForceLogoffUsers(rampDownForceLogoffUsers); return this; @@ -394,7 +453,7 @@ public StopHostsWhen rampDownStopHostsWhen() { */ public ScalingPlanPooledSchedulePatch withRampDownStopHostsWhen(StopHostsWhen rampDownStopHostsWhen) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); + this.innerProperties = new ScalingPlanPooledSchedulePatchProperties(); } this.innerProperties().withRampDownStopHostsWhen(rampDownStopHostsWhen); return this; @@ -417,7 +476,7 @@ public Integer rampDownWaitTimeMinutes() { */ public ScalingPlanPooledSchedulePatch withRampDownWaitTimeMinutes(Integer rampDownWaitTimeMinutes) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); + this.innerProperties = new ScalingPlanPooledSchedulePatchProperties(); } this.innerProperties().withRampDownWaitTimeMinutes(rampDownWaitTimeMinutes); return this; @@ -440,7 +499,7 @@ public String rampDownNotificationMessage() { */ public ScalingPlanPooledSchedulePatch withRampDownNotificationMessage(String rampDownNotificationMessage) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); + this.innerProperties = new ScalingPlanPooledSchedulePatchProperties(); } this.innerProperties().withRampDownNotificationMessage(rampDownNotificationMessage); return this; @@ -463,7 +522,7 @@ public Time offPeakStartTime() { */ public ScalingPlanPooledSchedulePatch withOffPeakStartTime(Time offPeakStartTime) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); + this.innerProperties = new ScalingPlanPooledSchedulePatchProperties(); } this.innerProperties().withOffPeakStartTime(offPeakStartTime); return this; @@ -487,7 +546,7 @@ public SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm() { public ScalingPlanPooledSchedulePatch withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm) { if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); + this.innerProperties = new ScalingPlanPooledSchedulePatchProperties(); } this.innerProperties().withOffPeakLoadBalancingAlgorithm(offPeakLoadBalancingAlgorithm); return this; @@ -539,7 +598,7 @@ public static ScalingPlanPooledSchedulePatch fromJson(JsonReader jsonReader) thr deserializedScalingPlanPooledSchedulePatch.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedScalingPlanPooledSchedulePatch.innerProperties - = ScalingPlanPooledScheduleProperties.fromJson(reader); + = ScalingPlanPooledSchedulePatchProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedScalingPlanPooledSchedulePatch.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingSchedule.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingSchedule.java index e1ea509a4f64..e436eecdef21 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingSchedule.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingSchedule.java @@ -25,7 +25,17 @@ public final class ScalingSchedule implements JsonSerializable /* * Set of days of the week on which this schedule is active. */ - private List daysOfWeek; + private List daysOfWeek; + + /* + * The desired scaling method to be used to scale the hosts in the assigned host pool. + */ + private ScalingMethod scalingMethod; + + /* + * The properties that control how Scaling will manage the size of the hostpool by creating and deleting hosts. + */ + private CreateDeleteProperties createDelete; /* * Starting time for ramp up period. @@ -138,7 +148,7 @@ public ScalingSchedule withName(String name) { * * @return the daysOfWeek value. */ - public List daysOfWeek() { + public List daysOfWeek() { return this.daysOfWeek; } @@ -148,11 +158,55 @@ public List daysOfWeek() { * @param daysOfWeek the daysOfWeek value to set. * @return the ScalingSchedule object itself. */ - public ScalingSchedule withDaysOfWeek(List daysOfWeek) { + public ScalingSchedule withDaysOfWeek(List daysOfWeek) { this.daysOfWeek = daysOfWeek; return this; } + /** + * Get the scalingMethod property: The desired scaling method to be used to scale the hosts in the assigned host + * pool. + * + * @return the scalingMethod value. + */ + public ScalingMethod scalingMethod() { + return this.scalingMethod; + } + + /** + * Set the scalingMethod property: The desired scaling method to be used to scale the hosts in the assigned host + * pool. + * + * @param scalingMethod the scalingMethod value to set. + * @return the ScalingSchedule object itself. + */ + public ScalingSchedule withScalingMethod(ScalingMethod scalingMethod) { + this.scalingMethod = scalingMethod; + return this; + } + + /** + * Get the createDelete property: The properties that control how Scaling will manage the size of the hostpool by + * creating and deleting hosts. + * + * @return the createDelete value. + */ + public CreateDeleteProperties createDelete() { + return this.createDelete; + } + + /** + * Set the createDelete property: The properties that control how Scaling will manage the size of the hostpool by + * creating and deleting hosts. + * + * @param createDelete the createDelete value to set. + * @return the ScalingSchedule object itself. + */ + public ScalingSchedule withCreateDelete(CreateDeleteProperties createDelete) { + this.createDelete = createDelete; + return this; + } + /** * Get the rampUpStartTime property: Starting time for ramp up period. * @@ -483,6 +537,9 @@ public SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (createDelete() != null) { + createDelete().validate(); + } if (rampUpStartTime() != null) { rampUpStartTime().validate(); } @@ -506,6 +563,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("name", this.name); jsonWriter.writeArrayField("daysOfWeek", this.daysOfWeek, (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("scalingMethod", this.scalingMethod == null ? null : this.scalingMethod.toString()); + jsonWriter.writeJsonField("createDelete", this.createDelete); jsonWriter.writeJsonField("rampUpStartTime", this.rampUpStartTime); jsonWriter.writeStringField("rampUpLoadBalancingAlgorithm", this.rampUpLoadBalancingAlgorithm == null ? null : this.rampUpLoadBalancingAlgorithm.toString()); @@ -548,9 +607,12 @@ public static ScalingSchedule fromJson(JsonReader jsonReader) throws IOException if ("name".equals(fieldName)) { deserializedScalingSchedule.name = reader.getString(); } else if ("daysOfWeek".equals(fieldName)) { - List daysOfWeek - = reader.readArray(reader1 -> ScalingScheduleDaysOfWeekItem.fromString(reader1.getString())); + List daysOfWeek = reader.readArray(reader1 -> DayOfWeek.fromString(reader1.getString())); deserializedScalingSchedule.daysOfWeek = daysOfWeek; + } else if ("scalingMethod".equals(fieldName)) { + deserializedScalingSchedule.scalingMethod = ScalingMethod.fromString(reader.getString()); + } else if ("createDelete".equals(fieldName)) { + deserializedScalingSchedule.createDelete = CreateDeleteProperties.fromJson(reader); } else if ("rampUpStartTime".equals(fieldName)) { deserializedScalingSchedule.rampUpStartTime = Time.fromJson(reader); } else if ("rampUpLoadBalancingAlgorithm".equals(fieldName)) { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingScheduleDaysOfWeekItem.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingScheduleDaysOfWeekItem.java deleted file mode 100644 index cd565b865f5b..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingScheduleDaysOfWeekItem.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for ScalingScheduleDaysOfWeekItem. - */ -public final class ScalingScheduleDaysOfWeekItem extends ExpandableStringEnum { - /** - * Static value Sunday for ScalingScheduleDaysOfWeekItem. - */ - public static final ScalingScheduleDaysOfWeekItem SUNDAY = fromString("Sunday"); - - /** - * Static value Monday for ScalingScheduleDaysOfWeekItem. - */ - public static final ScalingScheduleDaysOfWeekItem MONDAY = fromString("Monday"); - - /** - * Static value Tuesday for ScalingScheduleDaysOfWeekItem. - */ - public static final ScalingScheduleDaysOfWeekItem TUESDAY = fromString("Tuesday"); - - /** - * Static value Wednesday for ScalingScheduleDaysOfWeekItem. - */ - public static final ScalingScheduleDaysOfWeekItem WEDNESDAY = fromString("Wednesday"); - - /** - * Static value Thursday for ScalingScheduleDaysOfWeekItem. - */ - public static final ScalingScheduleDaysOfWeekItem THURSDAY = fromString("Thursday"); - - /** - * Static value Friday for ScalingScheduleDaysOfWeekItem. - */ - public static final ScalingScheduleDaysOfWeekItem FRIDAY = fromString("Friday"); - - /** - * Static value Saturday for ScalingScheduleDaysOfWeekItem. - */ - public static final ScalingScheduleDaysOfWeekItem SATURDAY = fromString("Saturday"); - - /** - * Creates a new instance of ScalingScheduleDaysOfWeekItem value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ScalingScheduleDaysOfWeekItem() { - } - - /** - * Creates or finds a ScalingScheduleDaysOfWeekItem from its string representation. - * - * @param name a name to look for. - * @return the corresponding ScalingScheduleDaysOfWeekItem. - */ - public static ScalingScheduleDaysOfWeekItem fromString(String name) { - return fromString(name, ScalingScheduleDaysOfWeekItem.class); - } - - /** - * Gets known ScalingScheduleDaysOfWeekItem values. - * - * @return known ScalingScheduleDaysOfWeekItem values. - */ - public static Collection values() { - return values(ScalingScheduleDaysOfWeekItem.class); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SecurityInfoPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SecurityInfoPatchProperties.java new file mode 100644 index 000000000000..0fddca0bf417 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SecurityInfoPatchProperties.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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; + +/** + * Security information. + */ +@Fluent +public final class SecurityInfoPatchProperties implements JsonSerializable { + /* + * The security type used by virtual machine in hostpool session host. + */ + private VirtualMachineSecurityType type; + + /* + * Whether to use secureBoot on the virtual machine. + */ + private Boolean secureBootEnabled; + + /* + * Whether to use vTPM on the virtual machine. + */ + private Boolean vTpmEnabled; + + /** + * Creates an instance of SecurityInfoPatchProperties class. + */ + public SecurityInfoPatchProperties() { + } + + /** + * Get the type property: The security type used by virtual machine in hostpool session host. + * + * @return the type value. + */ + public VirtualMachineSecurityType type() { + return this.type; + } + + /** + * Set the type property: The security type used by virtual machine in hostpool session host. + * + * @param type the type value to set. + * @return the SecurityInfoPatchProperties object itself. + */ + public SecurityInfoPatchProperties withType(VirtualMachineSecurityType type) { + this.type = type; + return this; + } + + /** + * Get the secureBootEnabled property: Whether to use secureBoot on the virtual machine. + * + * @return the secureBootEnabled value. + */ + public Boolean secureBootEnabled() { + return this.secureBootEnabled; + } + + /** + * Set the secureBootEnabled property: Whether to use secureBoot on the virtual machine. + * + * @param secureBootEnabled the secureBootEnabled value to set. + * @return the SecurityInfoPatchProperties object itself. + */ + public SecurityInfoPatchProperties withSecureBootEnabled(Boolean secureBootEnabled) { + this.secureBootEnabled = secureBootEnabled; + return this; + } + + /** + * Get the vTpmEnabled property: Whether to use vTPM on the virtual machine. + * + * @return the vTpmEnabled value. + */ + public Boolean vTpmEnabled() { + return this.vTpmEnabled; + } + + /** + * Set the vTpmEnabled property: Whether to use vTPM on the virtual machine. + * + * @param vTpmEnabled the vTpmEnabled value to set. + * @return the SecurityInfoPatchProperties object itself. + */ + public SecurityInfoPatchProperties withVTpmEnabled(Boolean vTpmEnabled) { + this.vTpmEnabled = vTpmEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeBooleanField("secureBootEnabled", this.secureBootEnabled); + jsonWriter.writeBooleanField("vTpmEnabled", this.vTpmEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityInfoPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityInfoPatchProperties 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 SecurityInfoPatchProperties. + */ + public static SecurityInfoPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityInfoPatchProperties deserializedSecurityInfoPatchProperties = new SecurityInfoPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedSecurityInfoPatchProperties.type + = VirtualMachineSecurityType.fromString(reader.getString()); + } else if ("secureBootEnabled".equals(fieldName)) { + deserializedSecurityInfoPatchProperties.secureBootEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("vTpmEnabled".equals(fieldName)) { + deserializedSecurityInfoPatchProperties.vTpmEnabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityInfoPatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SecurityInfoProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SecurityInfoProperties.java new file mode 100644 index 000000000000..4eee61129724 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SecurityInfoProperties.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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; + +/** + * Security information. + */ +@Fluent +public final class SecurityInfoProperties implements JsonSerializable { + /* + * The security type used by virtual machine in hostpool session host. Default is Standard. + */ + private VirtualMachineSecurityType type; + + /* + * Whether to use secureBoot on the virtual machine. + */ + private Boolean secureBootEnabled; + + /* + * Whether to use vTPM on the virtual machine. + */ + private Boolean vTpmEnabled; + + /** + * Creates an instance of SecurityInfoProperties class. + */ + public SecurityInfoProperties() { + } + + /** + * Get the type property: The security type used by virtual machine in hostpool session host. Default is Standard. + * + * @return the type value. + */ + public VirtualMachineSecurityType type() { + return this.type; + } + + /** + * Set the type property: The security type used by virtual machine in hostpool session host. Default is Standard. + * + * @param type the type value to set. + * @return the SecurityInfoProperties object itself. + */ + public SecurityInfoProperties withType(VirtualMachineSecurityType type) { + this.type = type; + return this; + } + + /** + * Get the secureBootEnabled property: Whether to use secureBoot on the virtual machine. + * + * @return the secureBootEnabled value. + */ + public Boolean secureBootEnabled() { + return this.secureBootEnabled; + } + + /** + * Set the secureBootEnabled property: Whether to use secureBoot on the virtual machine. + * + * @param secureBootEnabled the secureBootEnabled value to set. + * @return the SecurityInfoProperties object itself. + */ + public SecurityInfoProperties withSecureBootEnabled(Boolean secureBootEnabled) { + this.secureBootEnabled = secureBootEnabled; + return this; + } + + /** + * Get the vTpmEnabled property: Whether to use vTPM on the virtual machine. + * + * @return the vTpmEnabled value. + */ + public Boolean vTpmEnabled() { + return this.vTpmEnabled; + } + + /** + * Set the vTpmEnabled property: Whether to use vTPM on the virtual machine. + * + * @param vTpmEnabled the vTpmEnabled value to set. + * @return the SecurityInfoProperties object itself. + */ + public SecurityInfoProperties withVTpmEnabled(Boolean vTpmEnabled) { + this.vTpmEnabled = vTpmEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeBooleanField("secureBootEnabled", this.secureBootEnabled); + jsonWriter.writeBooleanField("vTpmEnabled", this.vTpmEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityInfoProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityInfoProperties 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 SecurityInfoProperties. + */ + public static SecurityInfoProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityInfoProperties deserializedSecurityInfoProperties = new SecurityInfoProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedSecurityInfoProperties.type = VirtualMachineSecurityType.fromString(reader.getString()); + } else if ("secureBootEnabled".equals(fieldName)) { + deserializedSecurityInfoProperties.secureBootEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("vTpmEnabled".equals(fieldName)) { + deserializedSecurityInfoProperties.vTpmEnabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityInfoProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHost.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHost.java index 4a0f98935261..b9a43485ab9a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHost.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHost.java @@ -41,6 +41,27 @@ public interface SessionHost { */ SystemData systemData(); + /** + * Gets the activeSessions property: Number of active sessions on SessionHost. + * + * @return the activeSessions value. + */ + Integer activeSessions(); + + /** + * Gets the disconnectedSessions property: Number of disconnected sessions on SessionHost. + * + * @return the disconnectedSessions value. + */ + Integer disconnectedSessions(); + + /** + * Gets the pendingSessions property: Number of pending sessions on SessionHost. + * + * @return the pendingSessions value. + */ + Integer pendingSessions(); + /** * Gets the objectId property: ObjectId of SessionHost. (internal use). * @@ -153,6 +174,21 @@ public interface SessionHost { */ String updateErrorMessage(); + /** + * Gets the lastSessionHostUpdateTime property: The last time update was completed. + * + * @return the lastSessionHostUpdateTime value. + */ + OffsetDateTime lastSessionHostUpdateTime(); + + /** + * Gets the sessionHostConfiguration property: SessionHostConfiguration version reference at the time the update is + * initiated, in the format of date time. Example: 2024-04-26T04:56:45Z. + * + * @return the sessionHostConfiguration value. + */ + String sessionHostConfiguration(); + /** * Gets the sessionHostHealthCheckResults property: List of SessionHostHealthCheckReports. * diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfiguration.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfiguration.java new file mode 100644 index 000000000000..7bc0a26ffdfb --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfiguration.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostConfigurationInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of SessionHostConfiguration. + */ +public interface SessionHostConfiguration { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the version property: The timestamp of the last update. + * + * @return the version value. + */ + OffsetDateTime version(); + + /** + * Gets the friendlyName property: Friendly name to describe this version of the SessionHostConfiguration. + * + * @return the friendlyName value. + */ + String friendlyName(); + + /** + * Gets the provisioningState property: Provisioning state of the Session Host Configuration. + * + * @return the provisioningState value. + */ + ProvisioningStateShc provisioningState(); + + /** + * Gets the vmTags property: Hashtable that lists key/value pair tags to apply to the VMs. + * + * @return the vmTags value. + */ + Map vmTags(); + + /** + * Gets the vmLocation property: The Location for the session host to be created in. It will default to the location + * of the hostpool if not provided. + * + * @return the vmLocation value. + */ + String vmLocation(); + + /** + * Gets the vmResourceGroup property: The ResourceGroup for the session hosts to be created in. It will default to + * the ResourceGroup of the hostpool if not provided. + * + * @return the vmResourceGroup value. + */ + String vmResourceGroup(); + + /** + * Gets the vmNamePrefix property: The prefix that should be associated with session host names. + * + * @return the vmNamePrefix value. + */ + String vmNamePrefix(); + + /** + * Gets the availabilityZones property: Value for availability zones to be used by the session host. Should be from + * [1,2,3]. + * + * @return the availabilityZones value. + */ + List availabilityZones(); + + /** + * Gets the networkInfo property: Network information. + * + * @return the networkInfo value. + */ + NetworkInfoProperties networkInfo(); + + /** + * Gets the vmSizeId property: The id of the size of a virtual machine connected to a hostpool. Example: + * Standard_D2as_v6. + * + * @return the vmSizeId value. + */ + String vmSizeId(); + + /** + * Gets the diskInfo property: Disk information. + * + * @return the diskInfo value. + */ + DiskInfoProperties diskInfo(); + + /** + * Gets the customConfigurationScriptUrl property: The uri to the storage blob containing the arm template to be run + * on the virtual machine after provisioning. + * + * @return the customConfigurationScriptUrl value. + */ + String customConfigurationScriptUrl(); + + /** + * Gets the imageInfo property: Image configurations of HostPool. + * + * @return the imageInfo value. + */ + ImageInfoProperties imageInfo(); + + /** + * Gets the domainInfo property: Domain configurations of session hosts. + * + * @return the domainInfo value. + */ + DomainInfoProperties domainInfo(); + + /** + * Gets the securityInfo property: Security information. + * + * @return the securityInfo value. + */ + SecurityInfoProperties securityInfo(); + + /** + * Gets the vmAdminCredentials property: Local Admin credentials for session hosts. + * + * @return the vmAdminCredentials value. + */ + KeyVaultCredentialsProperties vmAdminCredentials(); + + /** + * Gets the bootDiagnosticsInfo property: Boot Diagnostics information. + * + * @return the bootDiagnosticsInfo value. + */ + BootDiagnosticsInfoProperties bootDiagnosticsInfo(); + + /** + * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostConfigurationInner + * object. + * + * @return the inner object. + */ + SessionHostConfigurationInner innerModel(); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurationList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurationList.java new file mode 100644 index 000000000000..08bc7fb00b0e --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurationList.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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 com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * SessionHostConfigurationList + * + * List of SessionHostConfiguration definitions. + */ +@Fluent +public final class SessionHostConfigurationList implements JsonSerializable { + /* + * List of SessionHostConfiguration definitions. + */ + private List value; + + /* + * Link to the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of SessionHostConfigurationList class. + */ + public SessionHostConfigurationList() { + } + + /** + * Get the value property: List of SessionHostConfiguration definitions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of SessionHostConfiguration definitions. + * + * @param value the value value to set. + * @return the SessionHostConfigurationList object itself. + */ + public SessionHostConfigurationList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostConfigurationList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostConfigurationList 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 SessionHostConfigurationList. + */ + public static SessionHostConfigurationList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostConfigurationList deserializedSessionHostConfigurationList = new SessionHostConfigurationList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SessionHostConfigurationInner.fromJson(reader1)); + deserializedSessionHostConfigurationList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSessionHostConfigurationList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostConfigurationList; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurationPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurationPatch.java new file mode 100644 index 000000000000..c0c93caefb1d --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurationPatch.java @@ -0,0 +1,444 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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 com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostConfigurationPatchProperties; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Represents a SessionHostConfigurationPatch definition. + */ +@Fluent +public final class SessionHostConfigurationPatch implements JsonSerializable { + /* + * Detailed properties for SessionHostConfigurationPatch + */ + private SessionHostConfigurationPatchProperties innerProperties; + + /** + * Creates an instance of SessionHostConfigurationPatch class. + */ + public SessionHostConfigurationPatch() { + } + + /** + * Get the innerProperties property: Detailed properties for SessionHostConfigurationPatch. + * + * @return the innerProperties value. + */ + private SessionHostConfigurationPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the friendlyName property: Friendly name to describe this version of the SessionHostConfiguration. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Set the friendlyName property: Friendly name to describe this version of the SessionHostConfiguration. + * + * @param friendlyName the friendlyName value to set. + * @return the SessionHostConfigurationPatch object itself. + */ + public SessionHostConfigurationPatch withFriendlyName(String friendlyName) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationPatchProperties(); + } + this.innerProperties().withFriendlyName(friendlyName); + return this; + } + + /** + * Get the vmTags property: Hashtable that lists key/value pair tags to apply to the VMs. + * + * @return the vmTags value. + */ + public Map vmTags() { + return this.innerProperties() == null ? null : this.innerProperties().vmTags(); + } + + /** + * Set the vmTags property: Hashtable that lists key/value pair tags to apply to the VMs. + * + * @param vmTags the vmTags value to set. + * @return the SessionHostConfigurationPatch object itself. + */ + public SessionHostConfigurationPatch withVmTags(Map vmTags) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationPatchProperties(); + } + this.innerProperties().withVmTags(vmTags); + return this; + } + + /** + * Get the vmLocation property: The Location for the session host to be created in. + * + * @return the vmLocation value. + */ + public String vmLocation() { + return this.innerProperties() == null ? null : this.innerProperties().vmLocation(); + } + + /** + * Set the vmLocation property: The Location for the session host to be created in. + * + * @param vmLocation the vmLocation value to set. + * @return the SessionHostConfigurationPatch object itself. + */ + public SessionHostConfigurationPatch withVmLocation(String vmLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationPatchProperties(); + } + this.innerProperties().withVmLocation(vmLocation); + return this; + } + + /** + * Get the vmResourceGroup property: The ResourceGroup for the session hosts to be created in. It will default to + * the ResourceGroup of the hostpool if not provided. + * + * @return the vmResourceGroup value. + */ + public String vmResourceGroup() { + return this.innerProperties() == null ? null : this.innerProperties().vmResourceGroup(); + } + + /** + * Set the vmResourceGroup property: The ResourceGroup for the session hosts to be created in. It will default to + * the ResourceGroup of the hostpool if not provided. + * + * @param vmResourceGroup the vmResourceGroup value to set. + * @return the SessionHostConfigurationPatch object itself. + */ + public SessionHostConfigurationPatch withVmResourceGroup(String vmResourceGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationPatchProperties(); + } + this.innerProperties().withVmResourceGroup(vmResourceGroup); + return this; + } + + /** + * Get the vmNamePrefix property: The prefix that should be associated with session host names. + * + * @return the vmNamePrefix value. + */ + public String vmNamePrefix() { + return this.innerProperties() == null ? null : this.innerProperties().vmNamePrefix(); + } + + /** + * Set the vmNamePrefix property: The prefix that should be associated with session host names. + * + * @param vmNamePrefix the vmNamePrefix value to set. + * @return the SessionHostConfigurationPatch object itself. + */ + public SessionHostConfigurationPatch withVmNamePrefix(String vmNamePrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationPatchProperties(); + } + this.innerProperties().withVmNamePrefix(vmNamePrefix); + return this; + } + + /** + * Get the availabilityZones property: Value for availability zones to be used by the session host. Should be from + * [1,2,3]. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.innerProperties() == null ? null : this.innerProperties().availabilityZones(); + } + + /** + * Set the availabilityZones property: Value for availability zones to be used by the session host. Should be from + * [1,2,3]. + * + * @param availabilityZones the availabilityZones value to set. + * @return the SessionHostConfigurationPatch object itself. + */ + public SessionHostConfigurationPatch withAvailabilityZones(List availabilityZones) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationPatchProperties(); + } + this.innerProperties().withAvailabilityZones(availabilityZones); + return this; + } + + /** + * Get the networkInfo property: Network information. + * + * @return the networkInfo value. + */ + public NetworkInfoPatchProperties networkInfo() { + return this.innerProperties() == null ? null : this.innerProperties().networkInfo(); + } + + /** + * Set the networkInfo property: Network information. + * + * @param networkInfo the networkInfo value to set. + * @return the SessionHostConfigurationPatch object itself. + */ + public SessionHostConfigurationPatch withNetworkInfo(NetworkInfoPatchProperties networkInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationPatchProperties(); + } + this.innerProperties().withNetworkInfo(networkInfo); + return this; + } + + /** + * Get the vmSizeId property: The id of the size of a virtual machine connected to a hostpool. Example: + * Standard_D2as_v6. + * + * @return the vmSizeId value. + */ + public String vmSizeId() { + return this.innerProperties() == null ? null : this.innerProperties().vmSizeId(); + } + + /** + * Set the vmSizeId property: The id of the size of a virtual machine connected to a hostpool. Example: + * Standard_D2as_v6. + * + * @param vmSizeId the vmSizeId value to set. + * @return the SessionHostConfigurationPatch object itself. + */ + public SessionHostConfigurationPatch withVmSizeId(String vmSizeId) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationPatchProperties(); + } + this.innerProperties().withVmSizeId(vmSizeId); + return this; + } + + /** + * Get the diskInfo property: Disk information. + * + * @return the diskInfo value. + */ + public DiskInfoPatchProperties diskInfo() { + return this.innerProperties() == null ? null : this.innerProperties().diskInfo(); + } + + /** + * Set the diskInfo property: Disk information. + * + * @param diskInfo the diskInfo value to set. + * @return the SessionHostConfigurationPatch object itself. + */ + public SessionHostConfigurationPatch withDiskInfo(DiskInfoPatchProperties diskInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationPatchProperties(); + } + this.innerProperties().withDiskInfo(diskInfo); + return this; + } + + /** + * Get the customConfigurationScriptUrl property: The uri to the storage blob containing the arm template to be run + * on the virtual machine after provisioning. + * + * @return the customConfigurationScriptUrl value. + */ + public String customConfigurationScriptUrl() { + return this.innerProperties() == null ? null : this.innerProperties().customConfigurationScriptUrl(); + } + + /** + * Set the customConfigurationScriptUrl property: The uri to the storage blob containing the arm template to be run + * on the virtual machine after provisioning. + * + * @param customConfigurationScriptUrl the customConfigurationScriptUrl value to set. + * @return the SessionHostConfigurationPatch object itself. + */ + public SessionHostConfigurationPatch withCustomConfigurationScriptUrl(String customConfigurationScriptUrl) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationPatchProperties(); + } + this.innerProperties().withCustomConfigurationScriptUrl(customConfigurationScriptUrl); + return this; + } + + /** + * Get the imageInfo property: Image configurations of HostPool. + * + * @return the imageInfo value. + */ + public ImageInfoPatchProperties imageInfo() { + return this.innerProperties() == null ? null : this.innerProperties().imageInfo(); + } + + /** + * Set the imageInfo property: Image configurations of HostPool. + * + * @param imageInfo the imageInfo value to set. + * @return the SessionHostConfigurationPatch object itself. + */ + public SessionHostConfigurationPatch withImageInfo(ImageInfoPatchProperties imageInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationPatchProperties(); + } + this.innerProperties().withImageInfo(imageInfo); + return this; + } + + /** + * Get the domainInfo property: Domain configurations of session hosts. + * + * @return the domainInfo value. + */ + public DomainInfoPatchProperties domainInfo() { + return this.innerProperties() == null ? null : this.innerProperties().domainInfo(); + } + + /** + * Set the domainInfo property: Domain configurations of session hosts. + * + * @param domainInfo the domainInfo value to set. + * @return the SessionHostConfigurationPatch object itself. + */ + public SessionHostConfigurationPatch withDomainInfo(DomainInfoPatchProperties domainInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationPatchProperties(); + } + this.innerProperties().withDomainInfo(domainInfo); + return this; + } + + /** + * Get the securityInfo property: Security information. + * + * @return the securityInfo value. + */ + public SecurityInfoPatchProperties securityInfo() { + return this.innerProperties() == null ? null : this.innerProperties().securityInfo(); + } + + /** + * Set the securityInfo property: Security information. + * + * @param securityInfo the securityInfo value to set. + * @return the SessionHostConfigurationPatch object itself. + */ + public SessionHostConfigurationPatch withSecurityInfo(SecurityInfoPatchProperties securityInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationPatchProperties(); + } + this.innerProperties().withSecurityInfo(securityInfo); + return this; + } + + /** + * Get the vmAdminCredentials property: Local Admin credentials for session hosts. + * + * @return the vmAdminCredentials value. + */ + public KeyVaultCredentialsPatchProperties vmAdminCredentials() { + return this.innerProperties() == null ? null : this.innerProperties().vmAdminCredentials(); + } + + /** + * Set the vmAdminCredentials property: Local Admin credentials for session hosts. + * + * @param vmAdminCredentials the vmAdminCredentials value to set. + * @return the SessionHostConfigurationPatch object itself. + */ + public SessionHostConfigurationPatch withVmAdminCredentials(KeyVaultCredentialsPatchProperties vmAdminCredentials) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationPatchProperties(); + } + this.innerProperties().withVmAdminCredentials(vmAdminCredentials); + return this; + } + + /** + * Get the bootDiagnosticsInfo property: Boot Diagnostics information. + * + * @return the bootDiagnosticsInfo value. + */ + public BootDiagnosticsInfoPatchProperties bootDiagnosticsInfo() { + return this.innerProperties() == null ? null : this.innerProperties().bootDiagnosticsInfo(); + } + + /** + * Set the bootDiagnosticsInfo property: Boot Diagnostics information. + * + * @param bootDiagnosticsInfo the bootDiagnosticsInfo value to set. + * @return the SessionHostConfigurationPatch object itself. + */ + public SessionHostConfigurationPatch + withBootDiagnosticsInfo(BootDiagnosticsInfoPatchProperties bootDiagnosticsInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostConfigurationPatchProperties(); + } + this.innerProperties().withBootDiagnosticsInfo(bootDiagnosticsInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostConfigurationPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostConfigurationPatch 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 SessionHostConfigurationPatch. + */ + public static SessionHostConfigurationPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostConfigurationPatch deserializedSessionHostConfigurationPatch + = new SessionHostConfigurationPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedSessionHostConfigurationPatch.innerProperties + = SessionHostConfigurationPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostConfigurationPatch; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurations.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurations.java new file mode 100644 index 000000000000..c71d4568f836 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurations.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostConfigurationInner; + +/** + * Resource collection API of SessionHostConfigurations. + */ +public interface SessionHostConfigurations { + /** + * Create or update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition. + */ + SessionHostConfiguration createOrUpdate(String resourceGroupName, String hostPoolName, + SessionHostConfigurationInner sessionHostConfiguration); + + /** + * Create or update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition. + */ + SessionHostConfiguration createOrUpdate(String resourceGroupName, String hostPoolName, + SessionHostConfigurationInner sessionHostConfiguration, Context context); + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition. + */ + SessionHostConfiguration update(String resourceGroupName, String hostPoolName); + + /** + * Update a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostConfiguration Object containing SessionHostConfiguration definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostConfiguration definition. + */ + SessionHostConfiguration update(String resourceGroupName, String hostPoolName, + SessionHostConfigurationPatch sessionHostConfiguration, Context context); + + /** + * Get a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostConfiguration along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String hostPoolName, Context context); + + /** + * Get a SessionHostConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostConfiguration. + */ + SessionHostConfiguration get(String resourceGroupName, String hostPoolName); + + /** + * List sessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostConfigurationList as paginated response with {@link PagedIterable}. + */ + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); + + /** + * List sessionHostConfigurations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostConfigurationList as paginated response with {@link PagedIterable}. + */ + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Context context); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagement.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagement.java new file mode 100644 index 000000000000..a1e0cbb07748 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagement.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; + +/** + * An immutable client-side representation of SessionHostManagement. + */ +public interface SessionHostManagement { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the scheduledDateTimeZone property: Time zone for sessionHostManagement operations as defined in + * https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set if useLocalTime is + * true. + * + * @return the scheduledDateTimeZone value. + */ + String scheduledDateTimeZone(); + + /** + * Gets the update property: Parameters for a hostpool update. + * + * @return the update value. + */ + HostPoolUpdateConfigurationProperties update(); + + /** + * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner object. + * + * @return the inner object. + */ + SessionHostManagementInner innerModel(); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementList.java new file mode 100644 index 000000000000..fa9e7f7dece9 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementList.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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 com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; +import java.io.IOException; +import java.util.List; + +/** + * SessionHostManagementList + * + * List of SessionHostManagement definitions. + */ +@Fluent +public final class SessionHostManagementList implements JsonSerializable { + /* + * List of SessionHostManagement definitions. + */ + private List value; + + /* + * Link to the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of SessionHostManagementList class. + */ + public SessionHostManagementList() { + } + + /** + * Get the value property: List of SessionHostManagement definitions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of SessionHostManagement definitions. + * + * @param value the value value to set. + * @return the SessionHostManagementList object itself. + */ + public SessionHostManagementList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostManagementList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostManagementList 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 SessionHostManagementList. + */ + public static SessionHostManagementList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostManagementList deserializedSessionHostManagementList = new SessionHostManagementList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SessionHostManagementInner.fromJson(reader1)); + deserializedSessionHostManagementList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSessionHostManagementList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostManagementList; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementOperationProgress.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementOperationProgress.java new file mode 100644 index 000000000000..cf04bd36ba58 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementOperationProgress.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * SessionHostManagement Operation Progress information. + */ +@Fluent +public final class SessionHostManagementOperationProgress + implements JsonSerializable { + /* + * Time that the sessionHostManagement operation was created. + */ + private OffsetDateTime executionStartTime; + + /* + * The number of sessionHosts to be started in the sessionHostManagement operation. + */ + private Integer totalSessionHosts; + + /* + * The number of sessionHosts in progress in the sessionHostManagement operation. + */ + private Integer sessionHostsInProgress; + + /* + * The number of sessionHosts completed in the sessionHostManagement operation. + */ + private Integer sessionHostsCompleted; + + /* + * The number of sessionHosts rollback failed in the sessionHostManagement operation. + */ + private Integer sessionHostsRollbackFailed; + + /** + * Creates an instance of SessionHostManagementOperationProgress class. + */ + public SessionHostManagementOperationProgress() { + } + + /** + * Get the executionStartTime property: Time that the sessionHostManagement operation was created. + * + * @return the executionStartTime value. + */ + public OffsetDateTime executionStartTime() { + return this.executionStartTime; + } + + /** + * Set the executionStartTime property: Time that the sessionHostManagement operation was created. + * + * @param executionStartTime the executionStartTime value to set. + * @return the SessionHostManagementOperationProgress object itself. + */ + public SessionHostManagementOperationProgress withExecutionStartTime(OffsetDateTime executionStartTime) { + this.executionStartTime = executionStartTime; + return this; + } + + /** + * Get the totalSessionHosts property: The number of sessionHosts to be started in the sessionHostManagement + * operation. + * + * @return the totalSessionHosts value. + */ + public Integer totalSessionHosts() { + return this.totalSessionHosts; + } + + /** + * Set the totalSessionHosts property: The number of sessionHosts to be started in the sessionHostManagement + * operation. + * + * @param totalSessionHosts the totalSessionHosts value to set. + * @return the SessionHostManagementOperationProgress object itself. + */ + public SessionHostManagementOperationProgress withTotalSessionHosts(Integer totalSessionHosts) { + this.totalSessionHosts = totalSessionHosts; + return this; + } + + /** + * Get the sessionHostsInProgress property: The number of sessionHosts in progress in the sessionHostManagement + * operation. + * + * @return the sessionHostsInProgress value. + */ + public Integer sessionHostsInProgress() { + return this.sessionHostsInProgress; + } + + /** + * Set the sessionHostsInProgress property: The number of sessionHosts in progress in the sessionHostManagement + * operation. + * + * @param sessionHostsInProgress the sessionHostsInProgress value to set. + * @return the SessionHostManagementOperationProgress object itself. + */ + public SessionHostManagementOperationProgress withSessionHostsInProgress(Integer sessionHostsInProgress) { + this.sessionHostsInProgress = sessionHostsInProgress; + return this; + } + + /** + * Get the sessionHostsCompleted property: The number of sessionHosts completed in the sessionHostManagement + * operation. + * + * @return the sessionHostsCompleted value. + */ + public Integer sessionHostsCompleted() { + return this.sessionHostsCompleted; + } + + /** + * Set the sessionHostsCompleted property: The number of sessionHosts completed in the sessionHostManagement + * operation. + * + * @param sessionHostsCompleted the sessionHostsCompleted value to set. + * @return the SessionHostManagementOperationProgress object itself. + */ + public SessionHostManagementOperationProgress withSessionHostsCompleted(Integer sessionHostsCompleted) { + this.sessionHostsCompleted = sessionHostsCompleted; + return this; + } + + /** + * Get the sessionHostsRollbackFailed property: The number of sessionHosts rollback failed in the + * sessionHostManagement operation. + * + * @return the sessionHostsRollbackFailed value. + */ + public Integer sessionHostsRollbackFailed() { + return this.sessionHostsRollbackFailed; + } + + /** + * Set the sessionHostsRollbackFailed property: The number of sessionHosts rollback failed in the + * sessionHostManagement operation. + * + * @param sessionHostsRollbackFailed the sessionHostsRollbackFailed value to set. + * @return the SessionHostManagementOperationProgress object itself. + */ + public SessionHostManagementOperationProgress withSessionHostsRollbackFailed(Integer sessionHostsRollbackFailed) { + this.sessionHostsRollbackFailed = sessionHostsRollbackFailed; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("executionStartTime", + this.executionStartTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.executionStartTime)); + jsonWriter.writeNumberField("totalSessionHosts", this.totalSessionHosts); + jsonWriter.writeNumberField("sessionHostsInProgress", this.sessionHostsInProgress); + jsonWriter.writeNumberField("sessionHostsCompleted", this.sessionHostsCompleted); + jsonWriter.writeNumberField("sessionHostsRollbackFailed", this.sessionHostsRollbackFailed); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostManagementOperationProgress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostManagementOperationProgress 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 SessionHostManagementOperationProgress. + */ + public static SessionHostManagementOperationProgress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostManagementOperationProgress deserializedSessionHostManagementOperationProgress + = new SessionHostManagementOperationProgress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("executionStartTime".equals(fieldName)) { + deserializedSessionHostManagementOperationProgress.executionStartTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("totalSessionHosts".equals(fieldName)) { + deserializedSessionHostManagementOperationProgress.totalSessionHosts + = reader.getNullable(JsonReader::getInt); + } else if ("sessionHostsInProgress".equals(fieldName)) { + deserializedSessionHostManagementOperationProgress.sessionHostsInProgress + = reader.getNullable(JsonReader::getInt); + } else if ("sessionHostsCompleted".equals(fieldName)) { + deserializedSessionHostManagementOperationProgress.sessionHostsCompleted + = reader.getNullable(JsonReader::getInt); + } else if ("sessionHostsRollbackFailed".equals(fieldName)) { + deserializedSessionHostManagementOperationProgress.sessionHostsRollbackFailed + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostManagementOperationProgress; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementPatch.java new file mode 100644 index 000000000000..a48bec4f86f0 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementPatch.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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 com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementPatchProperties; +import java.io.IOException; + +/** + * Represents a SessionHostManagementPatch definition. + */ +@Fluent +public final class SessionHostManagementPatch implements JsonSerializable { + /* + * Detailed properties for SessionHostManagementPatch + */ + private SessionHostManagementPatchProperties innerProperties; + + /** + * Creates an instance of SessionHostManagementPatch class. + */ + public SessionHostManagementPatch() { + } + + /** + * Get the innerProperties property: Detailed properties for SessionHostManagementPatch. + * + * @return the innerProperties value. + */ + private SessionHostManagementPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the scheduledDateTimeZone property: Time zone for sessionHostManagement operations as defined in + * https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set if useLocalTime is + * true. + * + * @return the scheduledDateTimeZone value. + */ + public String scheduledDateTimeZone() { + return this.innerProperties() == null ? null : this.innerProperties().scheduledDateTimeZone(); + } + + /** + * Set the scheduledDateTimeZone property: Time zone for sessionHostManagement operations as defined in + * https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set if useLocalTime is + * true. + * + * @param scheduledDateTimeZone the scheduledDateTimeZone value to set. + * @return the SessionHostManagementPatch object itself. + */ + public SessionHostManagementPatch withScheduledDateTimeZone(String scheduledDateTimeZone) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostManagementPatchProperties(); + } + this.innerProperties().withScheduledDateTimeZone(scheduledDateTimeZone); + return this; + } + + /** + * Get the update property: Parameters for a hostpool update. + * + * @return the update value. + */ + public HostPoolUpdateConfigurationPatchProperties update() { + return this.innerProperties() == null ? null : this.innerProperties().update(); + } + + /** + * Set the update property: Parameters for a hostpool update. + * + * @param update the update value to set. + * @return the SessionHostManagementPatch object itself. + */ + public SessionHostManagementPatch withUpdate(HostPoolUpdateConfigurationPatchProperties update) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionHostManagementPatchProperties(); + } + this.innerProperties().withUpdate(update); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostManagementPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostManagementPatch 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 SessionHostManagementPatch. + */ + public static SessionHostManagementPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostManagementPatch deserializedSessionHostManagementPatch = new SessionHostManagementPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedSessionHostManagementPatch.innerProperties + = SessionHostManagementPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostManagementPatch; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementUpdateStatus.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementUpdateStatus.java new file mode 100644 index 000000000000..4b013053e54b --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementUpdateStatus.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementUpdateStatusInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of SessionHostManagementUpdateStatus. + */ +public interface SessionHostManagementUpdateStatus { + /** + * 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. Current defined values are < Error | Scheduled | + * UpdatingSessionHosts | ValidatingSessionHostUpdate | Paused | Pausing | Cancelling > | Succeeded | Failed | + * Canceled. + * + * @return the status value. + */ + String status(); + + /** + * Gets the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + Float 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 error property: If present, details of the operation error. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the correlationId property: The Log Analytics. + * + * @return the correlationId value. + */ + String correlationId(); + + /** + * Gets the progress property: Progress information on the sessionHostManagement operation. + * + * @return the progress value. + */ + SessionHostManagementOperationProgress progress(); + + /** + * Gets the scheduledDateTime property: The timestamp that the update is scheduled for. + * + * @return the scheduledDateTime value. + */ + OffsetDateTime scheduledDateTime(); + + /** + * Gets the sessionHostManagement property: SessionHostManagement properties used for the operation. + * + * @return the sessionHostManagement value. + */ + SessionHostManagement sessionHostManagement(); + + /** + * Gets the inner + * com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementUpdateStatusInner object. + * + * @return the inner object. + */ + SessionHostManagementUpdateStatusInner innerModel(); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementUpdateStatusProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementUpdateStatusProperties.java new file mode 100644 index 000000000000..8aec9bd139f5 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementUpdateStatusProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementUpdateStatusPropertiesInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of SessionHostManagementUpdateStatusProperties. + */ +public interface SessionHostManagementUpdateStatusProperties { + /** + * Gets the correlationId property: The Log Analytics. + * + * @return the correlationId value. + */ + String correlationId(); + + /** + * Gets the progress property: Progress information on the sessionHostManagement operation. + * + * @return the progress value. + */ + SessionHostManagementOperationProgress progress(); + + /** + * Gets the scheduledDateTime property: The timestamp that the update is scheduled for. + * + * @return the scheduledDateTime value. + */ + OffsetDateTime scheduledDateTime(); + + /** + * Gets the sessionHostManagement property: SessionHostManagement properties used for the operation. + * + * @return the sessionHostManagement value. + */ + SessionHostManagement sessionHostManagement(); + + /** + * Gets the inner + * com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementUpdateStatusPropertiesInner + * object. + * + * @return the inner object. + */ + SessionHostManagementUpdateStatusPropertiesInner innerModel(); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagements.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagements.java new file mode 100644 index 000000000000..dfc6412bc0c5 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagements.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; + +/** + * Resource collection API of SessionHostManagements. + */ +public interface SessionHostManagements { + /** + * Get a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostManagement along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String hostPoolName, Context context); + + /** + * Get a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostManagement. + */ + SessionHostManagement get(String resourceGroupName, String hostPoolName); + + /** + * Create or update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostManagement Object containing SessionHostManagement definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition along with {@link Response}. + */ + Response createOrUpdateWithResponse(String resourceGroupName, String hostPoolName, + SessionHostManagementInner sessionHostManagement, Context context); + + /** + * Create or update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostManagement Object containing SessionHostManagement definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition. + */ + SessionHostManagement createOrUpdate(String resourceGroupName, String hostPoolName, + SessionHostManagementInner sessionHostManagement); + + /** + * Update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostManagement Object containing SessionHostManagement definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition along with {@link Response}. + */ + Response updateWithResponse(String resourceGroupName, String hostPoolName, + SessionHostManagementPatch sessionHostManagement, Context context); + + /** + * Update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHostManagement definition. + */ + SessionHostManagement update(String resourceGroupName, String hostPoolName); + + /** + * List SessionHostManagements by hostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostManagementList as paginated response with {@link PagedIterable}. + */ + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); + + /** + * List SessionHostManagements by hostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sessionHostManagementList as paginated response with {@link PagedIterable}. + */ + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, Context context); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementsUpdateStatus.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementsUpdateStatus.java new file mode 100644 index 000000000000..1d38ee345d49 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementsUpdateStatus.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of SessionHostManagementsUpdateStatus. + */ +public interface SessionHostManagementsUpdateStatus { + /** + * Get the session host update status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host update status for a given hostpool along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context); + + /** + * Get the session host update status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host update status for a given hostpool. + */ + SessionHostManagementUpdateStatus get(String resourceGroupName, String hostPoolName); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostOperations.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostOperations.java new file mode 100644 index 000000000000..72ab1596f6e0 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostOperations.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of SessionHostOperations. + */ +public interface SessionHostOperations { + /** + * Retry provisioning on a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostname The name of the session host within the specified host pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response retryProvisioningWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Context context); + + /** + * Retry provisioning on a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostname The name of the session host within the specified host pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void retryProvisioning(String resourceGroupName, String hostPoolName, String sessionHostname); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHosts.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHosts.java index c952a771f113..de924309844b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHosts.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHosts.java @@ -118,6 +118,7 @@ Response updateWithResponse(String resourceGroupName, String hostPo * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. + * @param vmPath The path to the VM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -125,5 +126,5 @@ Response updateWithResponse(String resourceGroupName, String hostPo * @return sessionHostList as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context); + Boolean isDescending, Integer initialSkip, String vmPath, Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Sku.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Sku.java index e01d4ee168b5..678c2fd7e0e5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Sku.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Sku.java @@ -16,7 +16,7 @@ * The resource model definition representing SKU. */ @Fluent -public class Sku implements JsonSerializable { +public final class Sku implements JsonSerializable { /* * The name of the SKU. E.g. P3. It is typically a letter+number code */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Type.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Type.java new file mode 100644 index 000000000000..18ba3b9a033a --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Type.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of image session hosts use in the hostpool. + */ +public final class Type extends ExpandableStringEnum { + /** + * Static value Marketplace for Type. + */ + public static final Type MARKETPLACE = fromString("Marketplace"); + + /** + * Static value Custom for Type. + */ + public static final Type CUSTOM = fromString("Custom"); + + /** + * Creates a new instance of Type value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Type() { + } + + /** + * Creates or finds a Type from its string representation. + * + * @param name a name to look for. + * @return the corresponding Type. + */ + public static Type fromString(String name) { + return fromString(name, Type.class); + } + + /** + * Gets known Type values. + * + * @return known Type values. + */ + public static Collection values() { + return values(Type.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UpdateSessionHostsRequestBody.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UpdateSessionHostsRequestBody.java new file mode 100644 index 000000000000..4964010ed679 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UpdateSessionHostsRequestBody.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Object containing the definition for properties to be used for a sessionHostUpdate operation. + */ +@Fluent +public final class UpdateSessionHostsRequestBody implements JsonSerializable { + /* + * The timestamp that the update validation is scheduled for. If none is provided, the update will be executed + * immediately + */ + private OffsetDateTime scheduledDateTime; + + /* + * The timeZone as defined in https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. + */ + private String scheduledDateTimeZone; + + /* + * settings for management information for the hostpool update operation. If none is provided the update will use + * the settings saved in the sessionHostManagement object. + */ + private HostPoolUpdateConfigurationPatchProperties update; + + /** + * Creates an instance of UpdateSessionHostsRequestBody class. + */ + public UpdateSessionHostsRequestBody() { + } + + /** + * Get the scheduledDateTime property: The timestamp that the update validation is scheduled for. If none is + * provided, the update will be executed immediately. + * + * @return the scheduledDateTime value. + */ + public OffsetDateTime scheduledDateTime() { + return this.scheduledDateTime; + } + + /** + * Set the scheduledDateTime property: The timestamp that the update validation is scheduled for. If none is + * provided, the update will be executed immediately. + * + * @param scheduledDateTime the scheduledDateTime value to set. + * @return the UpdateSessionHostsRequestBody object itself. + */ + public UpdateSessionHostsRequestBody withScheduledDateTime(OffsetDateTime scheduledDateTime) { + this.scheduledDateTime = scheduledDateTime; + return this; + } + + /** + * Get the scheduledDateTimeZone property: The timeZone as defined in + * https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. + * + * @return the scheduledDateTimeZone value. + */ + public String scheduledDateTimeZone() { + return this.scheduledDateTimeZone; + } + + /** + * Set the scheduledDateTimeZone property: The timeZone as defined in + * https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. + * + * @param scheduledDateTimeZone the scheduledDateTimeZone value to set. + * @return the UpdateSessionHostsRequestBody object itself. + */ + public UpdateSessionHostsRequestBody withScheduledDateTimeZone(String scheduledDateTimeZone) { + this.scheduledDateTimeZone = scheduledDateTimeZone; + return this; + } + + /** + * Get the update property: settings for management information for the hostpool update operation. If none is + * provided the update will use the settings saved in the sessionHostManagement object. + * + * @return the update value. + */ + public HostPoolUpdateConfigurationPatchProperties update() { + return this.update; + } + + /** + * Set the update property: settings for management information for the hostpool update operation. If none is + * provided the update will use the settings saved in the sessionHostManagement object. + * + * @param update the update value to set. + * @return the UpdateSessionHostsRequestBody object itself. + */ + public UpdateSessionHostsRequestBody withUpdate(HostPoolUpdateConfigurationPatchProperties update) { + this.update = update; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (update() != null) { + update().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scheduledDateTime", + this.scheduledDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.scheduledDateTime)); + jsonWriter.writeStringField("scheduledDateTimeZone", this.scheduledDateTimeZone); + jsonWriter.writeJsonField("update", this.update); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateSessionHostsRequestBody from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateSessionHostsRequestBody 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 UpdateSessionHostsRequestBody. + */ + public static UpdateSessionHostsRequestBody fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateSessionHostsRequestBody deserializedUpdateSessionHostsRequestBody + = new UpdateSessionHostsRequestBody(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scheduledDateTime".equals(fieldName)) { + deserializedUpdateSessionHostsRequestBody.scheduledDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("scheduledDateTimeZone".equals(fieldName)) { + deserializedUpdateSessionHostsRequestBody.scheduledDateTimeZone = reader.getString(); + } else if ("update".equals(fieldName)) { + deserializedUpdateSessionHostsRequestBody.update + = HostPoolUpdateConfigurationPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateSessionHostsRequestBody; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserAssignedIdentity.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..68fc3733e4f1 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserAssignedIdentity.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@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/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/VirtualMachineDiskType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/VirtualMachineDiskType.java new file mode 100644 index 000000000000..751454835103 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/VirtualMachineDiskType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The disk type used by virtual machine in hostpool session host. + */ +public final class VirtualMachineDiskType extends ExpandableStringEnum { + /** + * Static value Standard_LRS for VirtualMachineDiskType. + */ + public static final VirtualMachineDiskType STANDARD_LRS = fromString("Standard_LRS"); + + /** + * Static value Premium_LRS for VirtualMachineDiskType. + */ + public static final VirtualMachineDiskType PREMIUM_LRS = fromString("Premium_LRS"); + + /** + * Static value StandardSSD_LRS for VirtualMachineDiskType. + */ + public static final VirtualMachineDiskType STANDARD_SSD_LRS = fromString("StandardSSD_LRS"); + + /** + * Creates a new instance of VirtualMachineDiskType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualMachineDiskType() { + } + + /** + * Creates or finds a VirtualMachineDiskType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachineDiskType. + */ + public static VirtualMachineDiskType fromString(String name) { + return fromString(name, VirtualMachineDiskType.class); + } + + /** + * Gets known VirtualMachineDiskType values. + * + * @return known VirtualMachineDiskType values. + */ + public static Collection values() { + return values(VirtualMachineDiskType.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/VirtualMachineSecurityType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/VirtualMachineSecurityType.java new file mode 100644 index 000000000000..3cb072df2027 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/VirtualMachineSecurityType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The security type used by virtual machine in hostpool session host. Default is Standard. + */ +public final class VirtualMachineSecurityType extends ExpandableStringEnum { + /** + * Static value Standard for VirtualMachineSecurityType. + */ + public static final VirtualMachineSecurityType STANDARD = fromString("Standard"); + + /** + * Static value TrustedLaunch for VirtualMachineSecurityType. + */ + public static final VirtualMachineSecurityType TRUSTED_LAUNCH = fromString("TrustedLaunch"); + + /** + * Static value ConfidentialVM for VirtualMachineSecurityType. + */ + public static final VirtualMachineSecurityType CONFIDENTIAL_VM = fromString("ConfidentialVM"); + + /** + * Creates a new instance of VirtualMachineSecurityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualMachineSecurityType() { + } + + /** + * Creates or finds a VirtualMachineSecurityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachineSecurityType. + */ + public static VirtualMachineSecurityType fromString(String name) { + return fromString(name, VirtualMachineSecurityType.class); + } + + /** + * Gets known VirtualMachineSecurityType values. + * + * @return known VirtualMachineSecurityType values. + */ + public static Collection values() { + return values(VirtualMachineSecurityType.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Workspace.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Workspace.java index e90a7727bd35..23f491ea98d1 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Workspace.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Workspace.java @@ -79,25 +79,25 @@ public interface Workspace { String etag(); /** - * Gets the identity property: The identity property. + * Gets the identity property: Managed service identity (system assigned and/or user assigned identities). * * @return the identity value. */ - ResourceModelWithAllowedPropertySetIdentity identity(); + ManagedServiceIdentity identity(); /** - * Gets the sku property: The sku property. + * Gets the sku property: The resource model definition representing SKU. * * @return the sku value. */ - ResourceModelWithAllowedPropertySetSku sku(); + Sku sku(); /** - * Gets the plan property: The plan property. + * Gets the plan property: Plan for the resource. * * @return the plan value. */ - ResourceModelWithAllowedPropertySetPlan plan(); + Plan plan(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -313,12 +313,13 @@ interface WithKind { */ interface WithIdentity { /** - * Specifies the identity property: The identity property.. + * Specifies the identity property: Managed service identity (system assigned and/or user assigned + * identities). * - * @param identity The identity property. + * @param identity Managed service identity (system assigned and/or user assigned identities). * @return the next definition stage. */ - WithCreate withIdentity(ResourceModelWithAllowedPropertySetIdentity identity); + WithCreate withIdentity(ManagedServiceIdentity identity); } /** @@ -326,12 +327,12 @@ interface WithIdentity { */ interface WithSku { /** - * Specifies the sku property: The sku property.. + * Specifies the sku property: The resource model definition representing SKU. * - * @param sku The sku property. + * @param sku The resource model definition representing SKU. * @return the next definition stage. */ - WithCreate withSku(ResourceModelWithAllowedPropertySetSku sku); + WithCreate withSku(Sku sku); } /** @@ -339,12 +340,12 @@ interface WithSku { */ interface WithPlan { /** - * Specifies the plan property: The plan property.. + * Specifies the plan property: Plan for the resource.. * - * @param plan The plan property. + * @param plan Plan for the resource. * @return the next definition stage. */ - WithCreate withPlan(ResourceModelWithAllowedPropertySetPlan plan); + WithCreate withPlan(Plan plan); } /** diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-desktopvirtualization/proxy-config.json b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-desktopvirtualization/proxy-config.json index 9a28264fba22..372683d56a5d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-desktopvirtualization/proxy-config.json +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-desktopvirtualization/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.desktopvirtualization.implementation.AppAttachPackageInfoesClientImpl$AppAttachPackageInfoesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.AppAttachPackagesClientImpl$AppAttachPackagesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.ApplicationGroupsClientImpl$ApplicationGroupsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.ApplicationsClientImpl$ApplicationsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.DesktopsClientImpl$DesktopsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.HostPoolsClientImpl$HostPoolsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.MsixImagesClientImpl$MsixImagesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.MsixPackagesClientImpl$MsixPackagesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.ScalingPlanPersonalSchedulesClientImpl$ScalingPlanPersonalSchedulesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.ScalingPlanPooledSchedulesClientImpl$ScalingPlanPooledSchedulesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.ScalingPlansClientImpl$ScalingPlansService"],["com.azure.resourcemanager.desktopvirtualization.implementation.SessionHostsClientImpl$SessionHostsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.StartMenuItemsClientImpl$StartMenuItemsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.UserSessionsClientImpl$UserSessionsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.WorkspacesClientImpl$WorkspacesService"]] \ No newline at end of file +[["com.azure.resourcemanager.desktopvirtualization.implementation.ActiveSessionHostConfigurationsClientImpl$ActiveSessionHostConfigurationsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.AppAttachPackageInfoesClientImpl$AppAttachPackageInfoesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.AppAttachPackagesClientImpl$AppAttachPackagesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.ApplicationGroupsClientImpl$ApplicationGroupsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.ApplicationsClientImpl$ApplicationsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.ControlSessionHostUpdatesClientImpl$ControlSessionHostUpdatesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.DesktopsClientImpl$DesktopsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.HostPoolsClientImpl$HostPoolsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.InitiateSessionHostUpdatesClientImpl$InitiateSessionHostUpdatesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.MsixImagesClientImpl$MsixImagesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.MsixPackagesClientImpl$MsixPackagesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.ScalingPlanPersonalSchedulesClientImpl$ScalingPlanPersonalSchedulesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.ScalingPlanPooledSchedulesClientImpl$ScalingPlanPooledSchedulesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.ScalingPlansClientImpl$ScalingPlansService"],["com.azure.resourcemanager.desktopvirtualization.implementation.SessionHostConfigurationsClientImpl$SessionHostConfigurationsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.SessionHostManagementsClientImpl$SessionHostManagementsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.SessionHostManagementsUpdateStatusClientImpl$SessionHostManagementsUpdateStatusService"],["com.azure.resourcemanager.desktopvirtualization.implementation.SessionHostOperationsClientImpl$SessionHostOperationsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.SessionHostsClientImpl$SessionHostsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.StartMenuItemsClientImpl$StartMenuItemsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.UserSessionsClientImpl$UserSessionsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.WorkspacesClientImpl$WorkspacesService"]] \ No newline at end of file diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/resources/azure-resourcemanager-desktopvirtualization.properties b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/resources/azure-resourcemanager-desktopvirtualization.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/resources/azure-resourcemanager-desktopvirtualization.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ActiveSessionHostConfigurationsGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ActiveSessionHostConfigurationsGetSamples.java new file mode 100644 index 000000000000..dc1b8ae60d15 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ActiveSessionHostConfigurationsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for ActiveSessionHostConfigurations Get. + */ +public final class ActiveSessionHostConfigurationsGetSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ActiveSessionHostConfigurations_Get.json + */ + /** + * Sample code: SessionHostConfigurations_Get. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostConfigurationsGet( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.activeSessionHostConfigurations() + .getWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ActiveSessionHostConfigurationsListByHostPoolSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ActiveSessionHostConfigurationsListByHostPoolSamples.java new file mode 100644 index 000000000000..b1f3068ed864 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ActiveSessionHostConfigurationsListByHostPoolSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for ActiveSessionHostConfigurations ListByHostPool. + */ +public final class ActiveSessionHostConfigurationsListByHostPoolSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ActiveSessionHostConfigurations_ListByHostPool.json + */ + /** + * Sample code: SessionHostConfigurations_ListByHostPool. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostConfigurationsListByHostPool( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.activeSessionHostConfigurations() + .listByHostPool("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageCreateOrUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageCreateOrUpdateSamples.java index a1bce7f731b4..01baf584459b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageCreateOrUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageCreateOrUpdateSamples.java @@ -18,8 +18,8 @@ public final class AppAttachPackageCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackage_Create.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/AppAttachPackage_Create.json */ /** * Sample code: AppAttachPackage_Create. @@ -59,7 +59,9 @@ public final class AppAttachPackageCreateOrUpdateSamples { .withCertificateExpiry(OffsetDateTime.parse("2023-01-02T17:18:19.1234567Z"))) .withHostPoolReferences(Arrays.asList()) .withKeyVaultUrl("fakeTokenPlaceholder") - .withFailHealthCheckOnStagingFailure(FailHealthCheckOnStagingFailure.NEEDS_ASSISTANCE)) + .withFailHealthCheckOnStagingFailure(FailHealthCheckOnStagingFailure.NEEDS_ASSISTANCE) + .withPackageOwnerName("App Attach") + .withCustomData("")) .create(); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageDeleteSamples.java index 1c087fd0f165..2fb388f48334 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageDeleteSamples.java @@ -10,8 +10,8 @@ public final class AppAttachPackageDeleteSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackage_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/AppAttachPackage_Delete.json */ /** * Sample code: AppAttachPackage_Delete. @@ -21,6 +21,6 @@ public final class AppAttachPackageDeleteSamples { public static void appAttachPackageDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.appAttachPackages() - .deleteByResourceGroupWithResponse("resourceGroup1", "packagefullname", com.azure.core.util.Context.NONE); + .deleteWithResponse("resourceGroup1", "packagefullname", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageGetByResourceGroupSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageGetByResourceGroupSamples.java index 04138ee9f7e6..7f75265534a3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageGetByResourceGroupSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageGetByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class AppAttachPackageGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackage_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/AppAttachPackage_Get.json */ /** * Sample code: AppAttachPackage_Get. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageInfoImportMethodSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageInfoImportMethodSamples.java index 30b1b44b54fa..3b1be4f3a782 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageInfoImportMethodSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageInfoImportMethodSamples.java @@ -13,8 +13,8 @@ public final class AppAttachPackageInfoImportMethodSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackageInfo_Import_Post.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/AppAttachPackageInfo_Import_Post.json */ /** * Sample code: AppAttachPackageInfo_Import. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageListByResourceGroupSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageListByResourceGroupSamples.java index 0089bf840aaa..928054c9aca7 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageListByResourceGroupSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageListByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class AppAttachPackageListByResourceGroupSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackage_ListByResourceGroup.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/AppAttachPackage_ListByResourceGroup.json */ /** * Sample code: AppAttachPackage_ListByResourceGroup. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageListSamples.java index 0ba5afc9609d..b810aec40b54 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageListSamples.java @@ -10,8 +10,8 @@ public final class AppAttachPackageListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackage_ListBySubscription.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/AppAttachPackage_ListBySubscription.json */ /** * Sample code: AppAttachPackage_ListBySubscription. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageUpdateSamples.java index e6f5a1519383..b4bb85e2f1fe 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageUpdateSamples.java @@ -12,8 +12,8 @@ public final class AppAttachPackageUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackage_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/AppAttachPackage_Update.json */ /** * Sample code: AppAttachPackage_Update. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsCreateOrUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsCreateOrUpdateSamples.java index be04ad430b6d..2fc58dc73024 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsCreateOrUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsCreateOrUpdateSamples.java @@ -14,8 +14,8 @@ public final class ApplicationGroupsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ApplicationGroup_Create.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ApplicationGroup_Create.json */ /** * Sample code: ApplicationGroup_Create. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsDeleteSamples.java index bcddf5f4d684..a930c6398c8b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsDeleteSamples.java @@ -10,8 +10,8 @@ public final class ApplicationGroupsDeleteSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ApplicationGroup_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ApplicationGroup_Delete.json */ /** * Sample code: ApplicationGroup_Delete. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsGetByResourceGroupSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsGetByResourceGroupSamples.java index 986d5090fc97..c96c10086475 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsGetByResourceGroupSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsGetByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class ApplicationGroupsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ApplicationGroup_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ApplicationGroup_Get.json */ /** * Sample code: ApplicationGroup_Get. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsListByResourceGroupSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsListByResourceGroupSamples.java index abfd82da909d..1fa848f96bbc 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsListByResourceGroupSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsListByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class ApplicationGroupsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ApplicationGroup_ListByResourceGroup.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ApplicationGroup_ListByResourceGroup.json */ /** * Sample code: ApplicationGroup_ListByResourceGroup. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsListSamples.java index 5bf5c1d9115c..e39bbb5d92c6 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsListSamples.java @@ -10,8 +10,8 @@ public final class ApplicationGroupsListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ApplicationGroup_ListBySubscription.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ApplicationGroup_ListBySubscription.json */ /** * Sample code: ApplicationGroup_List. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsUpdateSamples.java index 05ad41db48d4..66535b7a7a66 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsUpdateSamples.java @@ -14,8 +14,8 @@ public final class ApplicationGroupsUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ApplicationGroup_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ApplicationGroup_Update.json */ /** * Sample code: ApplicationGroups_Update. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsCreateOrUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsCreateOrUpdateSamples.java index 93fdf75a6592..05fa0837007a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsCreateOrUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsCreateOrUpdateSamples.java @@ -12,8 +12,8 @@ public final class ApplicationsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Application_Create.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Application_Create.json */ /** * Sample code: Application_Create. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsDeleteSamples.java index e7e9d7fd56db..76ed3a7b6439 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsDeleteSamples.java @@ -10,8 +10,8 @@ public final class ApplicationsDeleteSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Application_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Application_Delete.json */ /** * Sample code: Application_Delete. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsGetSamples.java index fd3e84450ff0..19a30398c51d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsGetSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsGetSamples.java @@ -10,8 +10,8 @@ public final class ApplicationsGetSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Application_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Application_Get.json */ /** * Sample code: Application_Get. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsListSamples.java index 5764e1d1a02d..5804b0b8f580 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsListSamples.java @@ -10,8 +10,8 @@ public final class ApplicationsListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Application_List.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Application_List.json */ /** * Sample code: Applications_List. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsUpdateSamples.java index 3509d341b5a7..13a85283b2ab 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsUpdateSamples.java @@ -14,8 +14,8 @@ public final class ApplicationsUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Application_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Application_Update.json */ /** * Sample code: Application_Update. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ControlSessionHostUpdatePostSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ControlSessionHostUpdatePostSamples.java new file mode 100644 index 000000000000..4b233939503a --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ControlSessionHostUpdatePostSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateAction; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateControlParameter; + +/** + * Samples for ControlSessionHostUpdate Post. + */ +public final class ControlSessionHostUpdatePostSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostManagements_ControlSessionHostUpdate_Post.json + */ + /** + * Sample code: SessionHostManagements_ControlUpdate_Post. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostManagementsControlUpdatePost( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.controlSessionHostUpdates() + .post("resourceGroup1", "hostPool1", + new HostPoolUpdateControlParameter().withAction(HostPoolUpdateAction.START) + .withCancelMessage("Host pool update started"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsGetSamples.java index b8ea7ace50f4..f78c1ae25f7a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsGetSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsGetSamples.java @@ -10,8 +10,8 @@ public final class DesktopsGetSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Desktop_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Desktop_Get.json */ /** * Sample code: Desktop_Get. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsListSamples.java index c8e4a9f1f56a..a37b68bee4d7 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsListSamples.java @@ -10,8 +10,8 @@ public final class DesktopsListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Desktop_List.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Desktop_List.json */ /** * Sample code: Desktop_List. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsUpdateSamples.java index 86b873b54f5c..1056b69eedcc 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsUpdateSamples.java @@ -12,8 +12,8 @@ public final class DesktopsUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Desktop_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Desktop_Update.json */ /** * Sample code: Desktop_Update. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsCreateOrUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsCreateOrUpdateSamples.java index 92e2274f950f..7d0e6a0d89b7 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsCreateOrUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsCreateOrUpdateSamples.java @@ -7,12 +7,17 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationInfoInner; import com.azure.resourcemanager.desktopvirtualization.models.AgentUpdateProperties; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.DirectUdp; import com.azure.resourcemanager.desktopvirtualization.models.HostPoolType; import com.azure.resourcemanager.desktopvirtualization.models.LoadBalancerType; import com.azure.resourcemanager.desktopvirtualization.models.MaintenanceWindowProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedPrivateUdp; +import com.azure.resourcemanager.desktopvirtualization.models.ManagementType; import com.azure.resourcemanager.desktopvirtualization.models.PersonalDesktopAssignmentType; import com.azure.resourcemanager.desktopvirtualization.models.PreferredAppGroupType; +import com.azure.resourcemanager.desktopvirtualization.models.PublicUdp; import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenOperation; +import com.azure.resourcemanager.desktopvirtualization.models.RelayUdp; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostComponentUpdateType; import com.azure.resourcemanager.desktopvirtualization.models.SsoSecretType; import java.time.OffsetDateTime; @@ -26,8 +31,8 @@ public final class HostPoolsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPool_Create.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/HostPool_Create.json */ /** * Sample code: HostPool_Create. @@ -52,6 +57,7 @@ public final class HostPoolsCreateOrUpdateSamples { new RegistrationInfoInner().withExpirationTime(OffsetDateTime.parse("2020-10-01T14:01:54.9571247Z")) .withRegistrationTokenOperation(RegistrationTokenOperation.UPDATE)) .withVmTemplate("{json:json}") + .withManagementType(ManagementType.AUTOMATED) .withSsoadfsAuthority("https://adfs") .withSsoClientId("client") .withSsoClientSecretKeyVaultPath("https://keyvault/secret") @@ -63,6 +69,10 @@ public final class HostPoolsCreateOrUpdateSamples { .withMaintenanceWindows( Arrays.asList(new MaintenanceWindowProperties().withHour(7).withDayOfWeek(DayOfWeek.FRIDAY), new MaintenanceWindowProperties().withHour(8).withDayOfWeek(DayOfWeek.SATURDAY)))) + .withManagedPrivateUdp(ManagedPrivateUdp.ENABLED) + .withDirectUdp(DirectUdp.ENABLED) + .withPublicUdp(PublicUdp.ENABLED) + .withRelayUdp(RelayUdp.ENABLED) .create(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsDeleteSamples.java index 4f715a4b0e13..e5349b4e183b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsDeleteSamples.java @@ -10,8 +10,8 @@ public final class HostPoolsDeleteSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPool_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/HostPool_Delete.json */ /** * Sample code: HostPool_Delete. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsGetByResourceGroupSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsGetByResourceGroupSamples.java index d5fbf08f314f..77b84636b02c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsGetByResourceGroupSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsGetByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class HostPoolsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPool_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/HostPool_Get.json */ /** * Sample code: HostPool_Get. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListByResourceGroupSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListByResourceGroupSamples.java index 7078672c1e08..5387b1a464d0 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListByResourceGroupSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class HostPoolsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPool_ListByResourceGroup.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/HostPool_ListByResourceGroup.json */ /** * Sample code: HostPool_ListByResourceGroup. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListRegistrationTokensSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListRegistrationTokensSamples.java index e3dae94497c5..0e51bb644d2a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListRegistrationTokensSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListRegistrationTokensSamples.java @@ -10,8 +10,8 @@ public final class HostPoolsListRegistrationTokensSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPools_ListRegistrationToken_Post.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/HostPools_ListRegistrationToken_Post.json */ /** * Sample code: HostPools_ListRegistrationToken_Post. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListSamples.java index 79349b1cd366..e769aacf7308 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListSamples.java @@ -10,8 +10,8 @@ public final class HostPoolsListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPool_List.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/HostPool_List.json */ /** * Sample code: HostPool_List. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsRetrieveRegistrationTokenSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsRetrieveRegistrationTokenSamples.java index dc80a34d7d4d..705132b129cb 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsRetrieveRegistrationTokenSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsRetrieveRegistrationTokenSamples.java @@ -10,8 +10,8 @@ public final class HostPoolsRetrieveRegistrationTokenSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPools_RetrieveRegistrationToken_Post.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/HostPools_RetrieveRegistrationToken_Post.json */ /** * Sample code: HostPools_RetrieveRegistrationToken_Post. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsUpdateSamples.java index 6105b07b4e12..743cee05ef3e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsUpdateSamples.java @@ -6,12 +6,16 @@ import com.azure.resourcemanager.desktopvirtualization.models.AgentUpdatePatchProperties; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.DirectUdp; import com.azure.resourcemanager.desktopvirtualization.models.HostPool; import com.azure.resourcemanager.desktopvirtualization.models.LoadBalancerType; import com.azure.resourcemanager.desktopvirtualization.models.MaintenanceWindowPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedPrivateUdp; import com.azure.resourcemanager.desktopvirtualization.models.PersonalDesktopAssignmentType; +import com.azure.resourcemanager.desktopvirtualization.models.PublicUdp; import com.azure.resourcemanager.desktopvirtualization.models.RegistrationInfoPatch; import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenOperation; +import com.azure.resourcemanager.desktopvirtualization.models.RelayUdp; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostComponentUpdateType; import com.azure.resourcemanager.desktopvirtualization.models.SsoSecretType; import java.time.OffsetDateTime; @@ -25,8 +29,8 @@ public final class HostPoolsUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPool_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/HostPool_Update.json */ /** * Sample code: HostPool_Update. @@ -61,6 +65,10 @@ public final class HostPoolsUpdateSamples { .withMaintenanceWindows(Arrays.asList( new MaintenanceWindowPatchProperties().withHour(7).withDayOfWeek(DayOfWeek.FRIDAY), new MaintenanceWindowPatchProperties().withHour(8).withDayOfWeek(DayOfWeek.SATURDAY)))) + .withManagedPrivateUdp(ManagedPrivateUdp.ENABLED) + .withDirectUdp(DirectUdp.ENABLED) + .withPublicUdp(PublicUdp.ENABLED) + .withRelayUdp(RelayUdp.ENABLED) .apply(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/InitiateSessionHostUpdatePostSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/InitiateSessionHostUpdatePostSamples.java new file mode 100644 index 000000000000..6c0821be465a --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/InitiateSessionHostUpdatePostSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.UpdateSessionHostsRequestBody; +import java.time.OffsetDateTime; + +/** + * Samples for InitiateSessionHostUpdate Post. + */ +public final class InitiateSessionHostUpdatePostSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostManagements_UpdateSessionHosts_Post.json + */ + /** + * Sample code: HostPools_Update_Post. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void + hostPoolsUpdatePost(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.initiateSessionHostUpdates() + .postWithResponse("resourceGroup1", "hostPool1", + new UpdateSessionHostsRequestBody() + .withScheduledDateTime(OffsetDateTime.parse("2008-09-22T14:01:54.9571247Z")) + .withScheduledDateTimeZone("Alaskan Standard Time") + .withUpdate(new HostPoolUpdateConfigurationPatchProperties().withDeleteOriginalVm(true) + .withMaxVmsRemoved(4) + .withLogOffDelayMinutes(10) + .withLogOffMessage("logging off for hostpool update")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImagesExpandSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImagesExpandSamples.java index 3544d107f149..db1ce0ac1e74 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImagesExpandSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImagesExpandSamples.java @@ -12,8 +12,8 @@ public final class MsixImagesExpandSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * MsixImage_Expand_Post.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/MsixImage_Expand_Post.json */ /** * Sample code: MsixImage_Expand. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesCreateOrUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesCreateOrUpdateSamples.java index b02f5b7793c1..d502e39331a4 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesCreateOrUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesCreateOrUpdateSamples.java @@ -15,8 +15,8 @@ public final class MsixPackagesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * MsixPackage_Create.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/MsixPackage_Create.json */ /** * Sample code: MSIXPackage_Create. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesDeleteSamples.java index 881b5a1157ea..f4e23652bebe 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesDeleteSamples.java @@ -10,8 +10,8 @@ public final class MsixPackagesDeleteSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * MsixPackage_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/MsixPackage_Delete.json */ /** * Sample code: MSIXPackage_Delete. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesGetSamples.java index ce2d85bdb212..98bdf7c60e6c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesGetSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesGetSamples.java @@ -10,8 +10,8 @@ public final class MsixPackagesGetSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * MsixPackage_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/MsixPackage_Get.json */ /** * Sample code: MSIXPackage_Get. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesListSamples.java index 5f583f059ebd..a669263ca805 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesListSamples.java @@ -10,8 +10,8 @@ public final class MsixPackagesListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * MsixPackage_List.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/MsixPackage_List.json */ /** * Sample code: MSIXPackage_List. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesUpdateSamples.java index 90f41c06f317..19e6e6eece6e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesUpdateSamples.java @@ -12,8 +12,8 @@ public final class MsixPackagesUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * MsixPackage_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/MsixPackage_Update.json */ /** * Sample code: MSIXPackage_Update. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationsListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationsListSamples.java index a9fe01ad7f4d..56556e1e16b1 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationsListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationsListSamples.java @@ -10,8 +10,8 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * OperationDescription_List.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/OperationDescription_List.json */ /** * Sample code: OperationDescription_List. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByHostPoolSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByHostPoolSamples.java index b1b20270ef8b..687b1e1abded 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByHostPoolSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByHostPoolSamples.java @@ -10,8 +10,8 @@ public final class PrivateEndpointConnectionsDeleteByHostPoolSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_DeleteByHostPool.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/PrivateEndpointConnection_DeleteByHostPool.json */ /** * Sample code: PrivateEndpointConnection_DeleteByHostPool. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByWorkspaceSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByWorkspaceSamples.java index 9fac940cea4e..7877f4784a3f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByWorkspaceSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByWorkspaceSamples.java @@ -10,8 +10,8 @@ public final class PrivateEndpointConnectionsDeleteByWorkspaceSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_DeleteByWorkspace.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/PrivateEndpointConnection_DeleteByWorkspace.json */ /** * Sample code: PrivateEndpointConnection_DeleteByWorkspace. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByHostPoolSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByHostPoolSamples.java index 4fd084c7b32f..9a828f13762a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByHostPoolSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByHostPoolSamples.java @@ -10,8 +10,8 @@ public final class PrivateEndpointConnectionsGetByHostPoolSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_GetByHostPool.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/PrivateEndpointConnection_GetByHostPool.json */ /** * Sample code: PrivateEndpointConnection_GetByHostPool. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByWorkspaceSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByWorkspaceSamples.java index 64e51e6ad4e5..9ac67a12b65f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByWorkspaceSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByWorkspaceSamples.java @@ -10,8 +10,8 @@ public final class PrivateEndpointConnectionsGetByWorkspaceSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_GetByWorkspace.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/PrivateEndpointConnection_GetByWorkspace.json */ /** * Sample code: PrivateEndpointConnection_GetByWorkspace. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByHostPoolSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByHostPoolSamples.java index 7bb9e7b03d2d..e2c0b1fd23d5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByHostPoolSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByHostPoolSamples.java @@ -10,8 +10,8 @@ public final class PrivateEndpointConnectionsListByHostPoolSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_ListByHostPool.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/PrivateEndpointConnection_ListByHostPool.json */ /** * Sample code: PrivateEndpointConnection_ListByHostPool. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByWorkspaceSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByWorkspaceSamples.java index 0bc4856731dc..2b447f57d30a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByWorkspaceSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByWorkspaceSamples.java @@ -10,8 +10,8 @@ public final class PrivateEndpointConnectionsListByWorkspaceSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_ListByWorkspace.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/PrivateEndpointConnection_ListByWorkspace.json */ /** * Sample code: PrivateEndpointConnection_ListByWorkspace. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByHostPoolSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByHostPoolSamples.java index 53f8cf5621f3..9a6d059d09ef 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByHostPoolSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByHostPoolSamples.java @@ -14,8 +14,8 @@ public final class PrivateEndpointConnectionsUpdateByHostPoolSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_UpdateByHostPool.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/PrivateEndpointConnection_UpdateByHostPool.json */ /** * Sample code: PrivateEndpointConnection_UpdateByHostPool. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByWorkspaceSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByWorkspaceSamples.java index 23c1a2cba738..6902090f522a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByWorkspaceSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByWorkspaceSamples.java @@ -14,8 +14,8 @@ public final class PrivateEndpointConnectionsUpdateByWorkspaceSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_UpdateByWorkspace.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/PrivateEndpointConnection_UpdateByWorkspace.json */ /** * Sample code: PrivateEndpointConnection_UpdateByWorkspace. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByHostPoolSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByHostPoolSamples.java index 0cad3a2d630a..f200ab8d9945 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByHostPoolSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByHostPoolSamples.java @@ -10,8 +10,8 @@ public final class PrivateLinkResourcesListByHostPoolSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateLinkResources_ListByHostPool.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/PrivateLinkResources_ListByHostPool.json */ /** * Sample code: PrivateLinkResources_ListByHostPool. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByWorkspaceSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByWorkspaceSamples.java index 8e6d2426b07a..9c22d4bd7c47 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByWorkspaceSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByWorkspaceSamples.java @@ -10,8 +10,8 @@ public final class PrivateLinkResourcesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateLinkResources_ListByWorkspace.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/PrivateLinkResources_ListByWorkspace.json */ /** * Sample code: PrivateLinkResources_ListByWorkspace. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesCreateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesCreateSamples.java index 35bb9cc43793..18b7816cad46 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesCreateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesCreateSamples.java @@ -17,8 +17,8 @@ public final class ScalingPlanPersonalSchedulesCreateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPersonalSchedule_Create.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPersonalSchedule_Create.json */ /** * Sample code: ScalingPlanPersonalSchedules_Create. @@ -33,25 +33,25 @@ public static void scalingPlanPersonalSchedulesCreate( .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, DayOfWeek.FRIDAY)) .withRampUpStartTime(new Time().withHour(6).withMinute(0)) + .withPeakStartTime(new Time().withHour(8).withMinute(0)) + .withRampDownStartTime(new Time().withHour(18).withMinute(0)) + .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) .withRampUpAutoStartHosts(StartupBehavior.ALL) .withRampUpStartVMOnConnect(SetStartVMOnConnect.ENABLE) .withRampUpActionOnDisconnect(SessionHandlingOperation.NONE) .withRampUpMinutesToWaitOnDisconnect(10) .withRampUpActionOnLogoff(SessionHandlingOperation.NONE) .withRampUpMinutesToWaitOnLogoff(10) - .withPeakStartTime(new Time().withHour(8).withMinute(0)) .withPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) .withPeakMinutesToWaitOnDisconnect(10) .withPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) .withPeakMinutesToWaitOnLogoff(10) - .withRampDownStartTime(new Time().withHour(18).withMinute(0)) .withRampDownStartVMOnConnect(SetStartVMOnConnect.ENABLE) .withRampDownActionOnDisconnect(SessionHandlingOperation.NONE) .withRampDownMinutesToWaitOnDisconnect(10) .withRampDownActionOnLogoff(SessionHandlingOperation.DEALLOCATE) .withRampDownMinutesToWaitOnLogoff(10) - .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) .withOffPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) .withOffPeakActionOnDisconnect(SessionHandlingOperation.NONE) .withOffPeakMinutesToWaitOnDisconnect(10) diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesDeleteSamples.java index 6b83c8622964..3fdce879f2d0 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesDeleteSamples.java @@ -10,8 +10,8 @@ public final class ScalingPlanPersonalSchedulesDeleteSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPersonalSchedule_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPersonalSchedule_Delete.json */ /** * Sample code: ScalingPlanPersonalSchedules_Delete. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesGetSamples.java index fade6f09052c..64df684bfa12 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesGetSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesGetSamples.java @@ -10,8 +10,8 @@ public final class ScalingPlanPersonalSchedulesGetSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPersonalSchedule_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPersonalSchedule_Get.json */ /** * Sample code: ScalingPlanPersonalSchedules_Get. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesListSamples.java index 88e492b8a83a..10eb076e5af6 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesListSamples.java @@ -10,8 +10,8 @@ public final class ScalingPlanPersonalSchedulesListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPersonalSchedule_List.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPersonalSchedule_List.json */ /** * Sample code: ScalingPlanPersonalSchedules_List. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesUpdateSamples.java index 3cb50c8c469f..42a00049a0d6 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesUpdateSamples.java @@ -15,8 +15,8 @@ public final class ScalingPlanPersonalSchedulesUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPersonalSchedule_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPersonalSchedule_Update.json */ /** * Sample code: ScalingPlanPersonalSchedules_Update. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesCreateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesCreateSamples.java index b2a103d4761e..3f29841cca24 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesCreateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesCreateSamples.java @@ -4,7 +4,9 @@ package com.azure.resourcemanager.desktopvirtualization.generated; +import com.azure.resourcemanager.desktopvirtualization.models.CreateDeleteProperties; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingMethod; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.Time; import java.util.Arrays; @@ -15,8 +17,46 @@ public final class ScalingPlanPooledSchedulesCreateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPooledSchedule_Create.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPooledSchedule_CreateUsingCreateDelete.json + */ + /** + * Sample code: ScalingPlanPooledSchedule_CreateUsingCreateDelete. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void scalingPlanPooledScheduleCreateUsingCreateDelete( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlanPooledSchedules() + .define("scalingPlanScheduleWeekdays1") + .withExistingScalingPlan("resourceGroup1", "scalingPlan1") + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, + DayOfWeek.FRIDAY)) + .withRampUpStartTime(new Time().withHour(6).withMinute(0)) + .withRampUpCapacityThresholdPct(80) + .withPeakStartTime(new Time().withHour(8).withMinute(0)) + .withRampDownStartTime(new Time().withHour(18).withMinute(0)) + .withRampDownCapacityThresholdPct(50) + .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) + .withScalingMethod(ScalingMethod.CREATE_DELETE_POWER_MANAGE) + .withCreateDelete(new CreateDeleteProperties().withRampUpMaximumHostPoolSize(10) + .withRampUpMinimumHostPoolSize(5) + .withRampDownMaximumHostPoolSize(7) + .withRampDownMinimumHostPoolSize(2)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownForceLogoffUsers(true) + .withRampDownWaitTimeMinutes(30) + .withRampDownNotificationMessage("message") + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .create(); + } + + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPooledSchedule_Create.json */ /** * Sample code: ScalingPlanPooledSchedules_Create. @@ -31,19 +71,19 @@ public static void scalingPlanPooledSchedulesCreate( .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, DayOfWeek.FRIDAY)) .withRampUpStartTime(new Time().withHour(6).withMinute(0)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(20) .withRampUpCapacityThresholdPct(80) .withPeakStartTime(new Time().withHour(8).withMinute(0)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) .withRampDownStartTime(new Time().withHour(18).withMinute(0)) + .withRampDownCapacityThresholdPct(50) + .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpMinimumHostsPct(20) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) .withRampDownMinimumHostsPct(20) - .withRampDownCapacityThresholdPct(50) .withRampDownForceLogoffUsers(true) .withRampDownWaitTimeMinutes(30) .withRampDownNotificationMessage("message") - .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) .create(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesDeleteSamples.java index 21be7dc898b3..ec8bc3302eea 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesDeleteSamples.java @@ -10,8 +10,8 @@ public final class ScalingPlanPooledSchedulesDeleteSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPooledSchedule_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPooledSchedule_Delete.json */ /** * Sample code: ScalingPlanPooledSchedules_Delete. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesGetSamples.java index 36e723f0fbe0..a6eebb95d814 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesGetSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesGetSamples.java @@ -10,8 +10,8 @@ public final class ScalingPlanPooledSchedulesGetSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPooledSchedule_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPooledSchedule_Get.json */ /** * Sample code: ScalingPlanPooledSchedules_Get. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesListSamples.java index 1174fdda1992..86558613237c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesListSamples.java @@ -10,8 +10,8 @@ public final class ScalingPlanPooledSchedulesListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPooledSchedule_List.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPooledSchedule_List.json */ /** * Sample code: ScalingPlanPooledSchedules_List. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesUpdateSamples.java index 80fc7ef5f71e..2ee106c9f448 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesUpdateSamples.java @@ -16,8 +16,8 @@ public final class ScalingPlanPooledSchedulesUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPooledSchedule_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlanPooledSchedule_Update.json */ /** * Sample code: ScalingPlanPooledSchedules_Update. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansCreateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansCreateSamples.java index 36b86bab80fc..901cce40f9d1 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansCreateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansCreateSamples.java @@ -4,10 +4,10 @@ package com.azure.resourcemanager.desktopvirtualization.generated; +import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolReference; import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolType; import com.azure.resourcemanager.desktopvirtualization.models.ScalingSchedule; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingScheduleDaysOfWeekItem; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.Time; import java.util.Arrays; @@ -20,8 +20,8 @@ public final class ScalingPlansCreateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_Create.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlan_Create.json */ /** * Sample code: ScalingPlans_Create. @@ -41,9 +41,8 @@ public final class ScalingPlansCreateSamples { .withHostPoolType(ScalingHostPoolType.POOLED) .withExclusionTag("value") .withSchedules(Arrays.asList(new ScalingSchedule().withName("schedule1") - .withDaysOfWeek(Arrays.asList(ScalingScheduleDaysOfWeekItem.MONDAY, - ScalingScheduleDaysOfWeekItem.TUESDAY, ScalingScheduleDaysOfWeekItem.WEDNESDAY, - ScalingScheduleDaysOfWeekItem.THURSDAY, ScalingScheduleDaysOfWeekItem.FRIDAY)) + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, + DayOfWeek.THURSDAY, DayOfWeek.FRIDAY)) .withRampUpStartTime(new Time().withHour(6).withMinute(0)) .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) .withRampUpMinimumHostsPct(20) diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansDeleteSamples.java index 783c833435f3..2b4d85eed56c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansDeleteSamples.java @@ -10,8 +10,8 @@ public final class ScalingPlansDeleteSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlan_Delete.json */ /** * Sample code: ScalingPlans_Delete. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansGetByResourceGroupSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansGetByResourceGroupSamples.java index 5b2c4558fa9a..46fcaf58ed08 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansGetByResourceGroupSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansGetByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class ScalingPlansGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlan_Get.json */ /** * Sample code: ScalingPlans_Get. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListByHostPoolSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListByHostPoolSamples.java index 73d62377d1ee..4f9b0060dc3a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListByHostPoolSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListByHostPoolSamples.java @@ -10,8 +10,8 @@ public final class ScalingPlansListByHostPoolSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_ListByHostPool.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlan_ListByHostPool.json */ /** * Sample code: ScalingPlan_ListByHostPool. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListByResourceGroupSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListByResourceGroupSamples.java index 32736c7059ca..a5418231ccdb 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListByResourceGroupSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class ScalingPlansListByResourceGroupSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_ListByResourceGroup.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlan_ListByResourceGroup.json */ /** * Sample code: ScalingPlans_ListByResourceGroup. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListSamples.java index 9ca1b42f132e..62179b5e81c3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListSamples.java @@ -10,8 +10,8 @@ public final class ScalingPlansListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_ListBySubscription.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlan_ListBySubscription.json */ /** * Sample code: ScalingPlans_ListBySubscription. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansUpdateSamples.java index 1195e317705c..e919e55b11e2 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansUpdateSamples.java @@ -12,8 +12,8 @@ public final class ScalingPlansUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/ScalingPlan_Update.json */ /** * Sample code: ScalingPlans_Update. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostConfigurationsCreateOrUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostConfigurationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..c64d874d011a --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostConfigurationsCreateOrUpdateSamples.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostConfigurationInner; +import com.azure.resourcemanager.desktopvirtualization.models.ActiveDirectoryInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.AzureActiveDirectoryInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.BootDiagnosticsInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.CustomInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DiskInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DomainInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DomainJoinType; +import com.azure.resourcemanager.desktopvirtualization.models.ImageInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.KeyVaultCredentialsProperties; +import com.azure.resourcemanager.desktopvirtualization.models.MarketplaceInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.NetworkInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SecurityInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.Type; +import com.azure.resourcemanager.desktopvirtualization.models.VirtualMachineDiskType; +import com.azure.resourcemanager.desktopvirtualization.models.VirtualMachineSecurityType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SessionHostConfigurations CreateOrUpdate. + */ +public final class SessionHostConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostConfigurations_Create.json + */ + /** + * Sample code: SessionHostConfigurations_Create. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostConfigurationsCreate( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostConfigurations() + .createOrUpdate("resourceGroup1", "hostPool1", new SessionHostConfigurationInner() + .withFriendlyName("InitialConfiguration") + .withVmTags(mapOf("Department", "myDepartment", "Team", "myTeam")) + .withVmLocation("eastus2") + .withVmResourceGroup("myResourceGroup") + .withVmNamePrefix("westus2-vm") + .withAvailabilityZones(Arrays.asList(1, 3)) + .withNetworkInfo(new NetworkInfoProperties().withSubnetId( + "/subscriptions/.../resourceGroups/.../providers/Microsoft.Network/virtualNetworks/.../subnets/subnet1") + .withSecurityGroupId( + "/subscriptions/.../resourceGroups/.../provider s/Microsoft.Network/networkSecurityGroups/nsg1")) + .withVmSizeId("Standard_D2s_v3") + .withDiskInfo(new DiskInfoProperties().withType(VirtualMachineDiskType.STANDARD_LRS)) + .withCustomConfigurationScriptUrl("https://storageaccountname.blob.core.windows.net/blobcontainer/file") + .withImageInfo(new ImageInfoProperties().withImageType(Type.MARKETPLACE) + .withMarketplaceInfo(new MarketplaceInfoProperties().withOffer("Windows-10") + .withPublisher("MicrosoftWindowsDesktop") + .withSku("19h2-ent") + .withExactVersion("2019.0.20190115")) + .withCustomInfo(new CustomInfoProperties().withResourceId( + "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.Compute/images/imageName"))) + .withDomainInfo(new DomainInfoProperties().withJoinType(DomainJoinType.ACTIVE_DIRECTORY) + .withActiveDirectoryInfo(new ActiveDirectoryInfoProperties() + .withDomainCredentials( + new KeyVaultCredentialsProperties().withUsernameKeyVaultSecretUri("fakeTokenPlaceholder") + .withPasswordKeyVaultSecretUri("fakeTokenPlaceholder")) + .withOuPath("OU=testOU,DC=domain,DC=Domain,DC=com") + .withDomainName("wvdarmtest1.net")) + .withAzureActiveDirectoryInfo(new AzureActiveDirectoryInfoProperties() + .withMdmProviderGuid("bdefabc0-95b4-48b3-b645-8a753a63c4fa"))) + .withSecurityInfo(new SecurityInfoProperties().withType(VirtualMachineSecurityType.TRUSTED_LAUNCH) + .withSecureBootEnabled(true) + .withVTpmEnabled(true)) + .withVmAdminCredentials( + new KeyVaultCredentialsProperties().withUsernameKeyVaultSecretUri("fakeTokenPlaceholder") + .withPasswordKeyVaultSecretUri("fakeTokenPlaceholder")) + .withBootDiagnosticsInfo(new BootDiagnosticsInfoProperties().withEnabled(true) + .withStorageUri("https://myStorageAccountName.blob.core.windows.net")), + 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/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostConfigurationsGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostConfigurationsGetSamples.java new file mode 100644 index 000000000000..4020e1fd4cde --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostConfigurationsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for SessionHostConfigurations Get. + */ +public final class SessionHostConfigurationsGetSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostConfigurations_Get.json + */ + /** + * Sample code: SessionHostConfigurations_Get. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostConfigurationsGet( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostConfigurations() + .getWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostConfigurationsListByHostPoolSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostConfigurationsListByHostPoolSamples.java new file mode 100644 index 000000000000..b6fa5bb4eb2c --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostConfigurationsListByHostPoolSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for SessionHostConfigurations ListByHostPool. + */ +public final class SessionHostConfigurationsListByHostPoolSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostConfigurations_ListByHostPool.json + */ + /** + * Sample code: SessionHostConfigurations_ListByHostPool. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostConfigurationsListByHostPool( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostConfigurations() + .listByHostPool("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostConfigurationsUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostConfigurationsUpdateSamples.java new file mode 100644 index 000000000000..b0eac7674f52 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostConfigurationsUpdateSamples.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.resourcemanager.desktopvirtualization.models.ActiveDirectoryInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.BootDiagnosticsInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.CustomInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DiskInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DomainInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ImageInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.KeyVaultCredentialsPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.MarketplaceInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.NetworkInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SecurityInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostConfigurationPatch; +import com.azure.resourcemanager.desktopvirtualization.models.Type; +import com.azure.resourcemanager.desktopvirtualization.models.VirtualMachineDiskType; +import com.azure.resourcemanager.desktopvirtualization.models.VirtualMachineSecurityType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SessionHostConfigurations Update. + */ +public final class SessionHostConfigurationsUpdateSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostConfigurations_Update.json + */ + /** + * Sample code: SessionHostConfigurations_Update. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostConfigurationsUpdate( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostConfigurations() + .update("resourceGroup1", "hostPool1", new SessionHostConfigurationPatch() + .withFriendlyName("Second Version, Updated Location") + .withVmTags(mapOf("Department", "myDepartment", "Team", "myTeam")) + .withVmLocation("eastus2") + .withVmResourceGroup("myResourceGroup") + .withVmNamePrefix("westus2-vm") + .withAvailabilityZones(Arrays.asList(1, 3)) + .withNetworkInfo(new NetworkInfoPatchProperties().withSubnetId( + "/subscriptions/.../resourceGroups/.../providers/Microsoft.Network/virtualNetworks/.../subnets/subnet1") + .withSecurityGroupId( + "/subscriptions/.../resourceGroups/.../provider s/Microsoft.Network/networkSecurityGroups/nsg1")) + .withVmSizeId("Standard_D2s_v3") + .withDiskInfo(new DiskInfoPatchProperties().withType(VirtualMachineDiskType.STANDARD_LRS)) + .withCustomConfigurationScriptUrl("https://storageaccountname.blob.core.windows.net/blobcontainer/file") + .withImageInfo(new ImageInfoPatchProperties().withImageType(Type.MARKETPLACE) + .withMarketplaceInfo(new MarketplaceInfoPatchProperties().withOffer("Windows-10") + .withPublisher("MicrosoftWindowsDesktop") + .withSku("19h2-ent") + .withExactVersion("2019.0.20190115")) + .withCustomInfo(new CustomInfoPatchProperties().withResourceId( + "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.Compute/images/imageName"))) + .withDomainInfo(new DomainInfoPatchProperties() + .withActiveDirectoryInfo(new ActiveDirectoryInfoPatchProperties().withDomainCredentials( + new KeyVaultCredentialsPatchProperties().withUsernameKeyVaultSecretUri("fakeTokenPlaceholder") + .withPasswordKeyVaultSecretUri("fakeTokenPlaceholder")))) + .withSecurityInfo(new SecurityInfoPatchProperties().withType(VirtualMachineSecurityType.TRUSTED_LAUNCH) + .withSecureBootEnabled(true) + .withVTpmEnabled(true)) + .withVmAdminCredentials( + new KeyVaultCredentialsPatchProperties().withUsernameKeyVaultSecretUri("fakeTokenPlaceholder") + .withPasswordKeyVaultSecretUri("fakeTokenPlaceholder")) + .withBootDiagnosticsInfo(new BootDiagnosticsInfoPatchProperties().withEnabled(true) + .withStorageUri("https://myStorageAccountName.blob.core.windows.net")), + 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/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsCreateOrUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..bd14fe6e0bf9 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsCreateOrUpdateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationProperties; + +/** + * Samples for SessionHostManagements CreateOrUpdate. + */ +public final class SessionHostManagementsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostManagements_Create.json + */ + /** + * Sample code: SessionHostManagements_Create. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostManagementsCreate( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostManagements() + .createOrUpdateWithResponse("resourceGroup1", "hostPool1", + new SessionHostManagementInner().withScheduledDateTimeZone("Alaskan Standard Time") + .withUpdate(new HostPoolUpdateConfigurationProperties().withDeleteOriginalVm(true) + .withMaxVmsRemoved(4) + .withLogOffDelayMinutes(10) + .withLogOffMessage("logging off for hostpool update")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsGetSamples.java new file mode 100644 index 000000000000..0ec86585cd28 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for SessionHostManagements Get. + */ +public final class SessionHostManagementsGetSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostManagements_Get.json + */ + /** + * Sample code: SessionHostManagements_Get. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostManagementsGet( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostManagements() + .getWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsListByHostPoolSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsListByHostPoolSamples.java new file mode 100644 index 000000000000..5498347d931c --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsListByHostPoolSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for SessionHostManagements ListByHostPool. + */ +public final class SessionHostManagementsListByHostPoolSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostManagements_ListByHostPool.json + */ + /** + * Sample code: SessionHostConfigurations_ListByHostPool. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostConfigurationsListByHostPool( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostManagements() + .listByHostPool("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsUpdateSamples.java new file mode 100644 index 000000000000..2a0ac5990d97 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsUpdateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementPatch; + +/** + * Samples for SessionHostManagements Update. + */ +public final class SessionHostManagementsUpdateSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostManagements_Update.json + */ + /** + * Sample code: SessionHostManagements_Update. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostManagementsUpdate( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostManagements() + .updateWithResponse("resourceGroup1", "hostPool1", + new SessionHostManagementPatch().withScheduledDateTimeZone("Alaskan Standard Time") + .withUpdate(new HostPoolUpdateConfigurationPatchProperties().withDeleteOriginalVm(true) + .withMaxVmsRemoved(4) + .withLogOffDelayMinutes(10) + .withLogOffMessage("logging off for hostpool update")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsUpdateStatusGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsUpdateStatusGetSamples.java new file mode 100644 index 000000000000..c75b464adf4f --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsUpdateStatusGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for SessionHostManagementsUpdateStatus Get. + */ +public final class SessionHostManagementsUpdateStatusGetSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHostManagements_UpdateStatus_Get.json + */ + /** + * Sample code: SessionHostManagements_UpdateStatus_Get. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostManagementsUpdateStatusGet( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostManagementsUpdateStatus() + .getWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostOperationRetryProvisioningSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostOperationRetryProvisioningSamples.java new file mode 100644 index 000000000000..f0b2593bfa7a --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostOperationRetryProvisioningSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for SessionHostOperation RetryProvisioning. + */ +public final class SessionHostOperationRetryProvisioningSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHost_RetryProvisioning_Post.json + */ + /** + * Sample code: SessionHost_RetryProvisioning_Post. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostRetryProvisioningPost( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostOperations() + .retryProvisioningWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsDeleteSamples.java index 1d4fd832d03b..ff7b4f0675f9 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsDeleteSamples.java @@ -10,8 +10,8 @@ public final class SessionHostsDeleteSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * SessionHost_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHost_Delete.json */ /** * Sample code: SessionHost_Delete. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsGetSamples.java index 97905852f887..804dffb9e23b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsGetSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsGetSamples.java @@ -10,8 +10,8 @@ public final class SessionHostsGetSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * SessionHost_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHost_Get.json */ /** * Sample code: SessionHost_Get. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsListSamples.java index fa6f2bf4a7a4..2a189b0ade8a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsListSamples.java @@ -10,8 +10,8 @@ public final class SessionHostsListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * SessionHost_List.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHost_List.json */ /** * Sample code: SessionHost_List. @@ -20,6 +20,6 @@ public final class SessionHostsListSamples { */ public static void sessionHostList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.sessionHosts().list("resourceGroup1", "hostPool1", 10, true, 0, com.azure.core.util.Context.NONE); + manager.sessionHosts().list("resourceGroup1", "hostPool1", 10, true, 0, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsUpdateSamples.java index 9dd436628b88..3123767a0b57 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsUpdateSamples.java @@ -12,8 +12,8 @@ public final class SessionHostsUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * SessionHost_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/SessionHost_Update.json */ /** * Sample code: SessionHost_Update. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemsListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemsListSamples.java index 28035bfee527..111798b795d4 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemsListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemsListSamples.java @@ -10,8 +10,8 @@ public final class StartMenuItemsListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * StartMenuItem_List.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/StartMenuItem_List.json */ /** * Sample code: StartMenuItem_List. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDeleteSamples.java index 6c07821d7f9e..491e22e2c1db 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDeleteSamples.java @@ -10,8 +10,8 @@ public final class UserSessionsDeleteSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * UserSession_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/UserSession_Delete.json */ /** * Sample code: UserSession_Delete. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDisconnectSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDisconnectSamples.java index e3776042a696..d5d04e7f72e0 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDisconnectSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDisconnectSamples.java @@ -10,8 +10,8 @@ public final class UserSessionsDisconnectSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * UserSession_Disconnect_Post.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/UserSession_Disconnect_Post.json */ /** * Sample code: UserSession_Disconnect_Post. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsGetSamples.java index a96d185dffee..1ad05a9a4afb 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsGetSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsGetSamples.java @@ -10,8 +10,8 @@ public final class UserSessionsGetSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * UserSession_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/UserSession_Get.json */ /** * Sample code: UserSession_Get. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListByHostPoolSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListByHostPoolSamples.java index 3bc2e2d94a06..cae6b43a056b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListByHostPoolSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListByHostPoolSamples.java @@ -10,8 +10,8 @@ public final class UserSessionsListByHostPoolSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * UserSession_ListByHostPool.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/UserSession_ListByHostPool.json */ /** * Sample code: UserSession_ListByHostPool. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListSamples.java index e9cfab81fb36..d74fac970482 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListSamples.java @@ -10,8 +10,8 @@ public final class UserSessionsListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * UserSession_List.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/UserSession_List.json */ /** * Sample code: UserSession_List. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsSendMessageSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsSendMessageSamples.java index 5fdc03e498e4..2b8ea4cfa411 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsSendMessageSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsSendMessageSamples.java @@ -12,8 +12,8 @@ public final class UserSessionsSendMessageSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * UserSession_SendMessage_Post.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/UserSession_SendMessage_Post.json */ /** * Sample code: UserSession_SendMessage_Post. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesCreateOrUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesCreateOrUpdateSamples.java index 601bb273404f..0cfe80b81f49 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesCreateOrUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesCreateOrUpdateSamples.java @@ -13,8 +13,8 @@ public final class WorkspacesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Workspace_Create.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Workspace_Create.json */ /** * Sample code: Workspace_Create. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesDeleteSamples.java index cc27cfe7dfb9..7ab9da751b5c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesDeleteSamples.java @@ -10,8 +10,8 @@ public final class WorkspacesDeleteSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Workspace_Delete.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Workspace_Delete.json */ /** * Sample code: Workspace_Delete. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesGetByResourceGroupSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesGetByResourceGroupSamples.java index 2b1a65bd6a61..e2515cbd6885 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesGetByResourceGroupSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesGetByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class WorkspacesGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Workspace_Get.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Workspace_Get.json */ /** * Sample code: Workspace_Get. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesListByResourceGroupSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesListByResourceGroupSamples.java index 6353f4f4407e..8df15aabb33a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesListByResourceGroupSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesListByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class WorkspacesListByResourceGroupSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Workspace_ListByResourceGroup.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Workspace_ListByResourceGroup.json */ /** * Sample code: Workspace_ListByResourceGroup. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesListSamples.java index 880944f93d66..3bfd1a1d8f44 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesListSamples.java @@ -10,8 +10,8 @@ public final class WorkspacesListSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Workspace_ListBySubscription.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Workspace_ListBySubscription.json */ /** * Sample code: Workspace_ListBySubscription. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesUpdateSamples.java index 1bbcda9d8499..c7c590acacdb 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesUpdateSamples.java @@ -14,8 +14,8 @@ public final class WorkspacesUpdateSamples { /* * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Workspace_Update.json + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-11-01-preview/ + * examples/Workspace_Update.json */ /** * Sample code: Workspace_Update. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AgentUpdatePatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AgentUpdatePatchPropertiesTests.java deleted file mode 100644 index fae970a1035e..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AgentUpdatePatchPropertiesTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.AgentUpdatePatchProperties; -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.MaintenanceWindowPatchProperties; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostComponentUpdateType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AgentUpdatePatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AgentUpdatePatchProperties model = BinaryData.fromString( - "{\"type\":\"Scheduled\",\"useSessionHostLocalTime\":true,\"maintenanceWindowTimeZone\":\"zi\",\"maintenanceWindows\":[{\"hour\":566949412,\"dayOfWeek\":\"Tuesday\"},{\"hour\":2014142159,\"dayOfWeek\":\"Monday\"},{\"hour\":377677013,\"dayOfWeek\":\"Thursday\"},{\"hour\":140703725,\"dayOfWeek\":\"Saturday\"}]}") - .toObject(AgentUpdatePatchProperties.class); - Assertions.assertEquals(SessionHostComponentUpdateType.SCHEDULED, model.type()); - Assertions.assertEquals(true, model.useSessionHostLocalTime()); - Assertions.assertEquals("zi", model.maintenanceWindowTimeZone()); - Assertions.assertEquals(566949412, model.maintenanceWindows().get(0).hour()); - Assertions.assertEquals(DayOfWeek.TUESDAY, model.maintenanceWindows().get(0).dayOfWeek()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AgentUpdatePatchProperties model - = new AgentUpdatePatchProperties().withType(SessionHostComponentUpdateType.SCHEDULED) - .withUseSessionHostLocalTime(true) - .withMaintenanceWindowTimeZone("zi") - .withMaintenanceWindows(Arrays.asList( - new MaintenanceWindowPatchProperties().withHour(566949412).withDayOfWeek(DayOfWeek.TUESDAY), - new MaintenanceWindowPatchProperties().withHour(2014142159).withDayOfWeek(DayOfWeek.MONDAY), - new MaintenanceWindowPatchProperties().withHour(377677013).withDayOfWeek(DayOfWeek.THURSDAY), - new MaintenanceWindowPatchProperties().withHour(140703725).withDayOfWeek(DayOfWeek.SATURDAY))); - model = BinaryData.fromObject(model).toObject(AgentUpdatePatchProperties.class); - Assertions.assertEquals(SessionHostComponentUpdateType.SCHEDULED, model.type()); - Assertions.assertEquals(true, model.useSessionHostLocalTime()); - Assertions.assertEquals("zi", model.maintenanceWindowTimeZone()); - Assertions.assertEquals(566949412, model.maintenanceWindows().get(0).hour()); - Assertions.assertEquals(DayOfWeek.TUESDAY, model.maintenanceWindows().get(0).dayOfWeek()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AgentUpdatePropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AgentUpdatePropertiesTests.java deleted file mode 100644 index 69493a20dbfd..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AgentUpdatePropertiesTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.AgentUpdateProperties; -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.MaintenanceWindowProperties; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostComponentUpdateType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AgentUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AgentUpdateProperties model = BinaryData.fromString( - "{\"type\":\"Scheduled\",\"useSessionHostLocalTime\":false,\"maintenanceWindowTimeZone\":\"nwzxltjcv\",\"maintenanceWindows\":[{\"hour\":823307226,\"dayOfWeek\":\"Wednesday\"},{\"hour\":1925543989,\"dayOfWeek\":\"Thursday\"},{\"hour\":1032415559,\"dayOfWeek\":\"Monday\"}]}") - .toObject(AgentUpdateProperties.class); - Assertions.assertEquals(SessionHostComponentUpdateType.SCHEDULED, model.type()); - Assertions.assertEquals(false, model.useSessionHostLocalTime()); - Assertions.assertEquals("nwzxltjcv", model.maintenanceWindowTimeZone()); - Assertions.assertEquals(823307226, model.maintenanceWindows().get(0).hour()); - Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.maintenanceWindows().get(0).dayOfWeek()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AgentUpdateProperties model - = new AgentUpdateProperties().withType(SessionHostComponentUpdateType.SCHEDULED) - .withUseSessionHostLocalTime(false) - .withMaintenanceWindowTimeZone("nwzxltjcv") - .withMaintenanceWindows(Arrays.asList( - new MaintenanceWindowProperties().withHour(823307226).withDayOfWeek(DayOfWeek.WEDNESDAY), - new MaintenanceWindowProperties().withHour(1925543989).withDayOfWeek(DayOfWeek.THURSDAY), - new MaintenanceWindowProperties().withHour(1032415559).withDayOfWeek(DayOfWeek.MONDAY))); - model = BinaryData.fromObject(model).toObject(AgentUpdateProperties.class); - Assertions.assertEquals(SessionHostComponentUpdateType.SCHEDULED, model.type()); - Assertions.assertEquals(false, model.useSessionHostLocalTime()); - Assertions.assertEquals("nwzxltjcv", model.maintenanceWindowTimeZone()); - Assertions.assertEquals(823307226, model.maintenanceWindows().get(0).hour()); - Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.maintenanceWindows().get(0).dayOfWeek()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageInfoPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageInfoPropertiesTests.java deleted file mode 100644 index 31f3d875931f..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageInfoPropertiesTests.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageInfoProperties; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; -import com.azure.resourcemanager.desktopvirtualization.models.PackageTimestamped; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AppAttachPackageInfoPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AppAttachPackageInfoProperties model = BinaryData.fromString( - "{\"packageAlias\":\"xvd\",\"imagePath\":\"fwafqrouda\",\"packageName\":\"avehhrvkbunzo\",\"packageFamilyName\":\"dhcxgkmoy\",\"packageFullName\":\"dyuib\",\"displayName\":\"fdn\",\"packageRelativePath\":\"ydvfvfcjnae\",\"isRegularRegistration\":true,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"orffukiscv\",\"publisher\":\"zhwplefaxvxilc\",\"minVersion\":\"gnhnzeyq\"},{\"dependencyName\":\"jjfzqlqhycavo\",\"publisher\":\"gxdbeesmie\",\"minVersion\":\"lrariaawiu\"},{\"dependencyName\":\"ydwqfbylyrf\",\"publisher\":\"agt\",\"minVersion\":\"jocqwogfnzjvusf\"}],\"version\":\"dmozu\",\"lastUpdated\":\"2021-03-08T21:05:34Z\",\"packageApplications\":[{\"appId\":\"tkad\",\"description\":\"s\",\"appUserModelID\":\"nbtgkbugrjqctoj\",\"friendlyName\":\"isofieypefojyqd\",\"iconImageName\":\"u\"},{\"appId\":\"lcwkhihihlhz\",\"description\":\"qtz\",\"appUserModelID\":\"rgnowcjhfgm\",\"friendlyName\":\"cact\",\"iconImageName\":\"wotey\"},{\"appId\":\"uqovekqvgqouwif\",\"description\":\"pjwyiv\",\"appUserModelID\":\"kfxcvhrfs\",\"friendlyName\":\"uagrttikteusqc\",\"iconImageName\":\"vyklxuby\"},{\"appId\":\"mmfblcqcuubgqib\",\"description\":\"a\",\"appUserModelID\":\"etttwgdslqxihhr\",\"friendlyName\":\"oi\",\"iconImageName\":\"seypxiutcxapz\"}],\"certificateName\":\"etoge\",\"certificateExpiry\":\"2021-06-21T12:50:27Z\",\"isPackageTimestamped\":\"NotTimestamped\"}") - .toObject(AppAttachPackageInfoProperties.class); - Assertions.assertEquals("xvd", model.packageAlias()); - Assertions.assertEquals("fwafqrouda", model.imagePath()); - Assertions.assertEquals("avehhrvkbunzo", model.packageName()); - Assertions.assertEquals("dhcxgkmoy", model.packageFamilyName()); - Assertions.assertEquals("dyuib", model.packageFullName()); - Assertions.assertEquals("fdn", model.displayName()); - Assertions.assertEquals("ydvfvfcjnae", model.packageRelativePath()); - Assertions.assertEquals(true, model.isRegularRegistration()); - Assertions.assertEquals(true, model.isActive()); - Assertions.assertEquals("orffukiscv", model.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("zhwplefaxvxilc", model.packageDependencies().get(0).publisher()); - Assertions.assertEquals("gnhnzeyq", model.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("dmozu", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-08T21:05:34Z"), model.lastUpdated()); - Assertions.assertEquals("tkad", model.packageApplications().get(0).appId()); - Assertions.assertEquals("s", model.packageApplications().get(0).description()); - Assertions.assertEquals("nbtgkbugrjqctoj", model.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("isofieypefojyqd", model.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("u", model.packageApplications().get(0).iconImageName()); - Assertions.assertEquals("etoge", model.certificateName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-21T12:50:27Z"), model.certificateExpiry()); - Assertions.assertEquals(PackageTimestamped.NOT_TIMESTAMPED, model.isPackageTimestamped()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AppAttachPackageInfoProperties model = new AppAttachPackageInfoProperties().withPackageAlias("xvd") - .withImagePath("fwafqrouda") - .withPackageName("avehhrvkbunzo") - .withPackageFamilyName("dhcxgkmoy") - .withPackageFullName("dyuib") - .withDisplayName("fdn") - .withPackageRelativePath("ydvfvfcjnae") - .withIsRegularRegistration(true) - .withIsActive(true) - .withPackageDependencies(Arrays.asList( - new MsixPackageDependencies().withDependencyName("orffukiscv") - .withPublisher("zhwplefaxvxilc") - .withMinVersion("gnhnzeyq"), - new MsixPackageDependencies().withDependencyName("jjfzqlqhycavo") - .withPublisher("gxdbeesmie") - .withMinVersion("lrariaawiu"), - new MsixPackageDependencies().withDependencyName("ydwqfbylyrf") - .withPublisher("agt") - .withMinVersion("jocqwogfnzjvusf"))) - .withVersion("dmozu") - .withLastUpdated(OffsetDateTime.parse("2021-03-08T21:05:34Z")) - .withPackageApplications(Arrays.asList( - new MsixPackageApplications().withAppId("tkad") - .withDescription("s") - .withAppUserModelId("nbtgkbugrjqctoj") - .withFriendlyName("isofieypefojyqd") - .withIconImageName("u"), - new MsixPackageApplications().withAppId("lcwkhihihlhz") - .withDescription("qtz") - .withAppUserModelId("rgnowcjhfgm") - .withFriendlyName("cact") - .withIconImageName("wotey"), - new MsixPackageApplications().withAppId("uqovekqvgqouwif") - .withDescription("pjwyiv") - .withAppUserModelId("kfxcvhrfs") - .withFriendlyName("uagrttikteusqc") - .withIconImageName("vyklxuby"), - new MsixPackageApplications().withAppId("mmfblcqcuubgqib") - .withDescription("a") - .withAppUserModelId("etttwgdslqxihhr") - .withFriendlyName("oi") - .withIconImageName("seypxiutcxapz"))) - .withCertificateName("etoge") - .withCertificateExpiry(OffsetDateTime.parse("2021-06-21T12:50:27Z")) - .withIsPackageTimestamped(PackageTimestamped.NOT_TIMESTAMPED); - model = BinaryData.fromObject(model).toObject(AppAttachPackageInfoProperties.class); - Assertions.assertEquals("xvd", model.packageAlias()); - Assertions.assertEquals("fwafqrouda", model.imagePath()); - Assertions.assertEquals("avehhrvkbunzo", model.packageName()); - Assertions.assertEquals("dhcxgkmoy", model.packageFamilyName()); - Assertions.assertEquals("dyuib", model.packageFullName()); - Assertions.assertEquals("fdn", model.displayName()); - Assertions.assertEquals("ydvfvfcjnae", model.packageRelativePath()); - Assertions.assertEquals(true, model.isRegularRegistration()); - Assertions.assertEquals(true, model.isActive()); - Assertions.assertEquals("orffukiscv", model.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("zhwplefaxvxilc", model.packageDependencies().get(0).publisher()); - Assertions.assertEquals("gnhnzeyq", model.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("dmozu", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-08T21:05:34Z"), model.lastUpdated()); - Assertions.assertEquals("tkad", model.packageApplications().get(0).appId()); - Assertions.assertEquals("s", model.packageApplications().get(0).description()); - Assertions.assertEquals("nbtgkbugrjqctoj", model.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("isofieypefojyqd", model.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("u", model.packageApplications().get(0).iconImageName()); - Assertions.assertEquals("etoge", model.certificateName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-21T12:50:27Z"), model.certificateExpiry()); - Assertions.assertEquals(PackageTimestamped.NOT_TIMESTAMPED, model.isPackageTimestamped()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackagesDeleteByResourceGroupWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackagesDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index e1bcc47af3be..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackagesDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AppAttachPackagesDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.appAttachPackages().deleteByResourceGroupWithResponse("z", "yckzex", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPatchPropertiesTests.java deleted file mode 100644 index fac02616382b..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPatchPropertiesTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationGroupPatchProperties; -import org.junit.jupiter.api.Assertions; - -public final class ApplicationGroupPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplicationGroupPatchProperties model - = BinaryData.fromString("{\"description\":\"pvhelxprg\",\"friendlyName\":\"atddc\",\"showInFeed\":true}") - .toObject(ApplicationGroupPatchProperties.class); - Assertions.assertEquals("pvhelxprg", model.description()); - Assertions.assertEquals("atddc", model.friendlyName()); - Assertions.assertEquals(true, model.showInFeed()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationGroupPatchProperties model = new ApplicationGroupPatchProperties().withDescription("pvhelxprg") - .withFriendlyName("atddc") - .withShowInFeed(true); - model = BinaryData.fromObject(model).toObject(ApplicationGroupPatchProperties.class); - Assertions.assertEquals("pvhelxprg", model.description()); - Assertions.assertEquals("atddc", model.friendlyName()); - Assertions.assertEquals(true, model.showInFeed()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPatchTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPatchTests.java deleted file mode 100644 index 3d5dcd4a643e..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPatchTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupPatch; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ApplicationGroupPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplicationGroupPatch model = BinaryData.fromString( - "{\"tags\":{\"modfvuefywsbpfvm\":\"dggkzzlvmbmpa\",\"yzvqt\":\"yhrfouyftaakcpw\",\"zksmondj\":\"nubexk\"},\"properties\":{\"description\":\"xvy\",\"friendlyName\":\"mg\",\"showInFeed\":true},\"id\":\"whojvp\",\"name\":\"jqg\",\"type\":\"ysmocmbqfqvmkcxo\"}") - .toObject(ApplicationGroupPatch.class); - Assertions.assertEquals("dggkzzlvmbmpa", model.tags().get("modfvuefywsbpfvm")); - Assertions.assertEquals("xvy", model.description()); - Assertions.assertEquals("mg", model.friendlyName()); - Assertions.assertEquals(true, model.showInFeed()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationGroupPatch model = new ApplicationGroupPatch() - .withTags(mapOf("modfvuefywsbpfvm", "dggkzzlvmbmpa", "yzvqt", "yhrfouyftaakcpw", "zksmondj", "nubexk")) - .withDescription("xvy") - .withFriendlyName("mg") - .withShowInFeed(true); - model = BinaryData.fromObject(model).toObject(ApplicationGroupPatch.class); - Assertions.assertEquals("dggkzzlvmbmpa", model.tags().get("modfvuefywsbpfvm")); - Assertions.assertEquals("xvy", model.description()); - Assertions.assertEquals("mg", model.friendlyName()); - Assertions.assertEquals(true, model.showInFeed()); - } - - // 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/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPropertiesTests.java deleted file mode 100644 index 7bdf0ec31758..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationGroupProperties; -import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupType; -import org.junit.jupiter.api.Assertions; - -public final class ApplicationGroupPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplicationGroupProperties model = BinaryData.fromString( - "{\"objectId\":\"keqdcvdrhvoods\",\"description\":\"bobzdopcjwvnhd\",\"friendlyName\":\"wmgxcxrsl\",\"hostPoolArmPath\":\"mutwuoe\",\"workspaceArmPath\":\"pkhjwni\",\"applicationGroupType\":\"RemoteApp\",\"cloudPcResource\":true,\"showInFeed\":false}") - .toObject(ApplicationGroupProperties.class); - Assertions.assertEquals("bobzdopcjwvnhd", model.description()); - Assertions.assertEquals("wmgxcxrsl", model.friendlyName()); - Assertions.assertEquals("mutwuoe", model.hostPoolArmPath()); - Assertions.assertEquals(ApplicationGroupType.REMOTE_APP, model.applicationGroupType()); - Assertions.assertEquals(false, model.showInFeed()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationGroupProperties model = new ApplicationGroupProperties().withDescription("bobzdopcjwvnhd") - .withFriendlyName("wmgxcxrsl") - .withHostPoolArmPath("mutwuoe") - .withApplicationGroupType(ApplicationGroupType.REMOTE_APP) - .withShowInFeed(false); - model = BinaryData.fromObject(model).toObject(ApplicationGroupProperties.class); - Assertions.assertEquals("bobzdopcjwvnhd", model.description()); - Assertions.assertEquals("wmgxcxrsl", model.friendlyName()); - Assertions.assertEquals("mutwuoe", model.hostPoolArmPath()); - Assertions.assertEquals(ApplicationGroupType.REMOTE_APP, model.applicationGroupType()); - Assertions.assertEquals(false, model.showInFeed()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsDeleteByResourceGroupWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 9ab5a3dcc9fa..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApplicationGroupsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.applicationGroups().deleteByResourceGroupWithResponse("bjpi", "k", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationInnerTests.java deleted file mode 100644 index f8c454bb1220..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationInnerTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationInner; -import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; -import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; -import org.junit.jupiter.api.Assertions; - -public final class ApplicationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplicationInner model = BinaryData.fromString( - "{\"properties\":{\"objectId\":\"yhgsy\",\"description\":\"ogjltdtbnnhad\",\"friendlyName\":\"crkvcikhnv\",\"filePath\":\"mqg\",\"msixPackageFamilyName\":\"queziky\",\"msixPackageApplicationId\":\"gxk\",\"applicationType\":\"InBuilt\",\"commandLineSetting\":\"DoNotAllow\",\"commandLineArguments\":\"melwuipiccjz\",\"showInPortal\":false,\"iconPath\":\"gvvcnayrhyr\",\"iconIndex\":1580005747,\"iconHash\":\"ueedndrdvs\"},\"id\":\"qqtch\",\"name\":\"alm\",\"type\":\"mtdaa\"}") - .toObject(ApplicationInner.class); - Assertions.assertEquals("ogjltdtbnnhad", model.description()); - Assertions.assertEquals("crkvcikhnv", model.friendlyName()); - Assertions.assertEquals("mqg", model.filePath()); - Assertions.assertEquals("queziky", model.msixPackageFamilyName()); - Assertions.assertEquals("gxk", model.msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.applicationType()); - Assertions.assertEquals(CommandLineSetting.DO_NOT_ALLOW, model.commandLineSetting()); - Assertions.assertEquals("melwuipiccjz", model.commandLineArguments()); - Assertions.assertEquals(false, model.showInPortal()); - Assertions.assertEquals("gvvcnayrhyr", model.iconPath()); - Assertions.assertEquals(1580005747, model.iconIndex()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationInner model = new ApplicationInner().withDescription("ogjltdtbnnhad") - .withFriendlyName("crkvcikhnv") - .withFilePath("mqg") - .withMsixPackageFamilyName("queziky") - .withMsixPackageApplicationId("gxk") - .withApplicationType(RemoteApplicationType.IN_BUILT) - .withCommandLineSetting(CommandLineSetting.DO_NOT_ALLOW) - .withCommandLineArguments("melwuipiccjz") - .withShowInPortal(false) - .withIconPath("gvvcnayrhyr") - .withIconIndex(1580005747); - model = BinaryData.fromObject(model).toObject(ApplicationInner.class); - Assertions.assertEquals("ogjltdtbnnhad", model.description()); - Assertions.assertEquals("crkvcikhnv", model.friendlyName()); - Assertions.assertEquals("mqg", model.filePath()); - Assertions.assertEquals("queziky", model.msixPackageFamilyName()); - Assertions.assertEquals("gxk", model.msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.applicationType()); - Assertions.assertEquals(CommandLineSetting.DO_NOT_ALLOW, model.commandLineSetting()); - Assertions.assertEquals("melwuipiccjz", model.commandLineArguments()); - Assertions.assertEquals(false, model.showInPortal()); - Assertions.assertEquals("gvvcnayrhyr", model.iconPath()); - Assertions.assertEquals(1580005747, model.iconIndex()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationListTests.java deleted file mode 100644 index e6d3bb395fd8..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationListTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationInner; -import com.azure.resourcemanager.desktopvirtualization.models.ApplicationList; -import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; -import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ApplicationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplicationList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"objectId\":\"qugjhkycube\",\"description\":\"gssofwq\",\"friendlyName\":\"qal\",\"filePath\":\"mnjijpxacqqudf\",\"msixPackageFamilyName\":\"yxbaaabjyvayf\",\"msixPackageApplicationId\":\"m\",\"applicationType\":\"InBuilt\",\"commandLineSetting\":\"Require\",\"commandLineArguments\":\"zqogse\",\"showInPortal\":true,\"iconPath\":\"fdnw\",\"iconIndex\":2059840008,\"iconHash\":\"wzsyyceuzs\"},\"id\":\"judpfrxt\",\"name\":\"thzvaytdwkqbrqu\",\"type\":\"paxh\"},{\"properties\":{\"objectId\":\"iilivpdtiirqtd\",\"description\":\"axoruzfgsquy\",\"friendlyName\":\"rxxle\",\"filePath\":\"ramxjezwlwnw\",\"msixPackageFamilyName\":\"qlcvydy\",\"msixPackageApplicationId\":\"tdooaoj\",\"applicationType\":\"MsixApplication\",\"commandLineSetting\":\"Require\",\"commandLineArguments\":\"kooebwnu\",\"showInPortal\":true,\"iconPath\":\"msbvdkcrodtjinf\",\"iconIndex\":1492452539,\"iconHash\":\"lt\"},\"id\":\"jvefkdlfoakggkfp\",\"name\":\"gaowpulpqblylsyx\",\"type\":\"qjnsjervtia\"},{\"properties\":{\"objectId\":\"sdszue\",\"description\":\"sbzkf\",\"friendlyName\":\"eyvpnqicvinvkj\",\"filePath\":\"dxrbuukzcle\",\"msixPackageFamilyName\":\"hmlwpaztzpo\",\"msixPackageApplicationId\":\"cckwyfzqwhxxbu\",\"applicationType\":\"InBuilt\",\"commandLineSetting\":\"Require\",\"commandLineArguments\":\"feqztppriol\",\"showInPortal\":true,\"iconPath\":\"altol\",\"iconIndex\":136991246,\"iconHash\":\"sobqw\"},\"id\":\"bnwdcfh\",\"name\":\"cqdpfuv\",\"type\":\"lsbjjcanvxbv\"}],\"nextLink\":\"udutnco\"}") - .toObject(ApplicationList.class); - Assertions.assertEquals("gssofwq", model.value().get(0).description()); - Assertions.assertEquals("qal", model.value().get(0).friendlyName()); - Assertions.assertEquals("mnjijpxacqqudf", model.value().get(0).filePath()); - Assertions.assertEquals("yxbaaabjyvayf", model.value().get(0).msixPackageFamilyName()); - Assertions.assertEquals("m", model.value().get(0).msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.value().get(0).applicationType()); - Assertions.assertEquals(CommandLineSetting.REQUIRE, model.value().get(0).commandLineSetting()); - Assertions.assertEquals("zqogse", model.value().get(0).commandLineArguments()); - Assertions.assertEquals(true, model.value().get(0).showInPortal()); - Assertions.assertEquals("fdnw", model.value().get(0).iconPath()); - Assertions.assertEquals(2059840008, model.value().get(0).iconIndex()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationList model = new ApplicationList().withValue(Arrays.asList( - new ApplicationInner().withDescription("gssofwq") - .withFriendlyName("qal") - .withFilePath("mnjijpxacqqudf") - .withMsixPackageFamilyName("yxbaaabjyvayf") - .withMsixPackageApplicationId("m") - .withApplicationType(RemoteApplicationType.IN_BUILT) - .withCommandLineSetting(CommandLineSetting.REQUIRE) - .withCommandLineArguments("zqogse") - .withShowInPortal(true) - .withIconPath("fdnw") - .withIconIndex(2059840008), - new ApplicationInner().withDescription("axoruzfgsquy") - .withFriendlyName("rxxle") - .withFilePath("ramxjezwlwnw") - .withMsixPackageFamilyName("qlcvydy") - .withMsixPackageApplicationId("tdooaoj") - .withApplicationType(RemoteApplicationType.MSIX_APPLICATION) - .withCommandLineSetting(CommandLineSetting.REQUIRE) - .withCommandLineArguments("kooebwnu") - .withShowInPortal(true) - .withIconPath("msbvdkcrodtjinf") - .withIconIndex(1492452539), - new ApplicationInner().withDescription("sbzkf") - .withFriendlyName("eyvpnqicvinvkj") - .withFilePath("dxrbuukzcle") - .withMsixPackageFamilyName("hmlwpaztzpo") - .withMsixPackageApplicationId("cckwyfzqwhxxbu") - .withApplicationType(RemoteApplicationType.IN_BUILT) - .withCommandLineSetting(CommandLineSetting.REQUIRE) - .withCommandLineArguments("feqztppriol") - .withShowInPortal(true) - .withIconPath("altol") - .withIconIndex(136991246))); - model = BinaryData.fromObject(model).toObject(ApplicationList.class); - Assertions.assertEquals("gssofwq", model.value().get(0).description()); - Assertions.assertEquals("qal", model.value().get(0).friendlyName()); - Assertions.assertEquals("mnjijpxacqqudf", model.value().get(0).filePath()); - Assertions.assertEquals("yxbaaabjyvayf", model.value().get(0).msixPackageFamilyName()); - Assertions.assertEquals("m", model.value().get(0).msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.value().get(0).applicationType()); - Assertions.assertEquals(CommandLineSetting.REQUIRE, model.value().get(0).commandLineSetting()); - Assertions.assertEquals("zqogse", model.value().get(0).commandLineArguments()); - Assertions.assertEquals(true, model.value().get(0).showInPortal()); - Assertions.assertEquals("fdnw", model.value().get(0).iconPath()); - Assertions.assertEquals(2059840008, model.value().get(0).iconIndex()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPatchPropertiesTests.java deleted file mode 100644 index af2d601b5a21..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPatchPropertiesTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationPatchProperties; -import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; -import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; -import org.junit.jupiter.api.Assertions; - -public final class ApplicationPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplicationPatchProperties model = BinaryData.fromString( - "{\"description\":\"dunyg\",\"friendlyName\":\"qidbqfatpxllrxcy\",\"filePath\":\"oadsuvar\",\"commandLineSetting\":\"Allow\",\"commandLineArguments\":\"mjsjqb\",\"showInPortal\":true,\"iconPath\":\"x\",\"iconIndex\":1337445939,\"msixPackageFamilyName\":\"yc\",\"msixPackageApplicationId\":\"uhpkxkgymar\",\"applicationType\":\"InBuilt\"}") - .toObject(ApplicationPatchProperties.class); - Assertions.assertEquals("dunyg", model.description()); - Assertions.assertEquals("qidbqfatpxllrxcy", model.friendlyName()); - Assertions.assertEquals("oadsuvar", model.filePath()); - Assertions.assertEquals(CommandLineSetting.ALLOW, model.commandLineSetting()); - Assertions.assertEquals("mjsjqb", model.commandLineArguments()); - Assertions.assertEquals(true, model.showInPortal()); - Assertions.assertEquals("x", model.iconPath()); - Assertions.assertEquals(1337445939, model.iconIndex()); - Assertions.assertEquals("yc", model.msixPackageFamilyName()); - Assertions.assertEquals("uhpkxkgymar", model.msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.applicationType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationPatchProperties model = new ApplicationPatchProperties().withDescription("dunyg") - .withFriendlyName("qidbqfatpxllrxcy") - .withFilePath("oadsuvar") - .withCommandLineSetting(CommandLineSetting.ALLOW) - .withCommandLineArguments("mjsjqb") - .withShowInPortal(true) - .withIconPath("x") - .withIconIndex(1337445939) - .withMsixPackageFamilyName("yc") - .withMsixPackageApplicationId("uhpkxkgymar") - .withApplicationType(RemoteApplicationType.IN_BUILT); - model = BinaryData.fromObject(model).toObject(ApplicationPatchProperties.class); - Assertions.assertEquals("dunyg", model.description()); - Assertions.assertEquals("qidbqfatpxllrxcy", model.friendlyName()); - Assertions.assertEquals("oadsuvar", model.filePath()); - Assertions.assertEquals(CommandLineSetting.ALLOW, model.commandLineSetting()); - Assertions.assertEquals("mjsjqb", model.commandLineArguments()); - Assertions.assertEquals(true, model.showInPortal()); - Assertions.assertEquals("x", model.iconPath()); - Assertions.assertEquals(1337445939, model.iconIndex()); - Assertions.assertEquals("yc", model.msixPackageFamilyName()); - Assertions.assertEquals("uhpkxkgymar", model.msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.applicationType()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPatchTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPatchTests.java deleted file mode 100644 index 90a7483601c5..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPatchTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.ApplicationPatch; -import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; -import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ApplicationPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplicationPatch model = BinaryData.fromString( - "{\"tags\":{\"tkl\":\"aenwabf\"},\"properties\":{\"description\":\"bjhwuaan\",\"friendlyName\":\"jos\",\"filePath\":\"youlp\",\"commandLineSetting\":\"Require\",\"commandLineArguments\":\"ag\",\"showInPortal\":false,\"iconPath\":\"mjwosytx\",\"iconIndex\":1413257471,\"msixPackageFamilyName\":\"kfcktqum\",\"msixPackageApplicationId\":\"kkezzikhlyfjhdgq\",\"applicationType\":\"InBuilt\"}}") - .toObject(ApplicationPatch.class); - Assertions.assertEquals("aenwabf", model.tags().get("tkl")); - Assertions.assertEquals("bjhwuaan", model.description()); - Assertions.assertEquals("jos", model.friendlyName()); - Assertions.assertEquals("youlp", model.filePath()); - Assertions.assertEquals(CommandLineSetting.REQUIRE, model.commandLineSetting()); - Assertions.assertEquals("ag", model.commandLineArguments()); - Assertions.assertEquals(false, model.showInPortal()); - Assertions.assertEquals("mjwosytx", model.iconPath()); - Assertions.assertEquals(1413257471, model.iconIndex()); - Assertions.assertEquals("kfcktqum", model.msixPackageFamilyName()); - Assertions.assertEquals("kkezzikhlyfjhdgq", model.msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.applicationType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationPatch model = new ApplicationPatch().withTags(mapOf("tkl", "aenwabf")) - .withDescription("bjhwuaan") - .withFriendlyName("jos") - .withFilePath("youlp") - .withCommandLineSetting(CommandLineSetting.REQUIRE) - .withCommandLineArguments("ag") - .withShowInPortal(false) - .withIconPath("mjwosytx") - .withIconIndex(1413257471) - .withMsixPackageFamilyName("kfcktqum") - .withMsixPackageApplicationId("kkezzikhlyfjhdgq") - .withApplicationType(RemoteApplicationType.IN_BUILT); - model = BinaryData.fromObject(model).toObject(ApplicationPatch.class); - Assertions.assertEquals("aenwabf", model.tags().get("tkl")); - Assertions.assertEquals("bjhwuaan", model.description()); - Assertions.assertEquals("jos", model.friendlyName()); - Assertions.assertEquals("youlp", model.filePath()); - Assertions.assertEquals(CommandLineSetting.REQUIRE, model.commandLineSetting()); - Assertions.assertEquals("ag", model.commandLineArguments()); - Assertions.assertEquals(false, model.showInPortal()); - Assertions.assertEquals("mjwosytx", model.iconPath()); - Assertions.assertEquals(1413257471, model.iconIndex()); - Assertions.assertEquals("kfcktqum", model.msixPackageFamilyName()); - Assertions.assertEquals("kkezzikhlyfjhdgq", model.msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.applicationType()); - } - - // 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/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPropertiesTests.java deleted file mode 100644 index 8ec0dbd358e7..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPropertiesTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationProperties; -import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; -import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; -import org.junit.jupiter.api.Assertions; - -public final class ApplicationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplicationProperties model = BinaryData.fromString( - "{\"objectId\":\"dvwvgpio\",\"description\":\"wxrt\",\"friendlyName\":\"dxepxgyq\",\"filePath\":\"vrvmnpkukghim\",\"msixPackageFamilyName\":\"lxgwimfnjhf\",\"msixPackageApplicationId\":\"wmszkk\",\"applicationType\":\"InBuilt\",\"commandLineSetting\":\"Require\",\"commandLineArguments\":\"yfkzik\",\"showInPortal\":false,\"iconPath\":\"n\",\"iconIndex\":693357808,\"iconHash\":\"xwczelpcire\"}") - .toObject(ApplicationProperties.class); - Assertions.assertEquals("wxrt", model.description()); - Assertions.assertEquals("dxepxgyq", model.friendlyName()); - Assertions.assertEquals("vrvmnpkukghim", model.filePath()); - Assertions.assertEquals("lxgwimfnjhf", model.msixPackageFamilyName()); - Assertions.assertEquals("wmszkk", model.msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.applicationType()); - Assertions.assertEquals(CommandLineSetting.REQUIRE, model.commandLineSetting()); - Assertions.assertEquals("yfkzik", model.commandLineArguments()); - Assertions.assertEquals(false, model.showInPortal()); - Assertions.assertEquals("n", model.iconPath()); - Assertions.assertEquals(693357808, model.iconIndex()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationProperties model = new ApplicationProperties().withDescription("wxrt") - .withFriendlyName("dxepxgyq") - .withFilePath("vrvmnpkukghim") - .withMsixPackageFamilyName("lxgwimfnjhf") - .withMsixPackageApplicationId("wmszkk") - .withApplicationType(RemoteApplicationType.IN_BUILT) - .withCommandLineSetting(CommandLineSetting.REQUIRE) - .withCommandLineArguments("yfkzik") - .withShowInPortal(false) - .withIconPath("n") - .withIconIndex(693357808); - model = BinaryData.fromObject(model).toObject(ApplicationProperties.class); - Assertions.assertEquals("wxrt", model.description()); - Assertions.assertEquals("dxepxgyq", model.friendlyName()); - Assertions.assertEquals("vrvmnpkukghim", model.filePath()); - Assertions.assertEquals("lxgwimfnjhf", model.msixPackageFamilyName()); - Assertions.assertEquals("wmszkk", model.msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.applicationType()); - Assertions.assertEquals(CommandLineSetting.REQUIRE, model.commandLineSetting()); - Assertions.assertEquals("yfkzik", model.commandLineArguments()); - Assertions.assertEquals(false, model.showInPortal()); - Assertions.assertEquals("n", model.iconPath()); - Assertions.assertEquals(693357808, model.iconIndex()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsCreateOrUpdateWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 83e9a9723bb3..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.Application; -import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; -import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApplicationsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"objectId\":\"ychocokulehu\",\"description\":\"lrqff\",\"friendlyName\":\"eyu\",\"filePath\":\"phyjdxravj\",\"msixPackageFamilyName\":\"dbrxmrgc\",\"msixPackageApplicationId\":\"apx\",\"applicationType\":\"InBuilt\",\"commandLineSetting\":\"Allow\",\"commandLineArguments\":\"j\",\"showInPortal\":false,\"iconPath\":\"buscgduus\",\"iconIndex\":327298977,\"iconHash\":\"blevpmcluj\"},\"id\":\"yxlzgs\",\"name\":\"gkzz\",\"type\":\"taf\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Application response = manager.applications() - .define("nbbklqpxzucafed") - .withExistingApplicationGroup("ztwhghmupg", "yjtcdxabbujftab") - .withCommandLineSetting(CommandLineSetting.DO_NOT_ALLOW) - .withDescription("nhgookrtalvnbw") - .withFriendlyName("bemeluclvd") - .withFilePath("ukyrdnqodxahh") - .withMsixPackageFamilyName("qfaqnvzoqg") - .withMsixPackageApplicationId("pem") - .withApplicationType(RemoteApplicationType.MSIX_APPLICATION) - .withCommandLineArguments("sczuejdtxptlghwz") - .withShowInPortal(true) - .withIconPath("wjjstliuhqa") - .withIconIndex(1594084129) - .create(); - - Assertions.assertEquals("lrqff", response.description()); - Assertions.assertEquals("eyu", response.friendlyName()); - Assertions.assertEquals("phyjdxravj", response.filePath()); - Assertions.assertEquals("dbrxmrgc", response.msixPackageFamilyName()); - Assertions.assertEquals("apx", response.msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.IN_BUILT, response.applicationType()); - Assertions.assertEquals(CommandLineSetting.ALLOW, response.commandLineSetting()); - Assertions.assertEquals("j", response.commandLineArguments()); - Assertions.assertEquals(false, response.showInPortal()); - Assertions.assertEquals("buscgduus", response.iconPath()); - Assertions.assertEquals(327298977, response.iconIndex()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsDeleteWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsDeleteWithResponseMockTests.java deleted file mode 100644 index d3ff85127aed..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApplicationsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.applications() - .deleteWithResponse("o", "mffjkutycyarn", "oohguabzoghkt", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsGetWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsGetWithResponseMockTests.java deleted file mode 100644 index 7172c71968f9..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsGetWithResponseMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.Application; -import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; -import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApplicationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"objectId\":\"lnjpnnbmjksibjgs\",\"description\":\"xxahmrnadzyqegxy\",\"friendlyName\":\"pinbmhwbjijkgqxn\",\"filePath\":\"bkezn\",\"msixPackageFamilyName\":\"ujvaannggi\",\"msixPackageApplicationId\":\"wkdtaawxwf\",\"applicationType\":\"MsixApplication\",\"commandLineSetting\":\"Allow\",\"commandLineArguments\":\"rrqmbzmqk\",\"showInPortal\":true,\"iconPath\":\"nxwbjsidbirkfp\",\"iconIndex\":1826352980,\"iconHash\":\"dgo\"},\"id\":\"ijymrhbguzozky\",\"name\":\"wnf\",\"type\":\"zhhh\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Application response = manager.applications() - .getWithResponse("blto", "rmkfqlwxldykals", "g", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xxahmrnadzyqegxy", response.description()); - Assertions.assertEquals("pinbmhwbjijkgqxn", response.friendlyName()); - Assertions.assertEquals("bkezn", response.filePath()); - Assertions.assertEquals("ujvaannggi", response.msixPackageFamilyName()); - Assertions.assertEquals("wkdtaawxwf", response.msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.MSIX_APPLICATION, response.applicationType()); - Assertions.assertEquals(CommandLineSetting.ALLOW, response.commandLineSetting()); - Assertions.assertEquals("rrqmbzmqk", response.commandLineArguments()); - Assertions.assertEquals(true, response.showInPortal()); - Assertions.assertEquals("nxwbjsidbirkfp", response.iconPath()); - Assertions.assertEquals(1826352980, response.iconIndex()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsListMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsListMockTests.java deleted file mode 100644 index 529774286c17..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsListMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.Application; -import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; -import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApplicationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"objectId\":\"zcfyjzptwrl\",\"description\":\"apqinf\",\"friendlyName\":\"pyglqdhmrjzral\",\"filePath\":\"pjby\",\"msixPackageFamilyName\":\"sjoqcjenkyhfqzvs\",\"msixPackageApplicationId\":\"fxjelg\",\"applicationType\":\"InBuilt\",\"commandLineSetting\":\"Allow\",\"commandLineArguments\":\"jhhhqxu\",\"showInPortal\":false,\"iconPath\":\"acoyvivbsizusjs\",\"iconIndex\":849789743,\"iconHash\":\"cmnlzijiufehg\"},\"id\":\"lnwyvqkxr\",\"name\":\"rlniyl\",\"type\":\"lyfwxzutg\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.applications() - .list("pyc", "hcoeocnhzq", 490198626, true, 368546114, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("apqinf", response.iterator().next().description()); - Assertions.assertEquals("pyglqdhmrjzral", response.iterator().next().friendlyName()); - Assertions.assertEquals("pjby", response.iterator().next().filePath()); - Assertions.assertEquals("sjoqcjenkyhfqzvs", response.iterator().next().msixPackageFamilyName()); - Assertions.assertEquals("fxjelg", response.iterator().next().msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.IN_BUILT, response.iterator().next().applicationType()); - Assertions.assertEquals(CommandLineSetting.ALLOW, response.iterator().next().commandLineSetting()); - Assertions.assertEquals("jhhhqxu", response.iterator().next().commandLineArguments()); - Assertions.assertEquals(false, response.iterator().next().showInPortal()); - Assertions.assertEquals("acoyvivbsizusjs", response.iterator().next().iconPath()); - Assertions.assertEquals(849789743, response.iterator().next().iconIndex()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopInnerTests.java deleted file mode 100644 index 6d2d40f42aa4..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopInnerTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.DesktopInner; -import org.junit.jupiter.api.Assertions; - -public final class DesktopInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DesktopInner model = BinaryData.fromString( - "{\"properties\":{\"objectId\":\"lxqtvcofudfl\",\"description\":\"gj\",\"friendlyName\":\"gdknnqv\",\"iconHash\":\"znqntoru\"},\"id\":\"sahmky\",\"name\":\"grauwjuetaebur\",\"type\":\"vdmovsmzlxwabm\"}") - .toObject(DesktopInner.class); - Assertions.assertEquals("gj", model.description()); - Assertions.assertEquals("gdknnqv", model.friendlyName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DesktopInner model = new DesktopInner().withDescription("gj").withFriendlyName("gdknnqv"); - model = BinaryData.fromObject(model).toObject(DesktopInner.class); - Assertions.assertEquals("gj", model.description()); - Assertions.assertEquals("gdknnqv", model.friendlyName()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopListTests.java deleted file mode 100644 index f5977d0fee54..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopListTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.DesktopInner; -import com.azure.resourcemanager.desktopvirtualization.models.DesktopList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DesktopListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DesktopList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"objectId\":\"bt\",\"description\":\"sfraoyzko\",\"friendlyName\":\"tlmngu\",\"iconHash\":\"wqaldsyu\"},\"id\":\"merqfobwyznkb\",\"name\":\"kutwpf\",\"type\":\"pagmhrskdsnf\"},{\"properties\":{\"objectId\":\"oakgtdlmkkzev\",\"description\":\"hewpusdsttwv\",\"friendlyName\":\"vbbejdcng\",\"iconHash\":\"m\"},\"id\":\"ufgmjzrwrdg\",\"name\":\"twaenuuzko\",\"type\":\"bminrfdwoyuhhzi\"},{\"properties\":{\"objectId\":\"fozbhdmsmlmzqhof\",\"description\":\"maequiahxicslfa\",\"friendlyName\":\"z\",\"iconHash\":\"yylhalnswhccsp\"},\"id\":\"ivwitqscywugg\",\"name\":\"oluhczbwemh\",\"type\":\"i\"}],\"nextLink\":\"brgz\"}") - .toObject(DesktopList.class); - Assertions.assertEquals("sfraoyzko", model.value().get(0).description()); - Assertions.assertEquals("tlmngu", model.value().get(0).friendlyName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DesktopList model = new DesktopList() - .withValue(Arrays.asList(new DesktopInner().withDescription("sfraoyzko").withFriendlyName("tlmngu"), - new DesktopInner().withDescription("hewpusdsttwv").withFriendlyName("vbbejdcng"), - new DesktopInner().withDescription("maequiahxicslfa").withFriendlyName("z"))); - model = BinaryData.fromObject(model).toObject(DesktopList.class); - Assertions.assertEquals("sfraoyzko", model.value().get(0).description()); - Assertions.assertEquals("tlmngu", model.value().get(0).friendlyName()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPatchPropertiesTests.java deleted file mode 100644 index 5906a13d6317..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPatchPropertiesTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.DesktopPatchProperties; -import org.junit.jupiter.api.Assertions; - -public final class DesktopPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DesktopPatchProperties model = BinaryData.fromString("{\"description\":\"z\",\"friendlyName\":\"mrv\"}") - .toObject(DesktopPatchProperties.class); - Assertions.assertEquals("z", model.description()); - Assertions.assertEquals("mrv", model.friendlyName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DesktopPatchProperties model = new DesktopPatchProperties().withDescription("z").withFriendlyName("mrv"); - model = BinaryData.fromObject(model).toObject(DesktopPatchProperties.class); - Assertions.assertEquals("z", model.description()); - Assertions.assertEquals("mrv", model.friendlyName()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPatchTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPatchTests.java deleted file mode 100644 index c70c8aecdead..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPatchTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.DesktopPatch; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DesktopPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DesktopPatch model = BinaryData.fromString( - "{\"tags\":{\"dcpzfoqo\":\"zkoj\",\"ybxarzgszu\":\"i\",\"hkh\":\"oxciqopidoamcio\"},\"properties\":{\"description\":\"khnzbonlw\",\"friendlyName\":\"oegokdwbwh\"}}") - .toObject(DesktopPatch.class); - Assertions.assertEquals("zkoj", model.tags().get("dcpzfoqo")); - Assertions.assertEquals("khnzbonlw", model.description()); - Assertions.assertEquals("oegokdwbwh", model.friendlyName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DesktopPatch model - = new DesktopPatch().withTags(mapOf("dcpzfoqo", "zkoj", "ybxarzgszu", "i", "hkh", "oxciqopidoamcio")) - .withDescription("khnzbonlw") - .withFriendlyName("oegokdwbwh"); - model = BinaryData.fromObject(model).toObject(DesktopPatch.class); - Assertions.assertEquals("zkoj", model.tags().get("dcpzfoqo")); - Assertions.assertEquals("khnzbonlw", model.description()); - Assertions.assertEquals("oegokdwbwh", model.friendlyName()); - } - - // 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/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPropertiesTests.java deleted file mode 100644 index e6a89e92b973..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.DesktopProperties; -import org.junit.jupiter.api.Assertions; - -public final class DesktopPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DesktopProperties model = BinaryData.fromString( - "{\"objectId\":\"efkifr\",\"description\":\"puqujmqlgkfbtn\",\"friendlyName\":\"aongbj\",\"iconHash\":\"tujitcjedft\"}") - .toObject(DesktopProperties.class); - Assertions.assertEquals("puqujmqlgkfbtn", model.description()); - Assertions.assertEquals("aongbj", model.friendlyName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DesktopProperties model = new DesktopProperties().withDescription("puqujmqlgkfbtn").withFriendlyName("aongbj"); - model = BinaryData.fromObject(model).toObject(DesktopProperties.class); - Assertions.assertEquals("puqujmqlgkfbtn", model.description()); - Assertions.assertEquals("aongbj", model.friendlyName()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsGetWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsGetWithResponseMockTests.java deleted file mode 100644 index d2458c064c5a..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsGetWithResponseMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.Desktop; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DesktopsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"objectId\":\"jtks\",\"description\":\"gcgqyhleseyqrhvy\",\"friendlyName\":\"dotjvdk\",\"iconHash\":\"swskuk\"},\"id\":\"sbvw\",\"name\":\"spkxkdt\",\"type\":\"fkndl\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Desktop response = manager.desktops() - .getWithResponse("bzf", "ovwmbjlzqsczpgvd", "napfdqwowftpt", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("gcgqyhleseyqrhvy", response.description()); - Assertions.assertEquals("dotjvdk", response.friendlyName()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsListMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsListMockTests.java deleted file mode 100644 index e4695f20aacd..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsListMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.Desktop; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DesktopsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"objectId\":\"mxhzzysevus\",\"description\":\"vzrrryveimi\",\"friendlyName\":\"kdyzatvfuzk\",\"iconHash\":\"tjvv\"},\"id\":\"wigsyeipqdsm\",\"name\":\"tgrqgdgkkile\",\"type\":\"lkcsmknhwtbbae\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.desktops().list("blhtjq", "qyv", 269491033, false, 792358698, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vzrrryveimi", response.iterator().next().description()); - Assertions.assertEquals("kdyzatvfuzk", response.iterator().next().friendlyName()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsUpdateWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsUpdateWithResponseMockTests.java deleted file mode 100644 index 2375dbde64b1..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsUpdateWithResponseMockTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.Desktop; -import com.azure.resourcemanager.desktopvirtualization.models.DesktopPatch; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DesktopsUpdateWithResponseMockTests { - @Test - public void testUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"objectId\":\"bwptdacarvvlf\",\"description\":\"ymtpo\",\"friendlyName\":\"enazerohzrsqals\",\"iconHash\":\"dnwqapfg\"},\"id\":\"cve\",\"name\":\"smzhhkuuipldqqct\",\"type\":\"kva\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Desktop response = manager.desktops() - .updateWithResponse("vtwknvgmmbugt", "watmqa", "kueatgroeshoy", - new DesktopPatch().withTags(mapOf("ehqpuvjmvqmt", "byfqxkfaoy", "ejnndljdju", "wckygr")) - .withDescription("rreqynkceysfaqe") - .withFriendlyName("lwryshwddkvbxgkq"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ymtpo", response.description()); - Assertions.assertEquals("enazerohzrsqals", response.friendlyName()); - } - - // 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/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImageInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImageInnerTests.java deleted file mode 100644 index 2cbe2c5ffdad..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImageInnerTests.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ExpandMsixImageInner; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ExpandMsixImageInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExpandMsixImageInner model = BinaryData.fromString( - "{\"properties\":{\"packageAlias\":\"sdf\",\"imagePath\":\"bg\",\"packageName\":\"kylkdghrj\",\"packageFamilyName\":\"utlwxezwzhok\",\"packageFullName\":\"wnhhtqlgehgppip\",\"displayName\":\"hpfeoajvgcxtxjc\",\"packageRelativePath\":\"eafidltugsresm\",\"isRegularRegistration\":true,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"txfkfweg\",\"publisher\":\"hpt\",\"minVersion\":\"lucbiqtgdqohm\"},{\"dependencyName\":\"sldrizetpwbral\",\"publisher\":\"ibph\",\"minVersion\":\"zmizakakan\"}],\"version\":\"p\",\"lastUpdated\":\"2021-01-24T05:25:27Z\",\"packageApplications\":[{\"appId\":\"joylh\",\"description\":\"muoyxprimr\",\"appUserModelID\":\"pteecjme\",\"friendlyName\":\"ls\",\"iconImageName\":\"asylwx\"}],\"certificateName\":\"mweoohgu\",\"certificateExpiry\":\"2021-11-18T13:48:43Z\"},\"id\":\"boyjathwt\",\"name\":\"olbaemwmdx\",\"type\":\"ebwjscjpahlxvea\"}") - .toObject(ExpandMsixImageInner.class); - Assertions.assertEquals("sdf", model.packageAlias()); - Assertions.assertEquals("bg", model.imagePath()); - Assertions.assertEquals("kylkdghrj", model.packageName()); - Assertions.assertEquals("utlwxezwzhok", model.packageFamilyName()); - Assertions.assertEquals("wnhhtqlgehgppip", model.packageFullName()); - Assertions.assertEquals("hpfeoajvgcxtxjc", model.displayName()); - Assertions.assertEquals("eafidltugsresm", model.packageRelativePath()); - Assertions.assertEquals(true, model.isRegularRegistration()); - Assertions.assertEquals(false, model.isActive()); - Assertions.assertEquals("txfkfweg", model.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("hpt", model.packageDependencies().get(0).publisher()); - Assertions.assertEquals("lucbiqtgdqohm", model.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("p", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-24T05:25:27Z"), model.lastUpdated()); - Assertions.assertEquals("joylh", model.packageApplications().get(0).appId()); - Assertions.assertEquals("muoyxprimr", model.packageApplications().get(0).description()); - Assertions.assertEquals("pteecjme", model.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("ls", model.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("asylwx", model.packageApplications().get(0).iconImageName()); - Assertions.assertEquals("mweoohgu", model.certificateName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-18T13:48:43Z"), model.certificateExpiry()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExpandMsixImageInner model = new ExpandMsixImageInner().withPackageAlias("sdf") - .withImagePath("bg") - .withPackageName("kylkdghrj") - .withPackageFamilyName("utlwxezwzhok") - .withPackageFullName("wnhhtqlgehgppip") - .withDisplayName("hpfeoajvgcxtxjc") - .withPackageRelativePath("eafidltugsresm") - .withIsRegularRegistration(true) - .withIsActive(false) - .withPackageDependencies(Arrays.asList( - new MsixPackageDependencies().withDependencyName("txfkfweg") - .withPublisher("hpt") - .withMinVersion("lucbiqtgdqohm"), - new MsixPackageDependencies().withDependencyName("sldrizetpwbral") - .withPublisher("ibph") - .withMinVersion("zmizakakan"))) - .withVersion("p") - .withLastUpdated(OffsetDateTime.parse("2021-01-24T05:25:27Z")) - .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("joylh") - .withDescription("muoyxprimr") - .withAppUserModelId("pteecjme") - .withFriendlyName("ls") - .withIconImageName("asylwx"))) - .withCertificateName("mweoohgu") - .withCertificateExpiry(OffsetDateTime.parse("2021-11-18T13:48:43Z")); - model = BinaryData.fromObject(model).toObject(ExpandMsixImageInner.class); - Assertions.assertEquals("sdf", model.packageAlias()); - Assertions.assertEquals("bg", model.imagePath()); - Assertions.assertEquals("kylkdghrj", model.packageName()); - Assertions.assertEquals("utlwxezwzhok", model.packageFamilyName()); - Assertions.assertEquals("wnhhtqlgehgppip", model.packageFullName()); - Assertions.assertEquals("hpfeoajvgcxtxjc", model.displayName()); - Assertions.assertEquals("eafidltugsresm", model.packageRelativePath()); - Assertions.assertEquals(true, model.isRegularRegistration()); - Assertions.assertEquals(false, model.isActive()); - Assertions.assertEquals("txfkfweg", model.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("hpt", model.packageDependencies().get(0).publisher()); - Assertions.assertEquals("lucbiqtgdqohm", model.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("p", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-24T05:25:27Z"), model.lastUpdated()); - Assertions.assertEquals("joylh", model.packageApplications().get(0).appId()); - Assertions.assertEquals("muoyxprimr", model.packageApplications().get(0).description()); - Assertions.assertEquals("pteecjme", model.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("ls", model.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("asylwx", model.packageApplications().get(0).iconImageName()); - Assertions.assertEquals("mweoohgu", model.certificateName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-18T13:48:43Z"), model.certificateExpiry()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImageListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImageListTests.java deleted file mode 100644 index fd84a168e2d1..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImageListTests.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ExpandMsixImageInner; -import com.azure.resourcemanager.desktopvirtualization.models.ExpandMsixImageList; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ExpandMsixImageListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExpandMsixImageList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"packageAlias\":\"nk\",\"imagePath\":\"jcjbt\",\"packageName\":\"aehvvibrxjjstoq\",\"packageFamilyName\":\"it\",\"packageFullName\":\"xztmo\",\"displayName\":\"klf\",\"packageRelativePath\":\"dgfcwqmp\",\"isRegularRegistration\":true,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"mjyhohujswtwko\",\"publisher\":\"wculkbaw\",\"minVersion\":\"ajnjwltlwtjj\"},{\"dependencyName\":\"ktalhsnvkcdmxz\",\"publisher\":\"oaimlnw\",\"minVersion\":\"aomylwea\"}],\"version\":\"lcsethwwnpj\",\"lastUpdated\":\"2021-12-09T19:28:59Z\",\"packageApplications\":[{\"appId\":\"pchwa\",\"description\":\"bousn\",\"appUserModelID\":\"pgfewetwlyx\",\"friendlyName\":\"cxy\",\"iconImageName\":\"hdjhlimmbcx\"},{\"appId\":\"po\",\"description\":\"vxcjzhqizxfpxtgq\",\"appUserModelID\":\"javftjuhdqa\",\"friendlyName\":\"mtggu\",\"iconImageName\":\"ijr\"},{\"appId\":\"vmmghfcfiwrxgk\",\"description\":\"uvyinzqodfvpgs\",\"appUserModelID\":\"xgsg\",\"friendlyName\":\"fgzdjtxvz\",\"iconImageName\":\"bqvgaqv\"},{\"appId\":\"cqusr\",\"description\":\"etnwsdtutnw\",\"appUserModelID\":\"uycvuzhyrmewip\",\"friendlyName\":\"ekdxuku\",\"iconImageName\":\"sjjxundxgketw\"}],\"certificateName\":\"jhfjmhvvmuvgpm\",\"certificateExpiry\":\"2021-03-07T00:28:37Z\"},\"id\":\"sx\",\"name\":\"mhfbuzjy\",\"type\":\"hsasbhu\"},{\"properties\":{\"packageAlias\":\"ohyuemslynsq\",\"imagePath\":\"pfoobr\",\"packageName\":\"tyms\",\"packageFamilyName\":\"ygqdnfwqzdz\",\"packageFullName\":\"ilaxhn\",\"displayName\":\"qlyvijo\",\"packageRelativePath\":\"iv\",\"isRegularRegistration\":true,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"ixxrtikvcpw\",\"publisher\":\"clrcivtsox\",\"minVersion\":\"kenx\"},{\"dependencyName\":\"yyefrpmpdnqqs\",\"publisher\":\"waoqvmmb\",\"minVersion\":\"qfr\"}],\"version\":\"lkzmegnitgvkxl\",\"lastUpdated\":\"2021-03-25T00:45:30Z\",\"packageApplications\":[{\"appId\":\"eg\",\"description\":\"alzxwhcan\",\"appUserModelID\":\"moy\",\"friendlyName\":\"lwigdivbkbx\",\"iconImageName\":\"mf\"}],\"certificateName\":\"asqvd\",\"certificateExpiry\":\"2021-08-06T04:39:44Z\"},\"id\":\"guxak\",\"name\":\"sqzhzbezkg\",\"type\":\"msidxasicddyvv\"},{\"properties\":{\"packageAlias\":\"gfmo\",\"imagePath\":\"ah\",\"packageName\":\"gat\",\"packageFamilyName\":\"a\",\"packageFullName\":\"hvjhhnakzyb\",\"displayName\":\"jid\",\"packageRelativePath\":\"syxkyxvxevblb\",\"isRegularRegistration\":false,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"geuaulx\",\"publisher\":\"smjbnkppxyn\",\"minVersion\":\"lsvxeizz\"},{\"dependencyName\":\"klnsrmffey\",\"publisher\":\"ckt\",\"minVersion\":\"ymerteeammxq\"},{\"dependencyName\":\"kk\",\"publisher\":\"ddrtkgdojb\",\"minVersion\":\"vavrefdees\"}],\"version\":\"cuijpxt\",\"lastUpdated\":\"2021-07-08T16:57:24Z\",\"packageApplications\":[{\"appId\":\"tujwsawdd\",\"description\":\"babxvitit\",\"appUserModelID\":\"zeexavoxtfgle\",\"friendlyName\":\"m\",\"iconImageName\":\"bwpypqtgsfjacb\"},{\"appId\":\"xudb\",\"description\":\"odhtnsirudhzm\",\"appUserModelID\":\"sckdlp\",\"friendlyName\":\"zrcxfailcfxwmdbo\",\"iconImageName\":\"fgsftufqob\"},{\"appId\":\"acgcckknhx\",\"description\":\"zvytnrzvuljraaer\",\"appUserModelID\":\"okqgukkjq\",\"friendlyName\":\"broyla\",\"iconImageName\":\"ulcdisdosf\"}],\"certificateName\":\"vgjrwhr\",\"certificateExpiry\":\"2021-01-18T03:55:53Z\"},\"id\":\"ytdc\",\"name\":\"xgccknfnw\",\"type\":\"btmvpdvjdhttza\"}],\"nextLink\":\"edxihchrphkmcrj\"}") - .toObject(ExpandMsixImageList.class); - Assertions.assertEquals("nk", model.value().get(0).packageAlias()); - Assertions.assertEquals("jcjbt", model.value().get(0).imagePath()); - Assertions.assertEquals("aehvvibrxjjstoq", model.value().get(0).packageName()); - Assertions.assertEquals("it", model.value().get(0).packageFamilyName()); - Assertions.assertEquals("xztmo", model.value().get(0).packageFullName()); - Assertions.assertEquals("klf", model.value().get(0).displayName()); - Assertions.assertEquals("dgfcwqmp", model.value().get(0).packageRelativePath()); - Assertions.assertEquals(true, model.value().get(0).isRegularRegistration()); - Assertions.assertEquals(false, model.value().get(0).isActive()); - Assertions.assertEquals("mjyhohujswtwko", model.value().get(0).packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("wculkbaw", model.value().get(0).packageDependencies().get(0).publisher()); - Assertions.assertEquals("ajnjwltlwtjj", model.value().get(0).packageDependencies().get(0).minVersion()); - Assertions.assertEquals("lcsethwwnpj", model.value().get(0).version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-09T19:28:59Z"), model.value().get(0).lastUpdated()); - Assertions.assertEquals("pchwa", model.value().get(0).packageApplications().get(0).appId()); - Assertions.assertEquals("bousn", model.value().get(0).packageApplications().get(0).description()); - Assertions.assertEquals("pgfewetwlyx", model.value().get(0).packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("cxy", model.value().get(0).packageApplications().get(0).friendlyName()); - Assertions.assertEquals("hdjhlimmbcx", model.value().get(0).packageApplications().get(0).iconImageName()); - Assertions.assertEquals("jhfjmhvvmuvgpm", model.value().get(0).certificateName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-07T00:28:37Z"), model.value().get(0).certificateExpiry()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExpandMsixImageList model = new ExpandMsixImageList().withValue(Arrays.asList( - new ExpandMsixImageInner().withPackageAlias("nk") - .withImagePath("jcjbt") - .withPackageName("aehvvibrxjjstoq") - .withPackageFamilyName("it") - .withPackageFullName("xztmo") - .withDisplayName("klf") - .withPackageRelativePath("dgfcwqmp") - .withIsRegularRegistration(true) - .withIsActive(false) - .withPackageDependencies(Arrays.asList( - new MsixPackageDependencies().withDependencyName("mjyhohujswtwko") - .withPublisher("wculkbaw") - .withMinVersion("ajnjwltlwtjj"), - new MsixPackageDependencies().withDependencyName("ktalhsnvkcdmxz") - .withPublisher("oaimlnw") - .withMinVersion("aomylwea"))) - .withVersion("lcsethwwnpj") - .withLastUpdated(OffsetDateTime.parse("2021-12-09T19:28:59Z")) - .withPackageApplications(Arrays.asList( - new MsixPackageApplications().withAppId("pchwa") - .withDescription("bousn") - .withAppUserModelId("pgfewetwlyx") - .withFriendlyName("cxy") - .withIconImageName("hdjhlimmbcx"), - new MsixPackageApplications().withAppId("po") - .withDescription("vxcjzhqizxfpxtgq") - .withAppUserModelId("javftjuhdqa") - .withFriendlyName("mtggu") - .withIconImageName("ijr"), - new MsixPackageApplications().withAppId("vmmghfcfiwrxgk") - .withDescription("uvyinzqodfvpgs") - .withAppUserModelId("xgsg") - .withFriendlyName("fgzdjtxvz") - .withIconImageName("bqvgaqv"), - new MsixPackageApplications().withAppId("cqusr") - .withDescription("etnwsdtutnw") - .withAppUserModelId("uycvuzhyrmewip") - .withFriendlyName("ekdxuku") - .withIconImageName("sjjxundxgketw"))) - .withCertificateName("jhfjmhvvmuvgpm") - .withCertificateExpiry(OffsetDateTime.parse("2021-03-07T00:28:37Z")), - new ExpandMsixImageInner().withPackageAlias("ohyuemslynsq") - .withImagePath("pfoobr") - .withPackageName("tyms") - .withPackageFamilyName("ygqdnfwqzdz") - .withPackageFullName("ilaxhn") - .withDisplayName("qlyvijo") - .withPackageRelativePath("iv") - .withIsRegularRegistration(true) - .withIsActive(false) - .withPackageDependencies(Arrays.asList( - new MsixPackageDependencies().withDependencyName("ixxrtikvcpw") - .withPublisher("clrcivtsox") - .withMinVersion("kenx"), - new MsixPackageDependencies().withDependencyName("yyefrpmpdnqqs") - .withPublisher("waoqvmmb") - .withMinVersion("qfr"))) - .withVersion("lkzmegnitgvkxl") - .withLastUpdated(OffsetDateTime.parse("2021-03-25T00:45:30Z")) - .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("eg") - .withDescription("alzxwhcan") - .withAppUserModelId("moy") - .withFriendlyName("lwigdivbkbx") - .withIconImageName("mf"))) - .withCertificateName("asqvd") - .withCertificateExpiry(OffsetDateTime.parse("2021-08-06T04:39:44Z")), - new ExpandMsixImageInner().withPackageAlias("gfmo") - .withImagePath("ah") - .withPackageName("gat") - .withPackageFamilyName("a") - .withPackageFullName("hvjhhnakzyb") - .withDisplayName("jid") - .withPackageRelativePath("syxkyxvxevblb") - .withIsRegularRegistration(false) - .withIsActive(true) - .withPackageDependencies(Arrays.asList( - new MsixPackageDependencies().withDependencyName("geuaulx") - .withPublisher("smjbnkppxyn") - .withMinVersion("lsvxeizz"), - new MsixPackageDependencies().withDependencyName("klnsrmffey") - .withPublisher("ckt") - .withMinVersion("ymerteeammxq"), - new MsixPackageDependencies().withDependencyName("kk") - .withPublisher("ddrtkgdojb") - .withMinVersion("vavrefdees"))) - .withVersion("cuijpxt") - .withLastUpdated(OffsetDateTime.parse("2021-07-08T16:57:24Z")) - .withPackageApplications(Arrays.asList( - new MsixPackageApplications().withAppId("tujwsawdd") - .withDescription("babxvitit") - .withAppUserModelId("zeexavoxtfgle") - .withFriendlyName("m") - .withIconImageName("bwpypqtgsfjacb"), - new MsixPackageApplications().withAppId("xudb") - .withDescription("odhtnsirudhzm") - .withAppUserModelId("sckdlp") - .withFriendlyName("zrcxfailcfxwmdbo") - .withIconImageName("fgsftufqob"), - new MsixPackageApplications().withAppId("acgcckknhx") - .withDescription("zvytnrzvuljraaer") - .withAppUserModelId("okqgukkjq") - .withFriendlyName("broyla") - .withIconImageName("ulcdisdosf"))) - .withCertificateName("vgjrwhr") - .withCertificateExpiry(OffsetDateTime.parse("2021-01-18T03:55:53Z")))); - model = BinaryData.fromObject(model).toObject(ExpandMsixImageList.class); - Assertions.assertEquals("nk", model.value().get(0).packageAlias()); - Assertions.assertEquals("jcjbt", model.value().get(0).imagePath()); - Assertions.assertEquals("aehvvibrxjjstoq", model.value().get(0).packageName()); - Assertions.assertEquals("it", model.value().get(0).packageFamilyName()); - Assertions.assertEquals("xztmo", model.value().get(0).packageFullName()); - Assertions.assertEquals("klf", model.value().get(0).displayName()); - Assertions.assertEquals("dgfcwqmp", model.value().get(0).packageRelativePath()); - Assertions.assertEquals(true, model.value().get(0).isRegularRegistration()); - Assertions.assertEquals(false, model.value().get(0).isActive()); - Assertions.assertEquals("mjyhohujswtwko", model.value().get(0).packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("wculkbaw", model.value().get(0).packageDependencies().get(0).publisher()); - Assertions.assertEquals("ajnjwltlwtjj", model.value().get(0).packageDependencies().get(0).minVersion()); - Assertions.assertEquals("lcsethwwnpj", model.value().get(0).version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-09T19:28:59Z"), model.value().get(0).lastUpdated()); - Assertions.assertEquals("pchwa", model.value().get(0).packageApplications().get(0).appId()); - Assertions.assertEquals("bousn", model.value().get(0).packageApplications().get(0).description()); - Assertions.assertEquals("pgfewetwlyx", model.value().get(0).packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("cxy", model.value().get(0).packageApplications().get(0).friendlyName()); - Assertions.assertEquals("hdjhlimmbcx", model.value().get(0).packageApplications().get(0).iconImageName()); - Assertions.assertEquals("jhfjmhvvmuvgpm", model.value().get(0).certificateName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-07T00:28:37Z"), model.value().get(0).certificateExpiry()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImagePropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImagePropertiesTests.java deleted file mode 100644 index 64c8ff7ea8a7..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImagePropertiesTests.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ExpandMsixImageProperties; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ExpandMsixImagePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExpandMsixImageProperties model = BinaryData.fromString( - "{\"packageAlias\":\"qxnmwmqt\",\"imagePath\":\"xyi\",\"packageName\":\"dt\",\"packageFamilyName\":\"cttadi\",\"packageFullName\":\"eukmr\",\"displayName\":\"eekpndz\",\"packageRelativePath\":\"pmudqmeqwig\",\"isRegularRegistration\":false,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"xebeybpmz\",\"publisher\":\"rtffyaqitmh\",\"minVersion\":\"ioqaqhvs\"},{\"dependencyName\":\"fuqyrxpdlcgqlsi\",\"publisher\":\"jqfrddgamquh\",\"minVersion\":\"srsjuivfc\"},{\"dependencyName\":\"syirnx\",\"publisher\":\"czexrxzbujrtrhqv\",\"minVersion\":\"evkh\"}],\"version\":\"lnzonzlrpiqywn\",\"lastUpdated\":\"2021-10-30T09:16:37Z\",\"packageApplications\":[{\"appId\":\"cof\",\"description\":\"e\",\"appUserModelID\":\"dhgbjkvre\",\"friendlyName\":\"eamurvzmlo\",\"iconImageName\":\"anashc\"},{\"appId\":\"jerbdkelvidizozs\",\"description\":\"ccxjm\",\"appUserModelID\":\"fdgnwncypuuwwlt\",\"friendlyName\":\"qjctzenkeif\",\"iconImageName\":\"hmkdasvfl\"},{\"appId\":\"cu\",\"description\":\"hxgsrboldfor\",\"appUserModelID\":\"wjlvizbfhfov\",\"friendlyName\":\"cqpbtuo\",\"iconImageName\":\"eszabbelawumuas\"}],\"certificateName\":\"rrwoycqucwyhahn\",\"certificateExpiry\":\"2021-06-28T06:34:10Z\"}") - .toObject(ExpandMsixImageProperties.class); - Assertions.assertEquals("qxnmwmqt", model.packageAlias()); - Assertions.assertEquals("xyi", model.imagePath()); - Assertions.assertEquals("dt", model.packageName()); - Assertions.assertEquals("cttadi", model.packageFamilyName()); - Assertions.assertEquals("eukmr", model.packageFullName()); - Assertions.assertEquals("eekpndz", model.displayName()); - Assertions.assertEquals("pmudqmeqwig", model.packageRelativePath()); - Assertions.assertEquals(false, model.isRegularRegistration()); - Assertions.assertEquals(false, model.isActive()); - Assertions.assertEquals("xebeybpmz", model.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("rtffyaqitmh", model.packageDependencies().get(0).publisher()); - Assertions.assertEquals("ioqaqhvs", model.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("lnzonzlrpiqywn", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T09:16:37Z"), model.lastUpdated()); - Assertions.assertEquals("cof", model.packageApplications().get(0).appId()); - Assertions.assertEquals("e", model.packageApplications().get(0).description()); - Assertions.assertEquals("dhgbjkvre", model.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("eamurvzmlo", model.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("anashc", model.packageApplications().get(0).iconImageName()); - Assertions.assertEquals("rrwoycqucwyhahn", model.certificateName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-28T06:34:10Z"), model.certificateExpiry()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExpandMsixImageProperties model = new ExpandMsixImageProperties().withPackageAlias("qxnmwmqt") - .withImagePath("xyi") - .withPackageName("dt") - .withPackageFamilyName("cttadi") - .withPackageFullName("eukmr") - .withDisplayName("eekpndz") - .withPackageRelativePath("pmudqmeqwig") - .withIsRegularRegistration(false) - .withIsActive(false) - .withPackageDependencies(Arrays.asList( - new MsixPackageDependencies().withDependencyName("xebeybpmz") - .withPublisher("rtffyaqitmh") - .withMinVersion("ioqaqhvs"), - new MsixPackageDependencies().withDependencyName("fuqyrxpdlcgqlsi") - .withPublisher("jqfrddgamquh") - .withMinVersion("srsjuivfc"), - new MsixPackageDependencies().withDependencyName("syirnx") - .withPublisher("czexrxzbujrtrhqv") - .withMinVersion("evkh"))) - .withVersion("lnzonzlrpiqywn") - .withLastUpdated(OffsetDateTime.parse("2021-10-30T09:16:37Z")) - .withPackageApplications(Arrays.asList( - new MsixPackageApplications().withAppId("cof") - .withDescription("e") - .withAppUserModelId("dhgbjkvre") - .withFriendlyName("eamurvzmlo") - .withIconImageName("anashc"), - new MsixPackageApplications().withAppId("jerbdkelvidizozs") - .withDescription("ccxjm") - .withAppUserModelId("fdgnwncypuuwwlt") - .withFriendlyName("qjctzenkeif") - .withIconImageName("hmkdasvfl"), - new MsixPackageApplications().withAppId("cu") - .withDescription("hxgsrboldfor") - .withAppUserModelId("wjlvizbfhfov") - .withFriendlyName("cqpbtuo") - .withIconImageName("eszabbelawumuas"))) - .withCertificateName("rrwoycqucwyhahn") - .withCertificateExpiry(OffsetDateTime.parse("2021-06-28T06:34:10Z")); - model = BinaryData.fromObject(model).toObject(ExpandMsixImageProperties.class); - Assertions.assertEquals("qxnmwmqt", model.packageAlias()); - Assertions.assertEquals("xyi", model.imagePath()); - Assertions.assertEquals("dt", model.packageName()); - Assertions.assertEquals("cttadi", model.packageFamilyName()); - Assertions.assertEquals("eukmr", model.packageFullName()); - Assertions.assertEquals("eekpndz", model.displayName()); - Assertions.assertEquals("pmudqmeqwig", model.packageRelativePath()); - Assertions.assertEquals(false, model.isRegularRegistration()); - Assertions.assertEquals(false, model.isActive()); - Assertions.assertEquals("xebeybpmz", model.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("rtffyaqitmh", model.packageDependencies().get(0).publisher()); - Assertions.assertEquals("ioqaqhvs", model.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("lnzonzlrpiqywn", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T09:16:37Z"), model.lastUpdated()); - Assertions.assertEquals("cof", model.packageApplications().get(0).appId()); - Assertions.assertEquals("e", model.packageApplications().get(0).description()); - Assertions.assertEquals("dhgbjkvre", model.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("eamurvzmlo", model.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("anashc", model.packageApplications().get(0).iconImageName()); - Assertions.assertEquals("rrwoycqucwyhahn", model.certificateName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-28T06:34:10Z"), model.certificateExpiry()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsDeleteWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsDeleteWithResponseMockTests.java deleted file mode 100644 index 37def34fbd48..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class HostPoolsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.hostPools().deleteWithResponse("cpoq", "avnwqj", false, com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/IdentityTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/IdentityTests.java deleted file mode 100644 index c1f11594a170..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/IdentityTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.Identity; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class IdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Identity model = BinaryData - .fromString("{\"principalId\":\"swjdkirso\",\"tenantId\":\"qxhcrmn\",\"type\":\"SystemAssigned\"}") - .toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Identity model = new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED); - model = BinaryData.fromObject(model).toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ImportPackageInfoRequestTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ImportPackageInfoRequestTests.java deleted file mode 100644 index e2c3281726c7..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ImportPackageInfoRequestTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageArchitectures; -import com.azure.resourcemanager.desktopvirtualization.models.ImportPackageInfoRequest; -import org.junit.jupiter.api.Assertions; - -public final class ImportPackageInfoRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImportPackageInfoRequest model = BinaryData.fromString("{\"path\":\"zivj\",\"packageArchitecture\":\"x86a64\"}") - .toObject(ImportPackageInfoRequest.class); - Assertions.assertEquals("zivj", model.path()); - Assertions.assertEquals(AppAttachPackageArchitectures.X86A64, model.packageArchitecture()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImportPackageInfoRequest model = new ImportPackageInfoRequest().withPath("zivj") - .withPackageArchitecture(AppAttachPackageArchitectures.X86A64); - model = BinaryData.fromObject(model).toObject(ImportPackageInfoRequest.class); - Assertions.assertEquals("zivj", model.path()); - Assertions.assertEquals(AppAttachPackageArchitectures.X86A64, model.packageArchitecture()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/LogSpecificationTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/LogSpecificationTests.java deleted file mode 100644 index ee52843d8630..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/LogSpecificationTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.LogSpecification; -import org.junit.jupiter.api.Assertions; - -public final class LogSpecificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogSpecification model = BinaryData - .fromString("{\"name\":\"ryhtnapczwlokjy\",\"displayName\":\"kkvnipjox\",\"blobDuration\":\"nchgej\"}") - .toObject(LogSpecification.class); - Assertions.assertEquals("ryhtnapczwlokjy", model.name()); - Assertions.assertEquals("kkvnipjox", model.displayName()); - Assertions.assertEquals("nchgej", model.blobDuration()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogSpecification model = new LogSpecification().withName("ryhtnapczwlokjy") - .withDisplayName("kkvnipjox") - .withBlobDuration("nchgej"); - model = BinaryData.fromObject(model).toObject(LogSpecification.class); - Assertions.assertEquals("ryhtnapczwlokjy", model.name()); - Assertions.assertEquals("kkvnipjox", model.displayName()); - Assertions.assertEquals("nchgej", model.blobDuration()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MaintenanceWindowPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MaintenanceWindowPatchPropertiesTests.java deleted file mode 100644 index a8ab2f5a1c8a..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MaintenanceWindowPatchPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.MaintenanceWindowPatchProperties; -import org.junit.jupiter.api.Assertions; - -public final class MaintenanceWindowPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MaintenanceWindowPatchProperties model - = BinaryData.fromString("{\"hour\":1583288095,\"dayOfWeek\":\"Wednesday\"}") - .toObject(MaintenanceWindowPatchProperties.class); - Assertions.assertEquals(1583288095, model.hour()); - Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.dayOfWeek()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenanceWindowPatchProperties model - = new MaintenanceWindowPatchProperties().withHour(1583288095).withDayOfWeek(DayOfWeek.WEDNESDAY); - model = BinaryData.fromObject(model).toObject(MaintenanceWindowPatchProperties.class); - Assertions.assertEquals(1583288095, model.hour()); - Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.dayOfWeek()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MaintenanceWindowPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MaintenanceWindowPropertiesTests.java deleted file mode 100644 index 212e2423206b..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MaintenanceWindowPropertiesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.MaintenanceWindowProperties; -import org.junit.jupiter.api.Assertions; - -public final class MaintenanceWindowPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MaintenanceWindowProperties model = BinaryData.fromString("{\"hour\":1842679392,\"dayOfWeek\":\"Sunday\"}") - .toObject(MaintenanceWindowProperties.class); - Assertions.assertEquals(1842679392, model.hour()); - Assertions.assertEquals(DayOfWeek.SUNDAY, model.dayOfWeek()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenanceWindowProperties model - = new MaintenanceWindowProperties().withHour(1842679392).withDayOfWeek(DayOfWeek.SUNDAY); - model = BinaryData.fromObject(model).toObject(MaintenanceWindowProperties.class); - Assertions.assertEquals(1842679392, model.hour()); - Assertions.assertEquals(DayOfWeek.SUNDAY, model.dayOfWeek()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImageUriTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImageUriTests.java deleted file mode 100644 index 69ecd509e142..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImageUriTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.MsixImageUri; -import org.junit.jupiter.api.Assertions; - -public final class MsixImageUriTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MsixImageUri model = BinaryData.fromString("{\"uri\":\"hvnh\"}").toObject(MsixImageUri.class); - Assertions.assertEquals("hvnh", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MsixImageUri model = new MsixImageUri().withUri("hvnh"); - model = BinaryData.fromObject(model).toObject(MsixImageUri.class); - Assertions.assertEquals("hvnh", model.uri()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImagesExpandMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImagesExpandMockTests.java deleted file mode 100644 index 80609acf579f..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImagesExpandMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.ExpandMsixImage; -import com.azure.resourcemanager.desktopvirtualization.models.MsixImageUri; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MsixImagesExpandMockTests { - @Test - public void testExpand() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"packageAlias\":\"ndjrkclamggl\",\"imagePath\":\"mfejdoqeykglty\",\"packageName\":\"hqfgqkayejsx\",\"packageFamilyName\":\"gflwfgziiucijj\",\"packageFullName\":\"atlijjjr\",\"displayName\":\"am\",\"packageRelativePath\":\"szknxkvccxe\",\"isRegularRegistration\":false,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"gno\",\"publisher\":\"k\",\"minVersion\":\"qo\"},{\"dependencyName\":\"wpin\",\"publisher\":\"dvabbxbhmedeilb\",\"minVersion\":\"wfcfxzirzz\"},{\"dependencyName\":\"vwypusuvjsl\",\"publisher\":\"wci\",\"minVersion\":\"jsllfryvd\"}],\"version\":\"x\",\"lastUpdated\":\"2021-09-06T06:02:35Z\",\"packageApplications\":[{\"appId\":\"rgnawbabgfbk\",\"description\":\"jmfczlfsyqkf\",\"appUserModelID\":\"zgowox\",\"friendlyName\":\"je\",\"iconImageName\":\"cxn\"},{\"appId\":\"hlusrvxisi\",\"description\":\"ceagbjqvlsumywz\",\"appUserModelID\":\"hxgonoyjf\",\"friendlyName\":\"puby\",\"iconImageName\":\"clkfkee\"},{\"appId\":\"pemtuoqu\",\"description\":\"yegq\",\"appUserModelID\":\"nigflqqbtnyj\",\"friendlyName\":\"lxdbfvabmvms\",\"iconImageName\":\"aevwjcnkot\"},{\"appId\":\"hvajmailfemjjzak\",\"description\":\"jiqul\",\"appUserModelID\":\"xbdmvrscmqernd\",\"friendlyName\":\"nyeofltfnnxrk\",\"iconImageName\":\"jfynnfmuiiirip\"}],\"certificateName\":\"kfkxbbcbrwjiut\",\"certificateExpiry\":\"2021-11-22T08:29:51Z\"},\"id\":\"zbeewoiymrvzbju\",\"name\":\"rsrziuctix\",\"type\":\"bdsuifr\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.msixImages() - .expand("p", "hzzwvywrgyngy", new MsixImageUri().withUri("rpxncaki"), com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ndjrkclamggl", response.iterator().next().packageAlias()); - Assertions.assertEquals("mfejdoqeykglty", response.iterator().next().imagePath()); - Assertions.assertEquals("hqfgqkayejsx", response.iterator().next().packageName()); - Assertions.assertEquals("gflwfgziiucijj", response.iterator().next().packageFamilyName()); - Assertions.assertEquals("atlijjjr", response.iterator().next().packageFullName()); - Assertions.assertEquals("am", response.iterator().next().displayName()); - Assertions.assertEquals("szknxkvccxe", response.iterator().next().packageRelativePath()); - Assertions.assertEquals(false, response.iterator().next().isRegularRegistration()); - Assertions.assertEquals(false, response.iterator().next().isActive()); - Assertions.assertEquals("gno", response.iterator().next().packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("k", response.iterator().next().packageDependencies().get(0).publisher()); - Assertions.assertEquals("qo", response.iterator().next().packageDependencies().get(0).minVersion()); - Assertions.assertEquals("x", response.iterator().next().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-06T06:02:35Z"), response.iterator().next().lastUpdated()); - Assertions.assertEquals("rgnawbabgfbk", response.iterator().next().packageApplications().get(0).appId()); - Assertions.assertEquals("jmfczlfsyqkf", response.iterator().next().packageApplications().get(0).description()); - Assertions.assertEquals("zgowox", response.iterator().next().packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("je", response.iterator().next().packageApplications().get(0).friendlyName()); - Assertions.assertEquals("cxn", response.iterator().next().packageApplications().get(0).iconImageName()); - Assertions.assertEquals("kfkxbbcbrwjiut", response.iterator().next().certificateName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-22T08:29:51Z"), - response.iterator().next().certificateExpiry()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageApplicationsTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageApplicationsTests.java deleted file mode 100644 index 0b0897b86337..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageApplicationsTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; -import org.junit.jupiter.api.Assertions; - -public final class MsixPackageApplicationsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MsixPackageApplications model = BinaryData.fromString( - "{\"appId\":\"ljyxgtczhe\",\"description\":\"bsdshmkxmaehvbbx\",\"appUserModelID\":\"iplt\",\"friendlyName\":\"htba\",\"iconImageName\":\"gx\"}") - .toObject(MsixPackageApplications.class); - Assertions.assertEquals("ljyxgtczhe", model.appId()); - Assertions.assertEquals("bsdshmkxmaehvbbx", model.description()); - Assertions.assertEquals("iplt", model.appUserModelId()); - Assertions.assertEquals("htba", model.friendlyName()); - Assertions.assertEquals("gx", model.iconImageName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MsixPackageApplications model = new MsixPackageApplications().withAppId("ljyxgtczhe") - .withDescription("bsdshmkxmaehvbbx") - .withAppUserModelId("iplt") - .withFriendlyName("htba") - .withIconImageName("gx"); - model = BinaryData.fromObject(model).toObject(MsixPackageApplications.class); - Assertions.assertEquals("ljyxgtczhe", model.appId()); - Assertions.assertEquals("bsdshmkxmaehvbbx", model.description()); - Assertions.assertEquals("iplt", model.appUserModelId()); - Assertions.assertEquals("htba", model.friendlyName()); - Assertions.assertEquals("gx", model.iconImageName()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageDependenciesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageDependenciesTests.java deleted file mode 100644 index feaceff94db0..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageDependenciesTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; -import org.junit.jupiter.api.Assertions; - -public final class MsixPackageDependenciesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MsixPackageDependencies model - = BinaryData.fromString("{\"dependencyName\":\"sx\",\"publisher\":\"jmsvpkjp\",\"minVersion\":\"kwcf\"}") - .toObject(MsixPackageDependencies.class); - Assertions.assertEquals("sx", model.dependencyName()); - Assertions.assertEquals("jmsvpkjp", model.publisher()); - Assertions.assertEquals("kwcf", model.minVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MsixPackageDependencies model - = new MsixPackageDependencies().withDependencyName("sx").withPublisher("jmsvpkjp").withMinVersion("kwcf"); - model = BinaryData.fromObject(model).toObject(MsixPackageDependencies.class); - Assertions.assertEquals("sx", model.dependencyName()); - Assertions.assertEquals("jmsvpkjp", model.publisher()); - Assertions.assertEquals("kwcf", model.minVersion()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageInnerTests.java deleted file mode 100644 index 77f67e0d2dc3..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageInnerTests.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.MsixPackageInner; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MsixPackageInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MsixPackageInner model = BinaryData.fromString( - "{\"properties\":{\"imagePath\":\"cdm\",\"packageName\":\"r\",\"packageFamilyName\":\"lpijnkrxfrd\",\"displayName\":\"c\",\"packageRelativePath\":\"tizzronasxif\",\"isRegularRegistration\":false,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"tw\",\"publisher\":\"gogczhonnxkrlgny\",\"minVersion\":\"ossxk\"},{\"dependencyName\":\"thrrgh\",\"publisher\":\"bdhqxvcxgf\",\"minVersion\":\"dsofbshrns\"},{\"dependencyName\":\"uswdv\",\"publisher\":\"ybycnunvj\",\"minVersion\":\"tkfa\"}],\"version\":\"opqgikyzirtxdyux\",\"lastUpdated\":\"2021-05-05T23:09:26Z\",\"packageApplications\":[{\"appId\":\"sewgioilqukr\",\"description\":\"xtqmieoxor\",\"appUserModelID\":\"ufhyaomtbgh\",\"friendlyName\":\"vgrvkffo\",\"iconImageName\":\"zh\"},{\"appId\":\"bgj\",\"description\":\"xumvfcluyovw\",\"appUserModelID\":\"bkfezzxscyhwzdgi\",\"friendlyName\":\"jbzbomvzzbtdcq\",\"iconImageName\":\"niyujv\"}]},\"id\":\"dshf\",\"name\":\"snrbgyefrymsgao\",\"type\":\"fmwncotmrfh\"}") - .toObject(MsixPackageInner.class); - Assertions.assertEquals("cdm", model.imagePath()); - Assertions.assertEquals("r", model.packageName()); - Assertions.assertEquals("lpijnkrxfrd", model.packageFamilyName()); - Assertions.assertEquals("c", model.displayName()); - Assertions.assertEquals("tizzronasxif", model.packageRelativePath()); - Assertions.assertEquals(false, model.isRegularRegistration()); - Assertions.assertEquals(true, model.isActive()); - Assertions.assertEquals("tw", model.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("gogczhonnxkrlgny", model.packageDependencies().get(0).publisher()); - Assertions.assertEquals("ossxk", model.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("opqgikyzirtxdyux", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-05T23:09:26Z"), model.lastUpdated()); - Assertions.assertEquals("sewgioilqukr", model.packageApplications().get(0).appId()); - Assertions.assertEquals("xtqmieoxor", model.packageApplications().get(0).description()); - Assertions.assertEquals("ufhyaomtbgh", model.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("vgrvkffo", model.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("zh", model.packageApplications().get(0).iconImageName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MsixPackageInner model = new MsixPackageInner().withImagePath("cdm") - .withPackageName("r") - .withPackageFamilyName("lpijnkrxfrd") - .withDisplayName("c") - .withPackageRelativePath("tizzronasxif") - .withIsRegularRegistration(false) - .withIsActive(true) - .withPackageDependencies(Arrays.asList( - new MsixPackageDependencies().withDependencyName("tw") - .withPublisher("gogczhonnxkrlgny") - .withMinVersion("ossxk"), - new MsixPackageDependencies().withDependencyName("thrrgh") - .withPublisher("bdhqxvcxgf") - .withMinVersion("dsofbshrns"), - new MsixPackageDependencies().withDependencyName("uswdv") - .withPublisher("ybycnunvj") - .withMinVersion("tkfa"))) - .withVersion("opqgikyzirtxdyux") - .withLastUpdated(OffsetDateTime.parse("2021-05-05T23:09:26Z")) - .withPackageApplications(Arrays.asList( - new MsixPackageApplications().withAppId("sewgioilqukr") - .withDescription("xtqmieoxor") - .withAppUserModelId("ufhyaomtbgh") - .withFriendlyName("vgrvkffo") - .withIconImageName("zh"), - new MsixPackageApplications().withAppId("bgj") - .withDescription("xumvfcluyovw") - .withAppUserModelId("bkfezzxscyhwzdgi") - .withFriendlyName("jbzbomvzzbtdcq") - .withIconImageName("niyujv"))); - model = BinaryData.fromObject(model).toObject(MsixPackageInner.class); - Assertions.assertEquals("cdm", model.imagePath()); - Assertions.assertEquals("r", model.packageName()); - Assertions.assertEquals("lpijnkrxfrd", model.packageFamilyName()); - Assertions.assertEquals("c", model.displayName()); - Assertions.assertEquals("tizzronasxif", model.packageRelativePath()); - Assertions.assertEquals(false, model.isRegularRegistration()); - Assertions.assertEquals(true, model.isActive()); - Assertions.assertEquals("tw", model.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("gogczhonnxkrlgny", model.packageDependencies().get(0).publisher()); - Assertions.assertEquals("ossxk", model.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("opqgikyzirtxdyux", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-05T23:09:26Z"), model.lastUpdated()); - Assertions.assertEquals("sewgioilqukr", model.packageApplications().get(0).appId()); - Assertions.assertEquals("xtqmieoxor", model.packageApplications().get(0).description()); - Assertions.assertEquals("ufhyaomtbgh", model.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("vgrvkffo", model.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("zh", model.packageApplications().get(0).iconImageName()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageListTests.java deleted file mode 100644 index 434de0b85041..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageListTests.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.MsixPackageInner; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageList; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MsixPackageListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MsixPackageList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"imagePath\":\"trqjfsmlmbtx\",\"packageName\":\"gfwsrtaw\",\"packageFamilyName\":\"ezbrhubskh\",\"displayName\":\"ygo\",\"packageRelativePath\":\"kkqfqjbvle\",\"isRegularRegistration\":true,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"tqzfavyv\",\"publisher\":\"qybaryeua\",\"minVersion\":\"kq\"},{\"dependencyName\":\"qgzsles\",\"publisher\":\"bhernntiew\",\"minVersion\":\"cv\"},{\"dependencyName\":\"uwrbehwagoh\",\"publisher\":\"f\",\"minVersion\":\"mrqemvvhmx\"}],\"version\":\"rjfut\",\"lastUpdated\":\"2021-07-23T18:17:28Z\",\"packageApplications\":[{\"appId\":\"vewzcj\",\"description\":\"m\",\"appUserModelID\":\"pmguaadraufac\",\"friendlyName\":\"ahzovajjziuxxp\",\"iconImageName\":\"neekulfg\"}]},\"id\":\"bkwdlenrds\",\"name\":\"tujbazpju\",\"type\":\"hminyflnorwmduv\"},{\"properties\":{\"imagePath\":\"klvxwmyg\",\"packageName\":\"pgpqchiszepnnb\",\"packageFamilyName\":\"rxgibbd\",\"displayName\":\"confozauors\",\"packageRelativePath\":\"okwbqplh\",\"isRegularRegistration\":true,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"lrphwzsoldw\",\"publisher\":\"uqdunvmnnrwrbi\",\"minVersion\":\"ktalywjhhgdnhxms\"},{\"dependencyName\":\"fomiloxgg\",\"publisher\":\"fi\",\"minVersion\":\"dieuzaofj\"}],\"version\":\"vcyy\",\"lastUpdated\":\"2021-10-27T10:23:18Z\",\"packageApplications\":[{\"appId\":\"tcubiipuipwoqonm\",\"description\":\"jeknizshq\",\"appUserModelID\":\"impevf\",\"friendlyName\":\"b\",\"iconImageName\":\"rilbywdx\"},{\"appId\":\"cwrwfs\",\"description\":\"fnynszqujizdvoqy\",\"appUserModelID\":\"byowbblgyavutp\",\"friendlyName\":\"joxoism\",\"iconImageName\":\"sbpimlq\"},{\"appId\":\"kcgxxlxsffgcvi\",\"description\":\"zdwlvwlyoupfgfb\",\"appUserModelID\":\"ubdyhgk\",\"friendlyName\":\"in\",\"iconImageName\":\"owzfttsttkt\"}]},\"id\":\"qactxtgzukxitmmq\",\"name\":\"gqqqxh\",\"type\":\"n\"}],\"nextLink\":\"xcpjuisavokqdzf\"}") - .toObject(MsixPackageList.class); - Assertions.assertEquals("trqjfsmlmbtx", model.value().get(0).imagePath()); - Assertions.assertEquals("gfwsrtaw", model.value().get(0).packageName()); - Assertions.assertEquals("ezbrhubskh", model.value().get(0).packageFamilyName()); - Assertions.assertEquals("ygo", model.value().get(0).displayName()); - Assertions.assertEquals("kkqfqjbvle", model.value().get(0).packageRelativePath()); - Assertions.assertEquals(true, model.value().get(0).isRegularRegistration()); - Assertions.assertEquals(true, model.value().get(0).isActive()); - Assertions.assertEquals("tqzfavyv", model.value().get(0).packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("qybaryeua", model.value().get(0).packageDependencies().get(0).publisher()); - Assertions.assertEquals("kq", model.value().get(0).packageDependencies().get(0).minVersion()); - Assertions.assertEquals("rjfut", model.value().get(0).version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-23T18:17:28Z"), model.value().get(0).lastUpdated()); - Assertions.assertEquals("vewzcj", model.value().get(0).packageApplications().get(0).appId()); - Assertions.assertEquals("m", model.value().get(0).packageApplications().get(0).description()); - Assertions.assertEquals("pmguaadraufac", model.value().get(0).packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("ahzovajjziuxxp", model.value().get(0).packageApplications().get(0).friendlyName()); - Assertions.assertEquals("neekulfg", model.value().get(0).packageApplications().get(0).iconImageName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MsixPackageList model = new MsixPackageList().withValue(Arrays.asList( - new MsixPackageInner().withImagePath("trqjfsmlmbtx") - .withPackageName("gfwsrtaw") - .withPackageFamilyName("ezbrhubskh") - .withDisplayName("ygo") - .withPackageRelativePath("kkqfqjbvle") - .withIsRegularRegistration(true) - .withIsActive(true) - .withPackageDependencies(Arrays.asList( - new MsixPackageDependencies().withDependencyName("tqzfavyv") - .withPublisher("qybaryeua") - .withMinVersion("kq"), - new MsixPackageDependencies().withDependencyName("qgzsles") - .withPublisher("bhernntiew") - .withMinVersion("cv"), - new MsixPackageDependencies().withDependencyName("uwrbehwagoh") - .withPublisher("f") - .withMinVersion("mrqemvvhmx"))) - .withVersion("rjfut") - .withLastUpdated(OffsetDateTime.parse("2021-07-23T18:17:28Z")) - .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("vewzcj") - .withDescription("m") - .withAppUserModelId("pmguaadraufac") - .withFriendlyName("ahzovajjziuxxp") - .withIconImageName("neekulfg"))), - new MsixPackageInner().withImagePath("klvxwmyg") - .withPackageName("pgpqchiszepnnb") - .withPackageFamilyName("rxgibbd") - .withDisplayName("confozauors") - .withPackageRelativePath("okwbqplh") - .withIsRegularRegistration(true) - .withIsActive(false) - .withPackageDependencies(Arrays.asList( - new MsixPackageDependencies().withDependencyName("lrphwzsoldw") - .withPublisher("uqdunvmnnrwrbi") - .withMinVersion("ktalywjhhgdnhxms"), - new MsixPackageDependencies().withDependencyName("fomiloxgg") - .withPublisher("fi") - .withMinVersion("dieuzaofj"))) - .withVersion("vcyy") - .withLastUpdated(OffsetDateTime.parse("2021-10-27T10:23:18Z")) - .withPackageApplications(Arrays.asList( - new MsixPackageApplications().withAppId("tcubiipuipwoqonm") - .withDescription("jeknizshq") - .withAppUserModelId("impevf") - .withFriendlyName("b") - .withIconImageName("rilbywdx"), - new MsixPackageApplications().withAppId("cwrwfs") - .withDescription("fnynszqujizdvoqy") - .withAppUserModelId("byowbblgyavutp") - .withFriendlyName("joxoism") - .withIconImageName("sbpimlq"), - new MsixPackageApplications().withAppId("kcgxxlxsffgcvi") - .withDescription("zdwlvwlyoupfgfb") - .withAppUserModelId("ubdyhgk") - .withFriendlyName("in") - .withIconImageName("owzfttsttkt"))))); - model = BinaryData.fromObject(model).toObject(MsixPackageList.class); - Assertions.assertEquals("trqjfsmlmbtx", model.value().get(0).imagePath()); - Assertions.assertEquals("gfwsrtaw", model.value().get(0).packageName()); - Assertions.assertEquals("ezbrhubskh", model.value().get(0).packageFamilyName()); - Assertions.assertEquals("ygo", model.value().get(0).displayName()); - Assertions.assertEquals("kkqfqjbvle", model.value().get(0).packageRelativePath()); - Assertions.assertEquals(true, model.value().get(0).isRegularRegistration()); - Assertions.assertEquals(true, model.value().get(0).isActive()); - Assertions.assertEquals("tqzfavyv", model.value().get(0).packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("qybaryeua", model.value().get(0).packageDependencies().get(0).publisher()); - Assertions.assertEquals("kq", model.value().get(0).packageDependencies().get(0).minVersion()); - Assertions.assertEquals("rjfut", model.value().get(0).version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-23T18:17:28Z"), model.value().get(0).lastUpdated()); - Assertions.assertEquals("vewzcj", model.value().get(0).packageApplications().get(0).appId()); - Assertions.assertEquals("m", model.value().get(0).packageApplications().get(0).description()); - Assertions.assertEquals("pmguaadraufac", model.value().get(0).packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("ahzovajjziuxxp", model.value().get(0).packageApplications().get(0).friendlyName()); - Assertions.assertEquals("neekulfg", model.value().get(0).packageApplications().get(0).iconImageName()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePatchPropertiesTests.java deleted file mode 100644 index c70bc8e71cb8..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePatchPropertiesTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.MsixPackagePatchProperties; -import org.junit.jupiter.api.Assertions; - -public final class MsixPackagePatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MsixPackagePatchProperties model = BinaryData - .fromString("{\"isActive\":false,\"isRegularRegistration\":true,\"displayName\":\"dqkdlwwqfbu\"}") - .toObject(MsixPackagePatchProperties.class); - Assertions.assertEquals(false, model.isActive()); - Assertions.assertEquals(true, model.isRegularRegistration()); - Assertions.assertEquals("dqkdlwwqfbu", model.displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MsixPackagePatchProperties model = new MsixPackagePatchProperties().withIsActive(false) - .withIsRegularRegistration(true) - .withDisplayName("dqkdlwwqfbu"); - model = BinaryData.fromObject(model).toObject(MsixPackagePatchProperties.class); - Assertions.assertEquals(false, model.isActive()); - Assertions.assertEquals(true, model.isRegularRegistration()); - Assertions.assertEquals("dqkdlwwqfbu", model.displayName()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePatchTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePatchTests.java deleted file mode 100644 index 3a22750d3132..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePatchTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackagePatch; -import org.junit.jupiter.api.Assertions; - -public final class MsixPackagePatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MsixPackagePatch model = BinaryData.fromString( - "{\"properties\":{\"isActive\":true,\"isRegularRegistration\":false,\"displayName\":\"yhpluodpvruudlgz\"},\"id\":\"thost\",\"name\":\"ktst\",\"type\":\"dxeclzedqbcvh\"}") - .toObject(MsixPackagePatch.class); - Assertions.assertEquals(true, model.isActive()); - Assertions.assertEquals(false, model.isRegularRegistration()); - Assertions.assertEquals("yhpluodpvruudlgz", model.displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MsixPackagePatch model = new MsixPackagePatch().withIsActive(true) - .withIsRegularRegistration(false) - .withDisplayName("yhpluodpvruudlgz"); - model = BinaryData.fromObject(model).toObject(MsixPackagePatch.class); - Assertions.assertEquals(true, model.isActive()); - Assertions.assertEquals(false, model.isRegularRegistration()); - Assertions.assertEquals("yhpluodpvruudlgz", model.displayName()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePropertiesTests.java deleted file mode 100644 index 251e62800d9e..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePropertiesTests.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.MsixPackageProperties; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MsixPackagePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MsixPackageProperties model = BinaryData.fromString( - "{\"imagePath\":\"ctymoxoftp\",\"packageName\":\"iwyczuh\",\"packageFamilyName\":\"cpqjlihhyu\",\"displayName\":\"skasdvlmfwdgzxu\",\"packageRelativePath\":\"cvpa\",\"isRegularRegistration\":true,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"xurisjnhnyt\",\"publisher\":\"fq\",\"minVersion\":\"gxmrhublwp\"},{\"dependencyName\":\"sutrgjup\",\"publisher\":\"utpwoqhihejqgw\",\"minVersion\":\"nfqn\"},{\"dependencyName\":\"ypsxjvfoim\",\"publisher\":\"slirciz\",\"minVersion\":\"vydfceacvlhvygdy\"}],\"version\":\"umrtwnawjsl\",\"lastUpdated\":\"2021-11-14T12:50:10Z\",\"packageApplications\":[{\"appId\":\"gcyztsfmznbae\",\"description\":\"hchqnrnrpx\",\"appUserModelID\":\"uwrykqgaifmvikl\",\"friendlyName\":\"dvk\",\"iconImageName\":\"ejd\"},{\"appId\":\"vdsrhnjiv\",\"description\":\"v\",\"appUserModelID\":\"ovqfzge\",\"friendlyName\":\"dftuljltduce\",\"iconImageName\":\"tmczuomejwcwwqi\"}]}") - .toObject(MsixPackageProperties.class); - Assertions.assertEquals("ctymoxoftp", model.imagePath()); - Assertions.assertEquals("iwyczuh", model.packageName()); - Assertions.assertEquals("cpqjlihhyu", model.packageFamilyName()); - Assertions.assertEquals("skasdvlmfwdgzxu", model.displayName()); - Assertions.assertEquals("cvpa", model.packageRelativePath()); - Assertions.assertEquals(true, model.isRegularRegistration()); - Assertions.assertEquals(false, model.isActive()); - Assertions.assertEquals("xurisjnhnyt", model.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("fq", model.packageDependencies().get(0).publisher()); - Assertions.assertEquals("gxmrhublwp", model.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("umrtwnawjsl", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-14T12:50:10Z"), model.lastUpdated()); - Assertions.assertEquals("gcyztsfmznbae", model.packageApplications().get(0).appId()); - Assertions.assertEquals("hchqnrnrpx", model.packageApplications().get(0).description()); - Assertions.assertEquals("uwrykqgaifmvikl", model.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("dvk", model.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("ejd", model.packageApplications().get(0).iconImageName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MsixPackageProperties model = new MsixPackageProperties().withImagePath("ctymoxoftp") - .withPackageName("iwyczuh") - .withPackageFamilyName("cpqjlihhyu") - .withDisplayName("skasdvlmfwdgzxu") - .withPackageRelativePath("cvpa") - .withIsRegularRegistration(true) - .withIsActive(false) - .withPackageDependencies(Arrays.asList( - new MsixPackageDependencies().withDependencyName("xurisjnhnyt") - .withPublisher("fq") - .withMinVersion("gxmrhublwp"), - new MsixPackageDependencies().withDependencyName("sutrgjup") - .withPublisher("utpwoqhihejqgw") - .withMinVersion("nfqn"), - new MsixPackageDependencies().withDependencyName("ypsxjvfoim") - .withPublisher("slirciz") - .withMinVersion("vydfceacvlhvygdy"))) - .withVersion("umrtwnawjsl") - .withLastUpdated(OffsetDateTime.parse("2021-11-14T12:50:10Z")) - .withPackageApplications(Arrays.asList( - new MsixPackageApplications().withAppId("gcyztsfmznbae") - .withDescription("hchqnrnrpx") - .withAppUserModelId("uwrykqgaifmvikl") - .withFriendlyName("dvk") - .withIconImageName("ejd"), - new MsixPackageApplications().withAppId("vdsrhnjiv") - .withDescription("v") - .withAppUserModelId("ovqfzge") - .withFriendlyName("dftuljltduce") - .withIconImageName("tmczuomejwcwwqi"))); - model = BinaryData.fromObject(model).toObject(MsixPackageProperties.class); - Assertions.assertEquals("ctymoxoftp", model.imagePath()); - Assertions.assertEquals("iwyczuh", model.packageName()); - Assertions.assertEquals("cpqjlihhyu", model.packageFamilyName()); - Assertions.assertEquals("skasdvlmfwdgzxu", model.displayName()); - Assertions.assertEquals("cvpa", model.packageRelativePath()); - Assertions.assertEquals(true, model.isRegularRegistration()); - Assertions.assertEquals(false, model.isActive()); - Assertions.assertEquals("xurisjnhnyt", model.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("fq", model.packageDependencies().get(0).publisher()); - Assertions.assertEquals("gxmrhublwp", model.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("umrtwnawjsl", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-14T12:50:10Z"), model.lastUpdated()); - Assertions.assertEquals("gcyztsfmznbae", model.packageApplications().get(0).appId()); - Assertions.assertEquals("hchqnrnrpx", model.packageApplications().get(0).description()); - Assertions.assertEquals("uwrykqgaifmvikl", model.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("dvk", model.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("ejd", model.packageApplications().get(0).iconImageName()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesCreateOrUpdateWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 17c6b58c8d3b..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackage; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MsixPackagesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"imagePath\":\"iuas\",\"packageName\":\"rowsocnequy\",\"packageFamilyName\":\"jboq\",\"displayName\":\"mtqjkqevadrmm\",\"packageRelativePath\":\"uawvcmjzk\",\"isRegularRegistration\":true,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"s\",\"publisher\":\"s\",\"minVersion\":\"qiqazugamxzkr\"},{\"dependencyName\":\"oiisbamnppcce\",\"publisher\":\"ztdsbeza\",\"minVersion\":\"f\"},{\"dependencyName\":\"zxuizhyhnepkpe\",\"publisher\":\"arxqiubx\",\"minVersion\":\"kecpxdazvdh\"},{\"dependencyName\":\"mmkoszudb\",\"publisher\":\"s\",\"minVersion\":\"rpcaqkiofkbtf\"}],\"version\":\"kl\",\"lastUpdated\":\"2021-05-12T04:44:19Z\",\"packageApplications\":[{\"appId\":\"cbhhez\",\"description\":\"u\",\"appUserModelID\":\"sqxutr\",\"friendlyName\":\"rruyuu\",\"iconImageName\":\"vlm\"},{\"appId\":\"ol\",\"description\":\"x\",\"appUserModelID\":\"nwtpcpahprz\",\"friendlyName\":\"xhmtfhocnxzc\",\"iconImageName\":\"hngxnoqrxtd\"}]},\"id\":\"evhdlmydid\",\"name\":\"hepfwwtjfdoes\",\"type\":\"xhmw\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MsixPackage response = manager.msixPackages() - .define("ijiitns") - .withExistingHostPool("yxey", "uqi") - .withImagePath("lz") - .withPackageName("sygrijwa") - .withPackageFamilyName("fanraybfu") - .withDisplayName("frojsydgr") - .withPackageRelativePath("dkygywezski") - .withIsRegularRegistration(true) - .withIsActive(true) - .withPackageDependencies(Arrays.asList( - new MsixPackageDependencies().withDependencyName("xieqv") - .withPublisher("makli") - .withMinVersion("cahyhx"), - new MsixPackageDependencies().withDependencyName("ybxawoijpodtblx") - .withPublisher("kwjdjodqhy") - .withMinVersion("ncn"), - new MsixPackageDependencies().withDependencyName("mehllizhceu") - .withPublisher("qodkadppyibngql") - .withMinVersion("ywrxw"), - new MsixPackageDependencies().withDependencyName("dtluvvadswzsn") - .withPublisher("emlowuowhl") - .withMinVersion("nwyrmouv"))) - .withVersion("gmokzkltrfowt") - .withLastUpdated(OffsetDateTime.parse("2021-08-26T18:49:19Z")) - .withPackageApplications(Arrays.asList( - new MsixPackageApplications().withAppId("ih") - .withDescription("jdrqcrjidhftu") - .withAppUserModelId("hdxlw") - .withFriendlyName("jbfqzdk") - .withIconImageName("jyixhaf"), - new MsixPackageApplications().withAppId("xmbjroum") - .withDescription("n") - .withAppUserModelId("l") - .withFriendlyName("rhuzgfxonjtpu") - .withIconImageName("l"))) - .create(); - - Assertions.assertEquals("iuas", response.imagePath()); - Assertions.assertEquals("rowsocnequy", response.packageName()); - Assertions.assertEquals("jboq", response.packageFamilyName()); - Assertions.assertEquals("mtqjkqevadrmm", response.displayName()); - Assertions.assertEquals("uawvcmjzk", response.packageRelativePath()); - Assertions.assertEquals(true, response.isRegularRegistration()); - Assertions.assertEquals(true, response.isActive()); - Assertions.assertEquals("s", response.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("s", response.packageDependencies().get(0).publisher()); - Assertions.assertEquals("qiqazugamxzkr", response.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("kl", response.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-12T04:44:19Z"), response.lastUpdated()); - Assertions.assertEquals("cbhhez", response.packageApplications().get(0).appId()); - Assertions.assertEquals("u", response.packageApplications().get(0).description()); - Assertions.assertEquals("sqxutr", response.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("rruyuu", response.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("vlm", response.packageApplications().get(0).iconImageName()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesDeleteWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesDeleteWithResponseMockTests.java deleted file mode 100644 index 02c2f932a4e5..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesDeleteWithResponseMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MsixPackagesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.msixPackages().deleteWithResponse("bpqvybefg", "mx", "okcvtlubses", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesGetWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesGetWithResponseMockTests.java deleted file mode 100644 index 6852d3632b63..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesGetWithResponseMockTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackage; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MsixPackagesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"imagePath\":\"fytoi\",\"packageName\":\"gygvfltgvdiho\",\"packageFamilyName\":\"krxwet\",\"displayName\":\"drcyrucpcun\",\"packageRelativePath\":\"zdqumoe\",\"isRegularRegistration\":true,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"hqhsknd\",\"publisher\":\"lqkaadlknwf\",\"minVersion\":\"nniyopetxi\"},{\"dependencyName\":\"nrlyxnuc\",\"publisher\":\"p\",\"minVersion\":\"lkwq\"},{\"dependencyName\":\"tv\",\"publisher\":\"sdtcjbctvivuzqym\",\"minVersion\":\"owog\"},{\"dependencyName\":\"it\",\"publisher\":\"hzvb\",\"minVersion\":\"cdb\"}],\"version\":\"fzndscxmxeatkd\",\"lastUpdated\":\"2021-06-16T10:55:30Z\",\"packageApplications\":[{\"appId\":\"jyibqbna\",\"description\":\"hjrmkuhmaxl\",\"appUserModelID\":\"lfihcj\",\"friendlyName\":\"bc\",\"iconImageName\":\"cd\"},{\"appId\":\"cwg\",\"description\":\"fgvaknokzwj\",\"appUserModelID\":\"r\",\"friendlyName\":\"ixldzyyfy\",\"iconImageName\":\"qsix\"}]},\"id\":\"ujivyqlkjuvsm\",\"name\":\"msl\",\"type\":\"oyovwz\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MsixPackage response = manager.msixPackages() - .getWithResponse("sewxigpxvkqm", "upxvpifd", "aifyzyzeyuubeids", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("fytoi", response.imagePath()); - Assertions.assertEquals("gygvfltgvdiho", response.packageName()); - Assertions.assertEquals("krxwet", response.packageFamilyName()); - Assertions.assertEquals("drcyrucpcun", response.displayName()); - Assertions.assertEquals("zdqumoe", response.packageRelativePath()); - Assertions.assertEquals(true, response.isRegularRegistration()); - Assertions.assertEquals(true, response.isActive()); - Assertions.assertEquals("hqhsknd", response.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("lqkaadlknwf", response.packageDependencies().get(0).publisher()); - Assertions.assertEquals("nniyopetxi", response.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("fzndscxmxeatkd", response.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-16T10:55:30Z"), response.lastUpdated()); - Assertions.assertEquals("jyibqbna", response.packageApplications().get(0).appId()); - Assertions.assertEquals("hjrmkuhmaxl", response.packageApplications().get(0).description()); - Assertions.assertEquals("lfihcj", response.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("bc", response.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("cd", response.packageApplications().get(0).iconImageName()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesListMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesListMockTests.java deleted file mode 100644 index 0b01b7abf232..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesListMockTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackage; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MsixPackagesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"imagePath\":\"kbbm\",\"packageName\":\"aglt\",\"packageFamilyName\":\"oeeonqlnfwm\",\"displayName\":\"mvqdbpbhfckdvez\",\"packageRelativePath\":\"cssbzhddu\",\"isRegularRegistration\":true,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"kalehp\",\"publisher\":\"awugiqjti\",\"minVersion\":\"qgdm\"},{\"dependencyName\":\"i\",\"publisher\":\"teajohiyg\",\"minVersion\":\"n\"},{\"dependencyName\":\"n\",\"publisher\":\"czykmktpvw\",\"minVersion\":\"csehchkhufm\"},{\"dependencyName\":\"umqy\",\"publisher\":\"ydzulodsaeuzan\",\"minVersion\":\"fnhsenwphp\"}],\"version\":\"ngqjclidf\",\"lastUpdated\":\"2021-10-18T07:20:26Z\",\"packageApplications\":[{\"appId\":\"ufwbeqrku\",\"description\":\"htssruqnmdvhazc\",\"appUserModelID\":\"ytiq\",\"friendlyName\":\"bqerzwx\",\"iconImageName\":\"txtd\"}]},\"id\":\"lbpktg\",\"name\":\"styoua\",\"type\":\"bewreswmowegmmut\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.msixPackages() - .list("vcuartrhun", "pirykycndzfqiv", 1105579119, false, 1729042857, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("kbbm", response.iterator().next().imagePath()); - Assertions.assertEquals("aglt", response.iterator().next().packageName()); - Assertions.assertEquals("oeeonqlnfwm", response.iterator().next().packageFamilyName()); - Assertions.assertEquals("mvqdbpbhfckdvez", response.iterator().next().displayName()); - Assertions.assertEquals("cssbzhddu", response.iterator().next().packageRelativePath()); - Assertions.assertEquals(true, response.iterator().next().isRegularRegistration()); - Assertions.assertEquals(true, response.iterator().next().isActive()); - Assertions.assertEquals("kalehp", response.iterator().next().packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("awugiqjti", response.iterator().next().packageDependencies().get(0).publisher()); - Assertions.assertEquals("qgdm", response.iterator().next().packageDependencies().get(0).minVersion()); - Assertions.assertEquals("ngqjclidf", response.iterator().next().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-18T07:20:26Z"), response.iterator().next().lastUpdated()); - Assertions.assertEquals("ufwbeqrku", response.iterator().next().packageApplications().get(0).appId()); - Assertions.assertEquals("htssruqnmdvhazc", - response.iterator().next().packageApplications().get(0).description()); - Assertions.assertEquals("ytiq", response.iterator().next().packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("bqerzwx", response.iterator().next().packageApplications().get(0).friendlyName()); - Assertions.assertEquals("txtd", response.iterator().next().packageApplications().get(0).iconImageName()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationPropertiesTests.java deleted file mode 100644 index 42b9e462a2b2..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationPropertiesTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.LogSpecification; -import com.azure.resourcemanager.desktopvirtualization.models.OperationProperties; -import com.azure.resourcemanager.desktopvirtualization.models.ServiceSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationProperties model = BinaryData.fromString( - "{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"th\",\"displayName\":\"hab\",\"blobDuration\":\"pikxwczbyscnpqxu\"}]}}") - .toObject(OperationProperties.class); - Assertions.assertEquals("th", model.serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("hab", model.serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("pikxwczbyscnpqxu", - model.serviceSpecification().logSpecifications().get(0).blobDuration()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationProperties model = new OperationProperties() - .withServiceSpecification(new ServiceSpecification().withLogSpecifications(Arrays.asList( - new LogSpecification().withName("th").withDisplayName("hab").withBlobDuration("pikxwczbyscnpqxu")))); - model = BinaryData.fromObject(model).toObject(OperationProperties.class); - Assertions.assertEquals("th", model.serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("hab", model.serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("pikxwczbyscnpqxu", - model.serviceSpecification().logSpecifications().get(0).blobDuration()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationsListMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationsListMockTests.java deleted file mode 100644 index 001b6e371fe5..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationsListMockTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceProviderOperation; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -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\":\"bzdixzmq\",\"display\":{\"provider\":\"d\",\"resource\":\"opqhewjptmc\",\"operation\":\"bostzel\",\"description\":\"la\"},\"isDataAction\":true,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"ojlvfhrbbpneqvc\",\"displayName\":\"yyurmochpprprsnm\",\"blobDuration\":\"ayzejnhlbkpbz\"},{\"name\":\"piljhahzvech\",\"displayName\":\"bnwieholew\",\"blobDuration\":\"iuubwefqsf\"}]}}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("bzdixzmq", response.iterator().next().name()); - Assertions.assertEquals("d", response.iterator().next().display().provider()); - Assertions.assertEquals("opqhewjptmc", response.iterator().next().display().resource()); - Assertions.assertEquals("bostzel", response.iterator().next().display().operation()); - Assertions.assertEquals("la", response.iterator().next().display().description()); - Assertions.assertEquals(true, response.iterator().next().isDataAction()); - Assertions.assertEquals("ojlvfhrbbpneqvc", - response.iterator().next().properties().serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("yyurmochpprprsnm", - response.iterator().next().properties().serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("ayzejnhlbkpbz", - response.iterator().next().properties().serviceSpecification().logSpecifications().get(0).blobDuration()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionListResultWithSystemDataTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionListResultWithSystemDataTests.java deleted file mode 100644 index ef5285ea6a91..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionListResultWithSystemDataTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionWithSystemDataInner; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpoint; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionListResultWithSystemData; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionListResultWithSystemDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionListResultWithSystemData model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupIds\":[\"c\",\"j\",\"hvpmoue\",\"hd\"],\"privateEndpoint\":{\"id\":\"bqe\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"qbzvddntwnd\",\"actionsRequired\":\"cbtwnpzaoqvuh\"},\"provisioningState\":\"Deleting\"},\"id\":\"fcyddg\",\"name\":\"mjthjqkwp\",\"type\":\"eicxmqciwqvhkhi\"},{\"properties\":{\"groupIds\":[\"dtopbob\",\"og\",\"m\"],\"privateEndpoint\":{\"id\":\"a\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"rzayv\",\"actionsRequired\":\"pgvdf\"},\"provisioningState\":\"Failed\"},\"id\":\"kftutqxlngxlefg\",\"name\":\"gnxkrxdqmidtth\",\"type\":\"rvqdra\"},{\"properties\":{\"groupIds\":[\"big\"],\"privateEndpoint\":{\"id\":\"qfbow\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"yktz\",\"actionsRequired\":\"u\"},\"provisioningState\":\"Creating\"},\"id\":\"qyw\",\"name\":\"ndrvynhzg\",\"type\":\"phrcgyncoc\"}],\"nextLink\":\"cfvmmco\"}") - .toObject(PrivateEndpointConnectionListResultWithSystemData.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("qbzvddntwnd", model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions.assertEquals("cbtwnpzaoqvuh", - model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionListResultWithSystemData model - = new PrivateEndpointConnectionListResultWithSystemData().withValue(Arrays.asList( - new PrivateEndpointConnectionWithSystemDataInner().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("qbzvddntwnd") - .withActionsRequired("cbtwnpzaoqvuh")), - new PrivateEndpointConnectionWithSystemDataInner().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("rzayv") - .withActionsRequired("pgvdf")), - new PrivateEndpointConnectionWithSystemDataInner().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("yktz") - .withActionsRequired("u")))); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResultWithSystemData.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("qbzvddntwnd", model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions.assertEquals("cbtwnpzaoqvuh", - model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionPropertiesTests.java deleted file mode 100644 index a4bfb68e6494..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionPropertiesTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpoint; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionProperties model = BinaryData.fromString( - "{\"groupIds\":[\"rolfpfp\",\"algbquxigjyjg\"],\"privateEndpoint\":{\"id\":\"o\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"txilnerkujy\",\"actionsRequired\":\"l\"},\"provisioningState\":\"Deleting\"}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("txilnerkujy", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("l", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionProperties model - = new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("txilnerkujy") - .withActionsRequired("l")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("txilnerkujy", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("l", model.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionTests.java deleted file mode 100644 index 2eee6ba260fe..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpoint; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnection model = BinaryData.fromString( - "{\"properties\":{\"groupIds\":[\"xybz\",\"qedqytbciqfoufl\"],\"privateEndpoint\":{\"id\":\"kzsmodm\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"gpbkwtmut\",\"actionsRequired\":\"qktapspwgcuert\"},\"provisioningState\":\"Creating\"},\"id\":\"o\",\"name\":\"vqwhbmdgbbjfd\",\"type\":\"gmbmbexppbh\"}") - .toObject(PrivateEndpointConnection.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("gpbkwtmut", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("qktapspwgcuert", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnection model = new PrivateEndpointConnection().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("gpbkwtmut") - .withActionsRequired("qktapspwgcuert")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnection.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("gpbkwtmut", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("qktapspwgcuert", model.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionWithSystemDataInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionWithSystemDataInnerTests.java deleted file mode 100644 index 4d36dd55ab74..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionWithSystemDataInnerTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionWithSystemDataInner; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpoint; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionWithSystemDataInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionWithSystemDataInner model = BinaryData.fromString( - "{\"properties\":{\"groupIds\":[\"lzevgbmqjqab\",\"y\",\"mivkwlzuvcc\",\"wnfnbacf\"],\"privateEndpoint\":{\"id\":\"l\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"tqgtzxdpnqbqq\",\"actionsRequired\":\"rjfeallnwsubisnj\"},\"provisioningState\":\"Succeeded\"},\"id\":\"ngnzscxaqwoochc\",\"name\":\"onq\",\"type\":\"pkvlrxn\"}") - .toObject(PrivateEndpointConnectionWithSystemDataInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("tqgtzxdpnqbqq", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("rjfeallnwsubisnj", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionWithSystemDataInner model - = new PrivateEndpointConnectionWithSystemDataInner().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("tqgtzxdpnqbqq") - .withActionsRequired("rjfeallnwsubisnj")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionWithSystemDataInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("tqgtzxdpnqbqq", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("rjfeallnwsubisnj", model.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByHostPoolWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByHostPoolWithResponseMockTests.java deleted file mode 100644 index f879829e8d2c..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByHostPoolWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsDeleteByHostPoolWithResponseMockTests { - @Test - public void testDeleteByHostPoolWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.privateEndpointConnections() - .deleteByHostPoolWithResponse("rd", "jxtxrdc", "tjvidt", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByWorkspaceWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByWorkspaceWithResponseMockTests.java deleted file mode 100644 index f0d75299c480..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByWorkspaceWithResponseMockTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsDeleteByWorkspaceWithResponseMockTests { - @Test - public void testDeleteByWorkspaceWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.privateEndpointConnections() - .deleteByWorkspaceWithResponse("jfrnxousxauzlwv", "gmwohqfzizvu", "mmkjsvthnwpztek", - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByHostPoolWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByHostPoolWithResponseMockTests.java deleted file mode 100644 index b19423c68649..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByHostPoolWithResponseMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsGetByHostPoolWithResponseMockTests { - @Test - public void testGetByHostPoolWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"groupIds\":[\"dnpdwrpqaf\",\"fugsnnfhyetefy\",\"oc\",\"ctfjgtixr\"],\"privateEndpoint\":{\"id\":\"uyturml\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"olbauirop\",\"actionsRequired\":\"nszonwpngaj\"},\"provisioningState\":\"Failed\"},\"id\":\"xjawrt\",\"name\":\"jfjmyccxlzh\",\"type\":\"oxovnekhenlusf\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnectionWithSystemData response = manager.privateEndpointConnections() - .getByHostPoolWithResponse("obkauxofsh", "phwpnulaiywzej", "whslwkoj", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("olbauirop", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("nszonwpngaj", response.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByWorkspaceWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByWorkspaceWithResponseMockTests.java deleted file mode 100644 index 5fbabe2c92c4..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByWorkspaceWithResponseMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsGetByWorkspaceWithResponseMockTests { - @Test - public void testGetByWorkspaceWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"groupIds\":[\"porqzdfu\",\"dzvkfvxcnqmxq\",\"swokm\"],\"privateEndpoint\":{\"id\":\"lgg\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"mzqkz\",\"actionsRequired\":\"uwiwtglxxhljfpg\"},\"provisioningState\":\"Failed\"},\"id\":\"mnzhrgmqg\",\"name\":\"sxvpqcbfrmbodths\",\"type\":\"qgvriibakcla\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnectionWithSystemData response = manager.privateEndpointConnections() - .getByWorkspaceWithResponse("idibgqjxgpn", "hgovfgp", "kqmhhaowjr", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, - response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("mzqkz", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("uwiwtglxxhljfpg", response.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByHostPoolMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByHostPoolMockTests.java deleted file mode 100644 index ec5fb43f2dab..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByHostPoolMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsListByHostPoolMockTests { - @Test - public void testListByHostPool() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"groupIds\":[\"fifhxwrsnew\",\"ozqvbubqmam\"],\"privateEndpoint\":{\"id\":\"cx\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"azttaboidvmfq\",\"actionsRequired\":\"pubowsepdfg\"},\"provisioningState\":\"Failed\"},\"id\":\"herngb\",\"name\":\"c\",\"type\":\"uahokq\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.privateEndpointConnections() - .listByHostPool("yefchnm", "ahmnxhkxjqirw", 1600818034, true, 1057526816, com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, - response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("azttaboidvmfq", - response.iterator().next().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("pubowsepdfg", - response.iterator().next().privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByWorkspaceMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByWorkspaceMockTests.java deleted file mode 100644 index 12963cd716e2..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByWorkspaceMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsListByWorkspaceMockTests { - @Test - public void testListByWorkspace() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"groupIds\":[\"yospspshc\"],\"privateEndpoint\":{\"id\":\"yjpmspbpssdfppyo\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"yujtvczkcnyx\",\"actionsRequired\":\"munjdxvglnkvx\"},\"provisioningState\":\"Deleting\"},\"id\":\"glqivbgkcv\",\"name\":\"hpzvuqdflvoniyp\",\"type\":\"pubcpzgpxtivhjk\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.privateEndpointConnections() - .listByWorkspace("tmaaj", "uhuxylrjvmtyg", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, - response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("yujtvczkcnyx", - response.iterator().next().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("munjdxvglnkvx", - response.iterator().next().privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByHostPoolWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByHostPoolWithResponseMockTests.java deleted file mode 100644 index 563c02798971..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByHostPoolWithResponseMockTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpoint; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsUpdateByHostPoolWithResponseMockTests { - @Test - public void testUpdateByHostPoolWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"groupIds\":[\"bctqhamzjrwd\",\"qzeqyjleziunjxdf\"],\"privateEndpoint\":{\"id\":\"tkw\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"amlbnseqacjjvpil\",\"actionsRequired\":\"ooqjagmditgueio\"},\"provisioningState\":\"Deleting\"},\"id\":\"sahrtdtpdel\",\"name\":\"ac\",\"type\":\"lmotoebnfxofvcj\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnectionWithSystemData response = manager.privateEndpointConnections() - .updateByHostPoolWithResponse("gepuslvyjtc", "uwkasiz", "esfuught", - new PrivateEndpointConnection().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("wpusxjbaqehg") - .withActionsRequired("ohzjqatucoigeb")), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("amlbnseqacjjvpil", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("ooqjagmditgueio", response.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByWorkspaceWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByWorkspaceWithResponseMockTests.java deleted file mode 100644 index 66d1ac02f362..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByWorkspaceWithResponseMockTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpoint; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsUpdateByWorkspaceWithResponseMockTests { - @Test - public void testUpdateByWorkspaceWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"groupIds\":[\"kmqp\"],\"privateEndpoint\":{\"id\":\"hlfbcgwgc\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"ebqinjipnw\",\"actionsRequired\":\"ujqlafcbahh\"},\"provisioningState\":\"Creating\"},\"id\":\"foiyjwpfilk\",\"name\":\"kkholvdndvia\",\"type\":\"ogphuartvtiu\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnectionWithSystemData response = manager.privateEndpointConnections() - .updateByWorkspaceWithResponse("vmribiat", "gplucfotangcfhny", "zcugswvxwlmzqw", - new PrivateEndpointConnection().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("n") - .withActionsRequired("oxgjiuqhibt")), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ebqinjipnw", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("ujqlafcbahh", response.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointTests.java deleted file mode 100644 index f44d340657d3..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpoint; - -public final class PrivateEndpointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"fqawrlyxw\"}").toObject(PrivateEndpoint.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpoint model = new PrivateEndpoint(); - model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourceInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourceInnerTests.java deleted file mode 100644 index a8541d2bb058..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourceInnerTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateLinkResourceInner; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceInner model = BinaryData.fromString( - "{\"properties\":{\"groupId\":\"ynpwlbj\",\"requiredMembers\":[\"acfta\",\"ehxnltyfsop\",\"usue\"],\"requiredZoneNames\":[\"wd\",\"jbavorxzdm\",\"hctbqvudwxdn\"]},\"id\":\"vo\",\"name\":\"gujjugwdkcglh\",\"type\":\"lazjdyggdtjixhbk\"}") - .toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("wd", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceInner model - = new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList("wd", "jbavorxzdm", "hctbqvudwxdn")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("wd", model.requiredZoneNames().get(0)); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourceListResultTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourceListResultTests.java deleted file mode 100644 index fdec7536bad6..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourceListResultTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResourceListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"ipheoflokeyyien\",\"requiredMembers\":[\"lwtgrhpdj\",\"jumasx\",\"zj\"],\"requiredZoneNames\":[\"e\"]},\"id\":\"alhbx\",\"name\":\"hejjz\",\"type\":\"v\"}],\"nextLink\":\"dgwdslfhot\"}") - .toObject(PrivateLinkResourceListResult.class); - Assertions.assertEquals("e", model.value().get(0).requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceListResult model = new PrivateLinkResourceListResult() - .withValue(Arrays.asList(new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList("e")))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResult.class); - Assertions.assertEquals("e", model.value().get(0).requiredZoneNames().get(0)); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcePropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcePropertiesTests.java deleted file mode 100644 index ac6b562a8b52..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcePropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceProperties model = BinaryData.fromString( - "{\"groupId\":\"fqweykhmene\",\"requiredMembers\":[\"exfwhy\",\"cibvyvdcsitynn\"],\"requiredZoneNames\":[\"dectehfiqsc\",\"eypvhezrkg\",\"hcjrefovgmk\",\"sle\"]}") - .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("dectehfiqsc", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceProperties model = new PrivateLinkResourceProperties() - .withRequiredZoneNames(Arrays.asList("dectehfiqsc", "eypvhezrkg", "hcjrefovgmk", "sle")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("dectehfiqsc", model.requiredZoneNames().get(0)); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByHostPoolMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByHostPoolMockTests.java deleted file mode 100644 index d83f1916e859..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByHostPoolMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesListByHostPoolMockTests { - @Test - public void testListByHostPool() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"groupId\":\"wkpqhjpenuygbq\",\"requiredMembers\":[\"ekewvnqvcdlguauc\",\"f\",\"jwnlax\"],\"requiredZoneNames\":[\"jqi\",\"czvvit\"]},\"id\":\"gx\",\"name\":\"fcsserxhtvsox\",\"type\":\"lwntsjgqrs\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.privateLinkResources() - .listByHostPool("ji", "xfz", 9701584, false, 2008272584, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jqi", response.iterator().next().requiredZoneNames().get(0)); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByWorkspaceMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByWorkspaceMockTests.java deleted file mode 100644 index cef455daf9f8..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByWorkspaceMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesListByWorkspaceMockTests { - @Test - public void testListByWorkspace() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"groupId\":\"tmvcop\",\"requiredMembers\":[\"m\"],\"requiredZoneNames\":[\"buhhlkyqlt\",\"srogtu\"]},\"id\":\"ffdjktsysidfvclg\",\"name\":\"xnfuijtkbusqogs\",\"type\":\"ikayiansharuj\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.privateLinkResources() - .listByWorkspace("gdirazf", "xejw", 1368771016, true, 492529805, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("buhhlkyqlt", response.iterator().next().requiredZoneNames().get(0)); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkServiceConnectionStateTests.java deleted file mode 100644 index c92ebf73e3d6..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkServiceConnectionStateTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkServiceConnectionStateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkServiceConnectionState model = BinaryData - .fromString("{\"status\":\"Rejected\",\"description\":\"rbnwbxgjvtbvpy\",\"actionsRequired\":\"zdn\"}") - .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.status()); - Assertions.assertEquals("rbnwbxgjvtbvpy", model.description()); - Assertions.assertEquals("zdn", model.actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkServiceConnectionState model - = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("rbnwbxgjvtbvpy") - .withActionsRequired("zdn"); - model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.status()); - Assertions.assertEquals("rbnwbxgjvtbvpy", model.description()); - Assertions.assertEquals("zdn", model.actionsRequired()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceModelWithAllowedPropertySetIdentityTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceModelWithAllowedPropertySetIdentityTests.java deleted file mode 100644 index 91cf7f1f7edd..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceModelWithAllowedPropertySetIdentityTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceIdentityType; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity; -import org.junit.jupiter.api.Assertions; - -public final class ResourceModelWithAllowedPropertySetIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceModelWithAllowedPropertySetIdentity model - = BinaryData.fromString("{\"principalId\":\"pyqr\",\"tenantId\":\"z\",\"type\":\"SystemAssigned\"}") - .toObject(ResourceModelWithAllowedPropertySetIdentity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceModelWithAllowedPropertySetIdentity model - = new ResourceModelWithAllowedPropertySetIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED); - model = BinaryData.fromObject(model).toObject(ResourceModelWithAllowedPropertySetIdentity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceModelWithAllowedPropertySetSkuTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceModelWithAllowedPropertySetSkuTests.java deleted file mode 100644 index 3dd3db4175d8..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceModelWithAllowedPropertySetSkuTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku; -import com.azure.resourcemanager.desktopvirtualization.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class ResourceModelWithAllowedPropertySetSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceModelWithAllowedPropertySetSku model = BinaryData.fromString( - "{\"name\":\"t\",\"tier\":\"Standard\",\"size\":\"dsoifiyipj\",\"family\":\"qwpgrjbzn\",\"capacity\":969861111}") - .toObject(ResourceModelWithAllowedPropertySetSku.class); - Assertions.assertEquals("t", model.name()); - Assertions.assertEquals(SkuTier.STANDARD, model.tier()); - Assertions.assertEquals("dsoifiyipj", model.size()); - Assertions.assertEquals("qwpgrjbzn", model.family()); - Assertions.assertEquals(969861111, model.capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceModelWithAllowedPropertySetSku model = new ResourceModelWithAllowedPropertySetSku().withName("t") - .withTier(SkuTier.STANDARD) - .withSize("dsoifiyipj") - .withFamily("qwpgrjbzn") - .withCapacity(969861111); - model = BinaryData.fromObject(model).toObject(ResourceModelWithAllowedPropertySetSku.class); - Assertions.assertEquals("t", model.name()); - Assertions.assertEquals(SkuTier.STANDARD, model.tier()); - Assertions.assertEquals("dsoifiyipj", model.size()); - Assertions.assertEquals("qwpgrjbzn", model.family()); - Assertions.assertEquals(969861111, model.capacity()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationDisplayTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationDisplayTests.java deleted file mode 100644 index 38235be40fa0..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationDisplayTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceProviderOperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class ResourceProviderOperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceProviderOperationDisplay model = BinaryData.fromString( - "{\"provider\":\"ryrtihfxtijbpzv\",\"resource\":\"wzsymglzufcy\",\"operation\":\"ohdbihanufh\",\"description\":\"bj\"}") - .toObject(ResourceProviderOperationDisplay.class); - Assertions.assertEquals("ryrtihfxtijbpzv", model.provider()); - Assertions.assertEquals("wzsymglzufcy", model.resource()); - Assertions.assertEquals("ohdbihanufh", model.operation()); - Assertions.assertEquals("bj", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceProviderOperationDisplay model = new ResourceProviderOperationDisplay().withProvider("ryrtihfxtijbpzv") - .withResource("wzsymglzufcy") - .withOperation("ohdbihanufh") - .withDescription("bj"); - model = BinaryData.fromObject(model).toObject(ResourceProviderOperationDisplay.class); - Assertions.assertEquals("ryrtihfxtijbpzv", model.provider()); - Assertions.assertEquals("wzsymglzufcy", model.resource()); - Assertions.assertEquals("ohdbihanufh", model.operation()); - Assertions.assertEquals("bj", model.description()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationInnerTests.java deleted file mode 100644 index ae983468e237..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationInnerTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ResourceProviderOperationInner; -import com.azure.resourcemanager.desktopvirtualization.models.LogSpecification; -import com.azure.resourcemanager.desktopvirtualization.models.OperationProperties; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceProviderOperationDisplay; -import com.azure.resourcemanager.desktopvirtualization.models.ServiceSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ResourceProviderOperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceProviderOperationInner model = BinaryData.fromString( - "{\"name\":\"jddeqsrdeupewnw\",\"display\":{\"provider\":\"tjzyflus\",\"resource\":\"hmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"isDataAction\":false,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"mparcryuanzw\",\"displayName\":\"zdxtayrlhmwhf\",\"blobDuration\":\"rqobmtuk\"}]}}}") - .toObject(ResourceProviderOperationInner.class); - Assertions.assertEquals("jddeqsrdeupewnw", model.name()); - Assertions.assertEquals("tjzyflus", model.display().provider()); - Assertions.assertEquals("hmofc", model.display().resource()); - Assertions.assertEquals("smy", model.display().operation()); - Assertions.assertEquals("kdtmlxhekuk", model.display().description()); - Assertions.assertEquals(false, model.isDataAction()); - Assertions.assertEquals("mparcryuanzw", - model.properties().serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("zdxtayrlhmwhf", - model.properties().serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("rqobmtuk", - model.properties().serviceSpecification().logSpecifications().get(0).blobDuration()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceProviderOperationInner model = new ResourceProviderOperationInner().withName("jddeqsrdeupewnw") - .withDisplay(new ResourceProviderOperationDisplay().withProvider("tjzyflus") - .withResource("hmofc") - .withOperation("smy") - .withDescription("kdtmlxhekuk")) - .withIsDataAction(false) - .withProperties(new OperationProperties().withServiceSpecification(new ServiceSpecification() - .withLogSpecifications(Arrays.asList(new LogSpecification().withName("mparcryuanzw") - .withDisplayName("zdxtayrlhmwhf") - .withBlobDuration("rqobmtuk"))))); - model = BinaryData.fromObject(model).toObject(ResourceProviderOperationInner.class); - Assertions.assertEquals("jddeqsrdeupewnw", model.name()); - Assertions.assertEquals("tjzyflus", model.display().provider()); - Assertions.assertEquals("hmofc", model.display().resource()); - Assertions.assertEquals("smy", model.display().operation()); - Assertions.assertEquals("kdtmlxhekuk", model.display().description()); - Assertions.assertEquals(false, model.isDataAction()); - Assertions.assertEquals("mparcryuanzw", - model.properties().serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("zdxtayrlhmwhf", - model.properties().serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("rqobmtuk", - model.properties().serviceSpecification().logSpecifications().get(0).blobDuration()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationListTests.java deleted file mode 100644 index 41e67e7cfbb1..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationListTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ResourceProviderOperationInner; -import com.azure.resourcemanager.desktopvirtualization.models.LogSpecification; -import com.azure.resourcemanager.desktopvirtualization.models.OperationProperties; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceProviderOperationDisplay; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceProviderOperationList; -import com.azure.resourcemanager.desktopvirtualization.models.ServiceSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ResourceProviderOperationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceProviderOperationList model = BinaryData.fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"display\":{\"provider\":\"zopbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"isDataAction\":false,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{}]}}},{\"name\":\"hwlrx\",\"display\":{\"provider\":\"soqijg\",\"resource\":\"mbpazlobcufpdzn\",\"operation\":\"t\",\"description\":\"qjnqglhqgnufoooj\"},\"isDataAction\":true,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{}]}}},{\"name\":\"aagdfmg\",\"display\":{\"provider\":\"hjxri\",\"resource\":\"wmrvktsizntocipa\",\"operation\":\"ajpsquc\",\"description\":\"o\"},\"isDataAction\":false,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{},{},{}]}}}],\"nextLink\":\"nygj\"}") - .toObject(ResourceProviderOperationList.class); - Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); - Assertions.assertEquals("zopbsphrupidgs", model.value().get(0).display().provider()); - Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().resource()); - Assertions.assertEquals("hdxbmtqio", model.value().get(0).display().operation()); - Assertions.assertEquals("zehtbmu", model.value().get(0).display().description()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceProviderOperationList model = new ResourceProviderOperationList().withValue(Arrays.asList( - new ResourceProviderOperationInner().withName("quvgjxpybczme") - .withDisplay(new ResourceProviderOperationDisplay().withProvider("zopbsphrupidgs") - .withResource("bejhphoycmsxa") - .withOperation("hdxbmtqio") - .withDescription("zehtbmu")) - .withIsDataAction(false) - .withProperties(new OperationProperties().withServiceSpecification(new ServiceSpecification() - .withLogSpecifications(Arrays.asList(new LogSpecification(), new LogSpecification())))), - new ResourceProviderOperationInner().withName("hwlrx") - .withDisplay(new ResourceProviderOperationDisplay().withProvider("soqijg") - .withResource("mbpazlobcufpdzn") - .withOperation("t") - .withDescription("qjnqglhqgnufoooj")) - .withIsDataAction(true) - .withProperties(new OperationProperties().withServiceSpecification(new ServiceSpecification() - .withLogSpecifications(Arrays.asList(new LogSpecification(), new LogSpecification())))), - new ResourceProviderOperationInner().withName("aagdfmg") - .withDisplay(new ResourceProviderOperationDisplay().withProvider("hjxri") - .withResource("wmrvktsizntocipa") - .withOperation("ajpsquc") - .withDescription("o")) - .withIsDataAction(false) - .withProperties(new OperationProperties().withServiceSpecification( - new ServiceSpecification().withLogSpecifications(Arrays.asList(new LogSpecification(), - new LogSpecification(), new LogSpecification(), new LogSpecification())))))); - model = BinaryData.fromObject(model).toObject(ResourceProviderOperationList.class); - Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); - Assertions.assertEquals("zopbsphrupidgs", model.value().get(0).display().provider()); - Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().resource()); - Assertions.assertEquals("hdxbmtqio", model.value().get(0).display().operation()); - Assertions.assertEquals("zehtbmu", model.value().get(0).display().description()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingHostPoolReferenceTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingHostPoolReferenceTests.java deleted file mode 100644 index 7d4bb22d5efd..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingHostPoolReferenceTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolReference; -import org.junit.jupiter.api.Assertions; - -public final class ScalingHostPoolReferenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScalingHostPoolReference model - = BinaryData.fromString("{\"hostPoolArmPath\":\"czfc\",\"scalingPlanEnabled\":true}") - .toObject(ScalingHostPoolReference.class); - Assertions.assertEquals("czfc", model.hostPoolArmPath()); - Assertions.assertEquals(true, model.scalingPlanEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScalingHostPoolReference model - = new ScalingHostPoolReference().withHostPoolArmPath("czfc").withScalingPlanEnabled(true); - model = BinaryData.fromObject(model).toObject(ScalingHostPoolReference.class); - Assertions.assertEquals("czfc", model.hostPoolArmPath()); - Assertions.assertEquals(true, model.scalingPlanEnabled()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPatchPropertiesTests.java deleted file mode 100644 index 4e8691094a43..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPatchPropertiesTests.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPatchProperties; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolReference; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingSchedule; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingScheduleDaysOfWeekItem; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; -import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; -import com.azure.resourcemanager.desktopvirtualization.models.Time; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScalingPlanPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScalingPlanPatchProperties model = BinaryData.fromString( - "{\"description\":\"xpkd\",\"friendlyName\":\"baiuebbaumny\",\"timeZone\":\"ped\",\"exclusionTag\":\"jn\",\"schedules\":[{\"name\":\"hsmtxpsiebtfhvp\",\"daysOfWeek\":[\"Friday\",\"Wednesday\"],\"rampUpStartTime\":{\"hour\":2062643229,\"minute\":915471474},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1631031599,\"rampUpCapacityThresholdPct\":136140206,\"peakStartTime\":{\"hour\":871941711,\"minute\":1056627326},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":400091584,\"minute\":1644974889},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":1677238877,\"rampDownCapacityThresholdPct\":1210562441,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":1152812045,\"rampDownNotificationMessage\":\"lxotogtwrupq\",\"offPeakStartTime\":{\"hour\":767248190,\"minute\":823053391},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},{\"name\":\"ykvceoveil\",\"daysOfWeek\":[\"Wednesday\",\"Tuesday\",\"Friday\",\"Friday\"],\"rampUpStartTime\":{\"hour\":914615331,\"minute\":1045744686},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":197964626,\"rampUpCapacityThresholdPct\":1452176185,\"peakStartTime\":{\"hour\":949474495,\"minute\":95653514},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":657781919,\"minute\":1907592616},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":1501927720,\"rampDownCapacityThresholdPct\":1284749235,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":1979421186,\"rampDownNotificationMessage\":\"mclfplphoxuscr\",\"offPeakStartTime\":{\"hour\":2037546368,\"minute\":2003410398},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},{\"name\":\"sbj\",\"daysOfWeek\":[\"Saturday\"],\"rampUpStartTime\":{\"hour\":2075352957,\"minute\":2003590668},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":1245972135,\"rampUpCapacityThresholdPct\":604467332,\"peakStartTime\":{\"hour\":737814385,\"minute\":1011039859},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":224913714,\"minute\":1039812081},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":640895390,\"rampDownCapacityThresholdPct\":1148622887,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":991595077,\"rampDownNotificationMessage\":\"laocqxtccmg\",\"offPeakStartTime\":{\"hour\":1054992005,\"minute\":435564330},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"}],\"hostPoolReferences\":[{\"hostPoolArmPath\":\"yrxvwfudwpznt\",\"scalingPlanEnabled\":false},{\"hostPoolArmPath\":\"hl\",\"scalingPlanEnabled\":true},{\"hostPoolArmPath\":\"hckfrlhrx\",\"scalingPlanEnabled\":false},{\"hostPoolArmPath\":\"vpycanuzbp\",\"scalingPlanEnabled\":false}]}") - .toObject(ScalingPlanPatchProperties.class); - Assertions.assertEquals("xpkd", model.description()); - Assertions.assertEquals("baiuebbaumny", model.friendlyName()); - Assertions.assertEquals("ped", model.timeZone()); - Assertions.assertEquals("jn", model.exclusionTag()); - Assertions.assertEquals("hsmtxpsiebtfhvp", model.schedules().get(0).name()); - Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.FRIDAY, model.schedules().get(0).daysOfWeek().get(0)); - Assertions.assertEquals(2062643229, model.schedules().get(0).rampUpStartTime().hour()); - Assertions.assertEquals(915471474, model.schedules().get(0).rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.schedules().get(0).rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(1631031599, model.schedules().get(0).rampUpMinimumHostsPct()); - Assertions.assertEquals(136140206, model.schedules().get(0).rampUpCapacityThresholdPct()); - Assertions.assertEquals(871941711, model.schedules().get(0).peakStartTime().hour()); - Assertions.assertEquals(1056627326, model.schedules().get(0).peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).peakLoadBalancingAlgorithm()); - Assertions.assertEquals(400091584, model.schedules().get(0).rampDownStartTime().hour()); - Assertions.assertEquals(1644974889, model.schedules().get(0).rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1677238877, model.schedules().get(0).rampDownMinimumHostsPct()); - Assertions.assertEquals(1210562441, model.schedules().get(0).rampDownCapacityThresholdPct()); - Assertions.assertEquals(false, model.schedules().get(0).rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.schedules().get(0).rampDownStopHostsWhen()); - Assertions.assertEquals(1152812045, model.schedules().get(0).rampDownWaitTimeMinutes()); - Assertions.assertEquals("lxotogtwrupq", model.schedules().get(0).rampDownNotificationMessage()); - Assertions.assertEquals(767248190, model.schedules().get(0).offPeakStartTime().hour()); - Assertions.assertEquals(823053391, model.schedules().get(0).offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).offPeakLoadBalancingAlgorithm()); - Assertions.assertEquals("yrxvwfudwpznt", model.hostPoolReferences().get(0).hostPoolArmPath()); - Assertions.assertEquals(false, model.hostPoolReferences().get(0).scalingPlanEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScalingPlanPatchProperties model - = new ScalingPlanPatchProperties().withDescription("xpkd") - .withFriendlyName("baiuebbaumny") - .withTimeZone("ped") - .withExclusionTag("jn") - .withSchedules(Arrays.asList( - new ScalingSchedule().withName("hsmtxpsiebtfhvp") - .withDaysOfWeek(Arrays.asList(ScalingScheduleDaysOfWeekItem.FRIDAY, - ScalingScheduleDaysOfWeekItem.WEDNESDAY)) - .withRampUpStartTime(new Time().withHour(2062643229).withMinute(915471474)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(1631031599) - .withRampUpCapacityThresholdPct(136140206) - .withPeakStartTime(new Time().withHour(871941711).withMinute(1056627326)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(400091584).withMinute(1644974889)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownMinimumHostsPct(1677238877) - .withRampDownCapacityThresholdPct(1210562441) - .withRampDownForceLogoffUsers(false) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) - .withRampDownWaitTimeMinutes(1152812045) - .withRampDownNotificationMessage("lxotogtwrupq") - .withOffPeakStartTime(new Time().withHour(767248190).withMinute(823053391)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST), - new ScalingSchedule().withName("ykvceoveil") - .withDaysOfWeek(Arrays.asList(ScalingScheduleDaysOfWeekItem.WEDNESDAY, - ScalingScheduleDaysOfWeekItem.TUESDAY, ScalingScheduleDaysOfWeekItem.FRIDAY, - ScalingScheduleDaysOfWeekItem.FRIDAY)) - .withRampUpStartTime(new Time().withHour(914615331).withMinute(1045744686)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(197964626) - .withRampUpCapacityThresholdPct(1452176185) - .withPeakStartTime(new Time().withHour(949474495).withMinute(95653514)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownStartTime(new Time().withHour(657781919).withMinute(1907592616)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownMinimumHostsPct(1501927720) - .withRampDownCapacityThresholdPct(1284749235) - .withRampDownForceLogoffUsers(false) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) - .withRampDownWaitTimeMinutes(1979421186) - .withRampDownNotificationMessage("mclfplphoxuscr") - .withOffPeakStartTime(new Time().withHour(2037546368).withMinute(2003410398)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST), - new ScalingSchedule().withName("sbj") - .withDaysOfWeek(Arrays.asList(ScalingScheduleDaysOfWeekItem.SATURDAY)) - .withRampUpStartTime(new Time().withHour(2075352957).withMinute(2003590668)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampUpMinimumHostsPct(1245972135) - .withRampUpCapacityThresholdPct(604467332) - .withPeakStartTime(new Time().withHour(737814385).withMinute(1011039859)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(224913714).withMinute(1039812081)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(640895390) - .withRampDownCapacityThresholdPct(1148622887) - .withRampDownForceLogoffUsers(false) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) - .withRampDownWaitTimeMinutes(991595077) - .withRampDownNotificationMessage("laocqxtccmg") - .withOffPeakStartTime(new Time().withHour(1054992005).withMinute(435564330)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST))) - .withHostPoolReferences(Arrays.asList( - new ScalingHostPoolReference().withHostPoolArmPath("yrxvwfudwpznt").withScalingPlanEnabled(false), - new ScalingHostPoolReference().withHostPoolArmPath("hl").withScalingPlanEnabled(true), - new ScalingHostPoolReference().withHostPoolArmPath("hckfrlhrx").withScalingPlanEnabled(false), - new ScalingHostPoolReference().withHostPoolArmPath("vpycanuzbp").withScalingPlanEnabled(false))); - model = BinaryData.fromObject(model).toObject(ScalingPlanPatchProperties.class); - Assertions.assertEquals("xpkd", model.description()); - Assertions.assertEquals("baiuebbaumny", model.friendlyName()); - Assertions.assertEquals("ped", model.timeZone()); - Assertions.assertEquals("jn", model.exclusionTag()); - Assertions.assertEquals("hsmtxpsiebtfhvp", model.schedules().get(0).name()); - Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.FRIDAY, model.schedules().get(0).daysOfWeek().get(0)); - Assertions.assertEquals(2062643229, model.schedules().get(0).rampUpStartTime().hour()); - Assertions.assertEquals(915471474, model.schedules().get(0).rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.schedules().get(0).rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(1631031599, model.schedules().get(0).rampUpMinimumHostsPct()); - Assertions.assertEquals(136140206, model.schedules().get(0).rampUpCapacityThresholdPct()); - Assertions.assertEquals(871941711, model.schedules().get(0).peakStartTime().hour()); - Assertions.assertEquals(1056627326, model.schedules().get(0).peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).peakLoadBalancingAlgorithm()); - Assertions.assertEquals(400091584, model.schedules().get(0).rampDownStartTime().hour()); - Assertions.assertEquals(1644974889, model.schedules().get(0).rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1677238877, model.schedules().get(0).rampDownMinimumHostsPct()); - Assertions.assertEquals(1210562441, model.schedules().get(0).rampDownCapacityThresholdPct()); - Assertions.assertEquals(false, model.schedules().get(0).rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.schedules().get(0).rampDownStopHostsWhen()); - Assertions.assertEquals(1152812045, model.schedules().get(0).rampDownWaitTimeMinutes()); - Assertions.assertEquals("lxotogtwrupq", model.schedules().get(0).rampDownNotificationMessage()); - Assertions.assertEquals(767248190, model.schedules().get(0).offPeakStartTime().hour()); - Assertions.assertEquals(823053391, model.schedules().get(0).offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).offPeakLoadBalancingAlgorithm()); - Assertions.assertEquals("yrxvwfudwpznt", model.hostPoolReferences().get(0).hostPoolArmPath()); - Assertions.assertEquals(false, model.hostPoolReferences().get(0).scalingPlanEnabled()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPatchTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPatchTests.java deleted file mode 100644 index db1c27937cb0..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPatchTests.java +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolReference; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPatch; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingSchedule; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingScheduleDaysOfWeekItem; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; -import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; -import com.azure.resourcemanager.desktopvirtualization.models.Time; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ScalingPlanPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScalingPlanPatch model = BinaryData.fromString( - "{\"tags\":{\"lwrq\":\"dbabp\",\"hsucoc\":\"fkts\",\"ckzywbiexzfeyue\":\"nyyazttbtwwrqpue\"},\"properties\":{\"description\":\"bxu\",\"friendlyName\":\"bhqwalmuzyoxa\",\"timeZone\":\"dkzjancuxrh\",\"exclusionTag\":\"bavxbniwdjswzt\",\"schedules\":[{\"name\":\"gnxytxhpzxbz\",\"daysOfWeek\":[\"Tuesday\",\"Saturday\",\"Sunday\"],\"rampUpStartTime\":{\"hour\":687811406,\"minute\":2112719993},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1070511980,\"rampUpCapacityThresholdPct\":767485321,\"peakStartTime\":{\"hour\":683096645,\"minute\":228169976},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":1091212098,\"minute\":1229662931},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":507562638,\"rampDownCapacityThresholdPct\":1271650742,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":338198941,\"rampDownNotificationMessage\":\"osvmk\",\"offPeakStartTime\":{\"hour\":979826416,\"minute\":941863244},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"}],\"hostPoolReferences\":[{\"hostPoolArmPath\":\"plgmgsxnk\",\"scalingPlanEnabled\":false},{\"hostPoolArmPath\":\"es\",\"scalingPlanEnabled\":true},{\"hostPoolArmPath\":\"opwi\",\"scalingPlanEnabled\":false}]}}") - .toObject(ScalingPlanPatch.class); - Assertions.assertEquals("dbabp", model.tags().get("lwrq")); - Assertions.assertEquals("bxu", model.description()); - Assertions.assertEquals("bhqwalmuzyoxa", model.friendlyName()); - Assertions.assertEquals("dkzjancuxrh", model.timeZone()); - Assertions.assertEquals("bavxbniwdjswzt", model.exclusionTag()); - Assertions.assertEquals("gnxytxhpzxbz", model.schedules().get(0).name()); - Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.TUESDAY, model.schedules().get(0).daysOfWeek().get(0)); - Assertions.assertEquals(687811406, model.schedules().get(0).rampUpStartTime().hour()); - Assertions.assertEquals(2112719993, model.schedules().get(0).rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.schedules().get(0).rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(1070511980, model.schedules().get(0).rampUpMinimumHostsPct()); - Assertions.assertEquals(767485321, model.schedules().get(0).rampUpCapacityThresholdPct()); - Assertions.assertEquals(683096645, model.schedules().get(0).peakStartTime().hour()); - Assertions.assertEquals(228169976, model.schedules().get(0).peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).peakLoadBalancingAlgorithm()); - Assertions.assertEquals(1091212098, model.schedules().get(0).rampDownStartTime().hour()); - Assertions.assertEquals(1229662931, model.schedules().get(0).rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.schedules().get(0).rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(507562638, model.schedules().get(0).rampDownMinimumHostsPct()); - Assertions.assertEquals(1271650742, model.schedules().get(0).rampDownCapacityThresholdPct()); - Assertions.assertEquals(false, model.schedules().get(0).rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.schedules().get(0).rampDownStopHostsWhen()); - Assertions.assertEquals(338198941, model.schedules().get(0).rampDownWaitTimeMinutes()); - Assertions.assertEquals("osvmk", model.schedules().get(0).rampDownNotificationMessage()); - Assertions.assertEquals(979826416, model.schedules().get(0).offPeakStartTime().hour()); - Assertions.assertEquals(941863244, model.schedules().get(0).offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.schedules().get(0).offPeakLoadBalancingAlgorithm()); - Assertions.assertEquals("plgmgsxnk", model.hostPoolReferences().get(0).hostPoolArmPath()); - Assertions.assertEquals(false, model.hostPoolReferences().get(0).scalingPlanEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScalingPlanPatch model = new ScalingPlanPatch() - .withTags(mapOf("lwrq", "dbabp", "hsucoc", "fkts", "ckzywbiexzfeyue", "nyyazttbtwwrqpue")) - .withDescription("bxu") - .withFriendlyName("bhqwalmuzyoxa") - .withTimeZone("dkzjancuxrh") - .withExclusionTag("bavxbniwdjswzt") - .withSchedules(Arrays.asList(new ScalingSchedule().withName("gnxytxhpzxbz") - .withDaysOfWeek(Arrays.asList(ScalingScheduleDaysOfWeekItem.TUESDAY, - ScalingScheduleDaysOfWeekItem.SATURDAY, ScalingScheduleDaysOfWeekItem.SUNDAY)) - .withRampUpStartTime(new Time().withHour(687811406).withMinute(2112719993)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(1070511980) - .withRampUpCapacityThresholdPct(767485321) - .withPeakStartTime(new Time().withHour(683096645).withMinute(228169976)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(1091212098).withMinute(1229662931)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(507562638) - .withRampDownCapacityThresholdPct(1271650742) - .withRampDownForceLogoffUsers(false) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) - .withRampDownWaitTimeMinutes(338198941) - .withRampDownNotificationMessage("osvmk") - .withOffPeakStartTime(new Time().withHour(979826416).withMinute(941863244)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST))) - .withHostPoolReferences(Arrays.asList( - new ScalingHostPoolReference().withHostPoolArmPath("plgmgsxnk").withScalingPlanEnabled(false), - new ScalingHostPoolReference().withHostPoolArmPath("es").withScalingPlanEnabled(true), - new ScalingHostPoolReference().withHostPoolArmPath("opwi").withScalingPlanEnabled(false))); - model = BinaryData.fromObject(model).toObject(ScalingPlanPatch.class); - Assertions.assertEquals("dbabp", model.tags().get("lwrq")); - Assertions.assertEquals("bxu", model.description()); - Assertions.assertEquals("bhqwalmuzyoxa", model.friendlyName()); - Assertions.assertEquals("dkzjancuxrh", model.timeZone()); - Assertions.assertEquals("bavxbniwdjswzt", model.exclusionTag()); - Assertions.assertEquals("gnxytxhpzxbz", model.schedules().get(0).name()); - Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.TUESDAY, model.schedules().get(0).daysOfWeek().get(0)); - Assertions.assertEquals(687811406, model.schedules().get(0).rampUpStartTime().hour()); - Assertions.assertEquals(2112719993, model.schedules().get(0).rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.schedules().get(0).rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(1070511980, model.schedules().get(0).rampUpMinimumHostsPct()); - Assertions.assertEquals(767485321, model.schedules().get(0).rampUpCapacityThresholdPct()); - Assertions.assertEquals(683096645, model.schedules().get(0).peakStartTime().hour()); - Assertions.assertEquals(228169976, model.schedules().get(0).peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).peakLoadBalancingAlgorithm()); - Assertions.assertEquals(1091212098, model.schedules().get(0).rampDownStartTime().hour()); - Assertions.assertEquals(1229662931, model.schedules().get(0).rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.schedules().get(0).rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(507562638, model.schedules().get(0).rampDownMinimumHostsPct()); - Assertions.assertEquals(1271650742, model.schedules().get(0).rampDownCapacityThresholdPct()); - Assertions.assertEquals(false, model.schedules().get(0).rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.schedules().get(0).rampDownStopHostsWhen()); - Assertions.assertEquals(338198941, model.schedules().get(0).rampDownWaitTimeMinutes()); - Assertions.assertEquals("osvmk", model.schedules().get(0).rampDownNotificationMessage()); - Assertions.assertEquals(979826416, model.schedules().get(0).offPeakStartTime().hour()); - Assertions.assertEquals(941863244, model.schedules().get(0).offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.schedules().get(0).offPeakLoadBalancingAlgorithm()); - Assertions.assertEquals("plgmgsxnk", model.hostPoolReferences().get(0).hostPoolArmPath()); - Assertions.assertEquals(false, model.hostPoolReferences().get(0).scalingPlanEnabled()); - } - - // 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/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalScheduleInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalScheduleInnerTests.java deleted file mode 100644 index 1a3cc7991d95..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalScheduleInnerTests.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPersonalScheduleInner; -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; -import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; -import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; -import com.azure.resourcemanager.desktopvirtualization.models.Time; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScalingPlanPersonalScheduleInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScalingPlanPersonalScheduleInner model = BinaryData.fromString( - "{\"properties\":{\"daysOfWeek\":[\"Thursday\",\"Wednesday\",\"Wednesday\",\"Friday\"],\"rampUpStartTime\":{\"hour\":392993819,\"minute\":1216343785},\"rampUpAutoStartHosts\":\"All\",\"rampUpStartVMOnConnect\":\"Disable\",\"rampUpActionOnDisconnect\":\"Hibernate\",\"rampUpMinutesToWaitOnDisconnect\":172493216,\"rampUpActionOnLogoff\":\"Hibernate\",\"rampUpMinutesToWaitOnLogoff\":94266347,\"peakStartTime\":{\"hour\":2145299291,\"minute\":1393923794},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"None\",\"peakMinutesToWaitOnDisconnect\":213257698,\"peakActionOnLogoff\":\"None\",\"peakMinutesToWaitOnLogoff\":561759175,\"rampDownStartTime\":{\"hour\":277100703,\"minute\":532379819},\"rampDownStartVMOnConnect\":\"Disable\",\"rampDownActionOnDisconnect\":\"None\",\"rampDownMinutesToWaitOnDisconnect\":2111014163,\"rampDownActionOnLogoff\":\"Hibernate\",\"rampDownMinutesToWaitOnLogoff\":891212878,\"offPeakStartTime\":{\"hour\":157171235,\"minute\":1972509388},\"offPeakStartVMOnConnect\":\"Disable\",\"offPeakActionOnDisconnect\":\"Hibernate\",\"offPeakMinutesToWaitOnDisconnect\":1553831435,\"offPeakActionOnLogoff\":\"Deallocate\",\"offPeakMinutesToWaitOnLogoff\":1235013026},\"id\":\"xilzznf\",\"name\":\"q\",\"type\":\"vwpm\"}") - .toObject(ScalingPlanPersonalScheduleInner.class); - Assertions.assertEquals(DayOfWeek.THURSDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(392993819, model.rampUpStartTime().hour()); - Assertions.assertEquals(1216343785, model.rampUpStartTime().minute()); - Assertions.assertEquals(StartupBehavior.ALL, model.rampUpAutoStartHosts()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.rampUpStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnDisconnect()); - Assertions.assertEquals(172493216, model.rampUpMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnLogoff()); - Assertions.assertEquals(94266347, model.rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(2145299291, model.peakStartTime().hour()); - Assertions.assertEquals(1393923794, model.peakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.peakActionOnDisconnect()); - Assertions.assertEquals(213257698, model.peakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.peakActionOnLogoff()); - Assertions.assertEquals(561759175, model.peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(277100703, model.rampDownStartTime().hour()); - Assertions.assertEquals(532379819, model.rampDownStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampDownActionOnDisconnect()); - Assertions.assertEquals(2111014163, model.rampDownMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampDownActionOnLogoff()); - Assertions.assertEquals(891212878, model.rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(157171235, model.offPeakStartTime().hour()); - Assertions.assertEquals(1972509388, model.offPeakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.offPeakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnDisconnect()); - Assertions.assertEquals(1553831435, model.offPeakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.offPeakActionOnLogoff()); - Assertions.assertEquals(1235013026, model.offPeakMinutesToWaitOnLogoff()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScalingPlanPersonalScheduleInner model = new ScalingPlanPersonalScheduleInner() - .withDaysOfWeek( - Arrays.asList(DayOfWeek.THURSDAY, DayOfWeek.WEDNESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.FRIDAY)) - .withRampUpStartTime(new Time().withHour(392993819).withMinute(1216343785)) - .withRampUpAutoStartHosts(StartupBehavior.ALL) - .withRampUpStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withRampUpActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withRampUpMinutesToWaitOnDisconnect(172493216) - .withRampUpActionOnLogoff(SessionHandlingOperation.HIBERNATE) - .withRampUpMinutesToWaitOnLogoff(94266347) - .withPeakStartTime(new Time().withHour(2145299291).withMinute(1393923794)) - .withPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withPeakMinutesToWaitOnDisconnect(213257698) - .withPeakActionOnLogoff(SessionHandlingOperation.NONE) - .withPeakMinutesToWaitOnLogoff(561759175) - .withRampDownStartTime(new Time().withHour(277100703).withMinute(532379819)) - .withRampDownStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withRampDownActionOnDisconnect(SessionHandlingOperation.NONE) - .withRampDownMinutesToWaitOnDisconnect(2111014163) - .withRampDownActionOnLogoff(SessionHandlingOperation.HIBERNATE) - .withRampDownMinutesToWaitOnLogoff(891212878) - .withOffPeakStartTime(new Time().withHour(157171235).withMinute(1972509388)) - .withOffPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withOffPeakActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withOffPeakMinutesToWaitOnDisconnect(1553831435) - .withOffPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withOffPeakMinutesToWaitOnLogoff(1235013026); - model = BinaryData.fromObject(model).toObject(ScalingPlanPersonalScheduleInner.class); - Assertions.assertEquals(DayOfWeek.THURSDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(392993819, model.rampUpStartTime().hour()); - Assertions.assertEquals(1216343785, model.rampUpStartTime().minute()); - Assertions.assertEquals(StartupBehavior.ALL, model.rampUpAutoStartHosts()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.rampUpStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnDisconnect()); - Assertions.assertEquals(172493216, model.rampUpMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnLogoff()); - Assertions.assertEquals(94266347, model.rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(2145299291, model.peakStartTime().hour()); - Assertions.assertEquals(1393923794, model.peakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.peakActionOnDisconnect()); - Assertions.assertEquals(213257698, model.peakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.peakActionOnLogoff()); - Assertions.assertEquals(561759175, model.peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(277100703, model.rampDownStartTime().hour()); - Assertions.assertEquals(532379819, model.rampDownStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampDownActionOnDisconnect()); - Assertions.assertEquals(2111014163, model.rampDownMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampDownActionOnLogoff()); - Assertions.assertEquals(891212878, model.rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(157171235, model.offPeakStartTime().hour()); - Assertions.assertEquals(1972509388, model.offPeakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.offPeakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnDisconnect()); - Assertions.assertEquals(1553831435, model.offPeakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.offPeakActionOnLogoff()); - Assertions.assertEquals(1235013026, model.offPeakMinutesToWaitOnLogoff()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalScheduleListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalScheduleListTests.java deleted file mode 100644 index 5cc176cd65d4..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalScheduleListTests.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPersonalScheduleInner; -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalScheduleList; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; -import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; -import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; -import com.azure.resourcemanager.desktopvirtualization.models.Time; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScalingPlanPersonalScheduleListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScalingPlanPersonalScheduleList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"daysOfWeek\":[\"Thursday\",\"Wednesday\",\"Sunday\",\"Friday\"],\"rampUpStartTime\":{\"hour\":1596263349,\"minute\":590283036},\"rampUpAutoStartHosts\":\"WithAssignedUser\",\"rampUpStartVMOnConnect\":\"Disable\",\"rampUpActionOnDisconnect\":\"None\",\"rampUpMinutesToWaitOnDisconnect\":874839525,\"rampUpActionOnLogoff\":\"Deallocate\",\"rampUpMinutesToWaitOnLogoff\":122725512,\"peakStartTime\":{\"hour\":487755858,\"minute\":953664851},\"peakStartVMOnConnect\":\"Enable\",\"peakActionOnDisconnect\":\"Hibernate\",\"peakMinutesToWaitOnDisconnect\":286824564,\"peakActionOnLogoff\":\"Deallocate\",\"peakMinutesToWaitOnLogoff\":722282959,\"rampDownStartTime\":{\"hour\":11756294,\"minute\":1832906038},\"rampDownStartVMOnConnect\":\"Enable\",\"rampDownActionOnDisconnect\":\"None\",\"rampDownMinutesToWaitOnDisconnect\":1117825443,\"rampDownActionOnLogoff\":\"Hibernate\",\"rampDownMinutesToWaitOnLogoff\":487324139,\"offPeakStartTime\":{\"hour\":907370686,\"minute\":1133682494},\"offPeakStartVMOnConnect\":\"Disable\",\"offPeakActionOnDisconnect\":\"None\",\"offPeakMinutesToWaitOnDisconnect\":961236109,\"offPeakActionOnLogoff\":\"Hibernate\",\"offPeakMinutesToWaitOnLogoff\":1316965845},\"id\":\"ntnev\",\"name\":\"iwjmygtdssls\",\"type\":\"tmweriofzpyq\"},{\"properties\":{\"daysOfWeek\":[\"Wednesday\",\"Thursday\",\"Saturday\",\"Thursday\"],\"rampUpStartTime\":{\"hour\":334511461,\"minute\":1458027183},\"rampUpAutoStartHosts\":\"WithAssignedUser\",\"rampUpStartVMOnConnect\":\"Disable\",\"rampUpActionOnDisconnect\":\"Hibernate\",\"rampUpMinutesToWaitOnDisconnect\":1422875618,\"rampUpActionOnLogoff\":\"Hibernate\",\"rampUpMinutesToWaitOnLogoff\":1384508080,\"peakStartTime\":{\"hour\":523277944,\"minute\":983156788},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"None\",\"peakMinutesToWaitOnDisconnect\":1923795312,\"peakActionOnLogoff\":\"None\",\"peakMinutesToWaitOnLogoff\":110510635,\"rampDownStartTime\":{\"hour\":1668345088,\"minute\":2133271340},\"rampDownStartVMOnConnect\":\"Disable\",\"rampDownActionOnDisconnect\":\"Hibernate\",\"rampDownMinutesToWaitOnDisconnect\":799059143,\"rampDownActionOnLogoff\":\"Deallocate\",\"rampDownMinutesToWaitOnLogoff\":712173581,\"offPeakStartTime\":{\"hour\":97204853,\"minute\":584568005},\"offPeakStartVMOnConnect\":\"Enable\",\"offPeakActionOnDisconnect\":\"None\",\"offPeakMinutesToWaitOnDisconnect\":696489313,\"offPeakActionOnLogoff\":\"Deallocate\",\"offPeakMinutesToWaitOnLogoff\":1013346228},\"id\":\"ze\",\"name\":\"qkdltfz\",\"type\":\"mhhv\"},{\"properties\":{\"daysOfWeek\":[\"Sunday\"],\"rampUpStartTime\":{\"hour\":1748485864,\"minute\":191107441},\"rampUpAutoStartHosts\":\"None\",\"rampUpStartVMOnConnect\":\"Enable\",\"rampUpActionOnDisconnect\":\"None\",\"rampUpMinutesToWaitOnDisconnect\":1615373904,\"rampUpActionOnLogoff\":\"None\",\"rampUpMinutesToWaitOnLogoff\":1795454962,\"peakStartTime\":{\"hour\":1120938995,\"minute\":2091557827},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"Hibernate\",\"peakMinutesToWaitOnDisconnect\":1836889631,\"peakActionOnLogoff\":\"Hibernate\",\"peakMinutesToWaitOnLogoff\":836308274,\"rampDownStartTime\":{\"hour\":1269136735,\"minute\":90744470},\"rampDownStartVMOnConnect\":\"Disable\",\"rampDownActionOnDisconnect\":\"Hibernate\",\"rampDownMinutesToWaitOnDisconnect\":975056149,\"rampDownActionOnLogoff\":\"Deallocate\",\"rampDownMinutesToWaitOnLogoff\":1090180987,\"offPeakStartTime\":{\"hour\":1185146175,\"minute\":1784018500},\"offPeakStartVMOnConnect\":\"Enable\",\"offPeakActionOnDisconnect\":\"Hibernate\",\"offPeakMinutesToWaitOnDisconnect\":405149242,\"offPeakActionOnLogoff\":\"None\",\"offPeakMinutesToWaitOnLogoff\":1819295736},\"id\":\"yyntwl\",\"name\":\"bqtkoievseotgqr\",\"type\":\"ltmuwlauwzizx\"}],\"nextLink\":\"pgcjefuzmuvp\"}") - .toObject(ScalingPlanPersonalScheduleList.class); - Assertions.assertEquals(DayOfWeek.THURSDAY, model.value().get(0).daysOfWeek().get(0)); - Assertions.assertEquals(1596263349, model.value().get(0).rampUpStartTime().hour()); - Assertions.assertEquals(590283036, model.value().get(0).rampUpStartTime().minute()); - Assertions.assertEquals(StartupBehavior.WITH_ASSIGNED_USER, model.value().get(0).rampUpAutoStartHosts()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.value().get(0).rampUpStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.value().get(0).rampUpActionOnDisconnect()); - Assertions.assertEquals(874839525, model.value().get(0).rampUpMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.value().get(0).rampUpActionOnLogoff()); - Assertions.assertEquals(122725512, model.value().get(0).rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(487755858, model.value().get(0).peakStartTime().hour()); - Assertions.assertEquals(953664851, model.value().get(0).peakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.value().get(0).peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.value().get(0).peakActionOnDisconnect()); - Assertions.assertEquals(286824564, model.value().get(0).peakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.value().get(0).peakActionOnLogoff()); - Assertions.assertEquals(722282959, model.value().get(0).peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(11756294, model.value().get(0).rampDownStartTime().hour()); - Assertions.assertEquals(1832906038, model.value().get(0).rampDownStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.value().get(0).rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.value().get(0).rampDownActionOnDisconnect()); - Assertions.assertEquals(1117825443, model.value().get(0).rampDownMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.value().get(0).rampDownActionOnLogoff()); - Assertions.assertEquals(487324139, model.value().get(0).rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(907370686, model.value().get(0).offPeakStartTime().hour()); - Assertions.assertEquals(1133682494, model.value().get(0).offPeakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.value().get(0).offPeakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.value().get(0).offPeakActionOnDisconnect()); - Assertions.assertEquals(961236109, model.value().get(0).offPeakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.value().get(0).offPeakActionOnLogoff()); - Assertions.assertEquals(1316965845, model.value().get(0).offPeakMinutesToWaitOnLogoff()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScalingPlanPersonalScheduleList model - = new ScalingPlanPersonalScheduleList() - .withValue( - Arrays.asList( - new ScalingPlanPersonalScheduleInner() - .withDaysOfWeek(Arrays.asList(DayOfWeek.THURSDAY, DayOfWeek.WEDNESDAY, DayOfWeek.SUNDAY, - DayOfWeek.FRIDAY)) - .withRampUpStartTime(new Time().withHour(1596263349).withMinute(590283036)) - .withRampUpAutoStartHosts(StartupBehavior.WITH_ASSIGNED_USER) - .withRampUpStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withRampUpActionOnDisconnect(SessionHandlingOperation.NONE) - .withRampUpMinutesToWaitOnDisconnect(874839525) - .withRampUpActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withRampUpMinutesToWaitOnLogoff(122725512) - .withPeakStartTime(new Time().withHour(487755858).withMinute(953664851)) - .withPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withPeakActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withPeakMinutesToWaitOnDisconnect(286824564) - .withPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withPeakMinutesToWaitOnLogoff(722282959) - .withRampDownStartTime(new Time().withHour(11756294).withMinute(1832906038)) - .withRampDownStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withRampDownActionOnDisconnect(SessionHandlingOperation.NONE) - .withRampDownMinutesToWaitOnDisconnect(1117825443) - .withRampDownActionOnLogoff(SessionHandlingOperation.HIBERNATE) - .withRampDownMinutesToWaitOnLogoff(487324139) - .withOffPeakStartTime(new Time().withHour(907370686).withMinute(1133682494)) - .withOffPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withOffPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withOffPeakMinutesToWaitOnDisconnect(961236109) - .withOffPeakActionOnLogoff(SessionHandlingOperation.HIBERNATE) - .withOffPeakMinutesToWaitOnLogoff(1316965845), - new ScalingPlanPersonalScheduleInner() - .withDaysOfWeek(Arrays.asList(DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, DayOfWeek.SATURDAY, - DayOfWeek.THURSDAY)) - .withRampUpStartTime(new Time().withHour(334511461).withMinute(1458027183)) - .withRampUpAutoStartHosts(StartupBehavior.WITH_ASSIGNED_USER) - .withRampUpStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withRampUpActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withRampUpMinutesToWaitOnDisconnect(1422875618) - .withRampUpActionOnLogoff(SessionHandlingOperation.HIBERNATE) - .withRampUpMinutesToWaitOnLogoff(1384508080) - .withPeakStartTime(new Time().withHour(523277944).withMinute(983156788)) - .withPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withPeakMinutesToWaitOnDisconnect(1923795312) - .withPeakActionOnLogoff(SessionHandlingOperation.NONE) - .withPeakMinutesToWaitOnLogoff(110510635) - .withRampDownStartTime(new Time().withHour(1668345088).withMinute(2133271340)) - .withRampDownStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withRampDownActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withRampDownMinutesToWaitOnDisconnect(799059143) - .withRampDownActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withRampDownMinutesToWaitOnLogoff(712173581) - .withOffPeakStartTime(new Time().withHour(97204853).withMinute(584568005)) - .withOffPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withOffPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withOffPeakMinutesToWaitOnDisconnect(696489313) - .withOffPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withOffPeakMinutesToWaitOnLogoff(1013346228), - new ScalingPlanPersonalScheduleInner().withDaysOfWeek(Arrays.asList(DayOfWeek.SUNDAY)) - .withRampUpStartTime(new Time().withHour(1748485864).withMinute(191107441)) - .withRampUpAutoStartHosts(StartupBehavior.NONE) - .withRampUpStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withRampUpActionOnDisconnect(SessionHandlingOperation.NONE) - .withRampUpMinutesToWaitOnDisconnect(1615373904) - .withRampUpActionOnLogoff(SessionHandlingOperation.NONE) - .withRampUpMinutesToWaitOnLogoff(1795454962) - .withPeakStartTime(new Time().withHour(1120938995).withMinute(2091557827)) - .withPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withPeakActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withPeakMinutesToWaitOnDisconnect(1836889631) - .withPeakActionOnLogoff(SessionHandlingOperation.HIBERNATE) - .withPeakMinutesToWaitOnLogoff(836308274) - .withRampDownStartTime(new Time().withHour(1269136735).withMinute(90744470)) - .withRampDownStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withRampDownActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withRampDownMinutesToWaitOnDisconnect(975056149) - .withRampDownActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withRampDownMinutesToWaitOnLogoff(1090180987) - .withOffPeakStartTime(new Time().withHour(1185146175).withMinute(1784018500)) - .withOffPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withOffPeakActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withOffPeakMinutesToWaitOnDisconnect(405149242) - .withOffPeakActionOnLogoff(SessionHandlingOperation.NONE) - .withOffPeakMinutesToWaitOnLogoff(1819295736))); - model = BinaryData.fromObject(model).toObject(ScalingPlanPersonalScheduleList.class); - Assertions.assertEquals(DayOfWeek.THURSDAY, model.value().get(0).daysOfWeek().get(0)); - Assertions.assertEquals(1596263349, model.value().get(0).rampUpStartTime().hour()); - Assertions.assertEquals(590283036, model.value().get(0).rampUpStartTime().minute()); - Assertions.assertEquals(StartupBehavior.WITH_ASSIGNED_USER, model.value().get(0).rampUpAutoStartHosts()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.value().get(0).rampUpStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.value().get(0).rampUpActionOnDisconnect()); - Assertions.assertEquals(874839525, model.value().get(0).rampUpMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.value().get(0).rampUpActionOnLogoff()); - Assertions.assertEquals(122725512, model.value().get(0).rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(487755858, model.value().get(0).peakStartTime().hour()); - Assertions.assertEquals(953664851, model.value().get(0).peakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.value().get(0).peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.value().get(0).peakActionOnDisconnect()); - Assertions.assertEquals(286824564, model.value().get(0).peakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.value().get(0).peakActionOnLogoff()); - Assertions.assertEquals(722282959, model.value().get(0).peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(11756294, model.value().get(0).rampDownStartTime().hour()); - Assertions.assertEquals(1832906038, model.value().get(0).rampDownStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.value().get(0).rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.value().get(0).rampDownActionOnDisconnect()); - Assertions.assertEquals(1117825443, model.value().get(0).rampDownMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.value().get(0).rampDownActionOnLogoff()); - Assertions.assertEquals(487324139, model.value().get(0).rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(907370686, model.value().get(0).offPeakStartTime().hour()); - Assertions.assertEquals(1133682494, model.value().get(0).offPeakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.value().get(0).offPeakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.value().get(0).offPeakActionOnDisconnect()); - Assertions.assertEquals(961236109, model.value().get(0).offPeakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.value().get(0).offPeakActionOnLogoff()); - Assertions.assertEquals(1316965845, model.value().get(0).offPeakMinutesToWaitOnLogoff()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulePatchTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulePatchTests.java deleted file mode 100644 index 6e1bc73be6d5..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulePatchTests.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedulePatch; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; -import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; -import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; -import com.azure.resourcemanager.desktopvirtualization.models.Time; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScalingPlanPersonalSchedulePatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScalingPlanPersonalSchedulePatch model = BinaryData.fromString( - "{\"properties\":{\"daysOfWeek\":[\"Saturday\"],\"rampUpStartTime\":{\"hour\":1584904008,\"minute\":1427716289},\"rampUpAutoStartHosts\":\"None\",\"rampUpStartVMOnConnect\":\"Enable\",\"rampUpActionOnDisconnect\":\"Hibernate\",\"rampUpMinutesToWaitOnDisconnect\":1238517729,\"rampUpActionOnLogoff\":\"Hibernate\",\"rampUpMinutesToWaitOnLogoff\":918393543,\"peakStartTime\":{\"hour\":1615397265,\"minute\":1712324120},\"peakStartVMOnConnect\":\"Enable\",\"peakActionOnDisconnect\":\"Deallocate\",\"peakMinutesToWaitOnDisconnect\":889157097,\"peakActionOnLogoff\":\"None\",\"peakMinutesToWaitOnLogoff\":270052165,\"rampDownStartTime\":{\"hour\":1108910411,\"minute\":1300588551},\"rampDownStartVMOnConnect\":\"Enable\",\"rampDownActionOnDisconnect\":\"Hibernate\",\"rampDownMinutesToWaitOnDisconnect\":1297199271,\"rampDownActionOnLogoff\":\"Deallocate\",\"rampDownMinutesToWaitOnLogoff\":585310107,\"offPeakStartTime\":{\"hour\":1282949861,\"minute\":245335843},\"offPeakStartVMOnConnect\":\"Enable\",\"offPeakActionOnDisconnect\":\"None\",\"offPeakMinutesToWaitOnDisconnect\":57076299,\"offPeakActionOnLogoff\":\"Hibernate\",\"offPeakMinutesToWaitOnLogoff\":220721528}}") - .toObject(ScalingPlanPersonalSchedulePatch.class); - Assertions.assertEquals(DayOfWeek.SATURDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(1584904008, model.rampUpStartTime().hour()); - Assertions.assertEquals(1427716289, model.rampUpStartTime().minute()); - Assertions.assertEquals(StartupBehavior.NONE, model.rampUpAutoStartHosts()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.rampUpStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnDisconnect()); - Assertions.assertEquals(1238517729, model.rampUpMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnLogoff()); - Assertions.assertEquals(918393543, model.rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(1615397265, model.peakStartTime().hour()); - Assertions.assertEquals(1712324120, model.peakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.peakActionOnDisconnect()); - Assertions.assertEquals(889157097, model.peakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.peakActionOnLogoff()); - Assertions.assertEquals(270052165, model.peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(1108910411, model.rampDownStartTime().hour()); - Assertions.assertEquals(1300588551, model.rampDownStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampDownActionOnDisconnect()); - Assertions.assertEquals(1297199271, model.rampDownMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.rampDownActionOnLogoff()); - Assertions.assertEquals(585310107, model.rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(1282949861, model.offPeakStartTime().hour()); - Assertions.assertEquals(245335843, model.offPeakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.offPeakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.offPeakActionOnDisconnect()); - Assertions.assertEquals(57076299, model.offPeakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnLogoff()); - Assertions.assertEquals(220721528, model.offPeakMinutesToWaitOnLogoff()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScalingPlanPersonalSchedulePatch model - = new ScalingPlanPersonalSchedulePatch().withDaysOfWeek(Arrays.asList(DayOfWeek.SATURDAY)) - .withRampUpStartTime(new Time().withHour(1584904008).withMinute(1427716289)) - .withRampUpAutoStartHosts(StartupBehavior.NONE) - .withRampUpStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withRampUpActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withRampUpMinutesToWaitOnDisconnect(1238517729) - .withRampUpActionOnLogoff(SessionHandlingOperation.HIBERNATE) - .withRampUpMinutesToWaitOnLogoff(918393543) - .withPeakStartTime(new Time().withHour(1615397265).withMinute(1712324120)) - .withPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withPeakActionOnDisconnect(SessionHandlingOperation.DEALLOCATE) - .withPeakMinutesToWaitOnDisconnect(889157097) - .withPeakActionOnLogoff(SessionHandlingOperation.NONE) - .withPeakMinutesToWaitOnLogoff(270052165) - .withRampDownStartTime(new Time().withHour(1108910411).withMinute(1300588551)) - .withRampDownStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withRampDownActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withRampDownMinutesToWaitOnDisconnect(1297199271) - .withRampDownActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withRampDownMinutesToWaitOnLogoff(585310107) - .withOffPeakStartTime(new Time().withHour(1282949861).withMinute(245335843)) - .withOffPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withOffPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withOffPeakMinutesToWaitOnDisconnect(57076299) - .withOffPeakActionOnLogoff(SessionHandlingOperation.HIBERNATE) - .withOffPeakMinutesToWaitOnLogoff(220721528); - model = BinaryData.fromObject(model).toObject(ScalingPlanPersonalSchedulePatch.class); - Assertions.assertEquals(DayOfWeek.SATURDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(1584904008, model.rampUpStartTime().hour()); - Assertions.assertEquals(1427716289, model.rampUpStartTime().minute()); - Assertions.assertEquals(StartupBehavior.NONE, model.rampUpAutoStartHosts()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.rampUpStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnDisconnect()); - Assertions.assertEquals(1238517729, model.rampUpMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnLogoff()); - Assertions.assertEquals(918393543, model.rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(1615397265, model.peakStartTime().hour()); - Assertions.assertEquals(1712324120, model.peakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.peakActionOnDisconnect()); - Assertions.assertEquals(889157097, model.peakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.peakActionOnLogoff()); - Assertions.assertEquals(270052165, model.peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(1108910411, model.rampDownStartTime().hour()); - Assertions.assertEquals(1300588551, model.rampDownStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampDownActionOnDisconnect()); - Assertions.assertEquals(1297199271, model.rampDownMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.rampDownActionOnLogoff()); - Assertions.assertEquals(585310107, model.rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(1282949861, model.offPeakStartTime().hour()); - Assertions.assertEquals(245335843, model.offPeakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.offPeakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.offPeakActionOnDisconnect()); - Assertions.assertEquals(57076299, model.offPeakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnLogoff()); - Assertions.assertEquals(220721528, model.offPeakMinutesToWaitOnLogoff()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulePropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulePropertiesTests.java deleted file mode 100644 index 2d656a33b9df..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulePropertiesTests.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPersonalScheduleProperties; -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; -import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; -import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; -import com.azure.resourcemanager.desktopvirtualization.models.Time; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScalingPlanPersonalSchedulePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScalingPlanPersonalScheduleProperties model = BinaryData.fromString( - "{\"daysOfWeek\":[\"Saturday\",\"Saturday\",\"Monday\",\"Wednesday\"],\"rampUpStartTime\":{\"hour\":1477938118,\"minute\":1757000388},\"rampUpAutoStartHosts\":\"All\",\"rampUpStartVMOnConnect\":\"Disable\",\"rampUpActionOnDisconnect\":\"Hibernate\",\"rampUpMinutesToWaitOnDisconnect\":1656357002,\"rampUpActionOnLogoff\":\"None\",\"rampUpMinutesToWaitOnLogoff\":151199466,\"peakStartTime\":{\"hour\":395045632,\"minute\":524895743},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"Deallocate\",\"peakMinutesToWaitOnDisconnect\":948183907,\"peakActionOnLogoff\":\"None\",\"peakMinutesToWaitOnLogoff\":604177419,\"rampDownStartTime\":{\"hour\":1214178064,\"minute\":432099850},\"rampDownStartVMOnConnect\":\"Enable\",\"rampDownActionOnDisconnect\":\"Hibernate\",\"rampDownMinutesToWaitOnDisconnect\":681452902,\"rampDownActionOnLogoff\":\"None\",\"rampDownMinutesToWaitOnLogoff\":412409909,\"offPeakStartTime\":{\"hour\":1627840881,\"minute\":1126761283},\"offPeakStartVMOnConnect\":\"Disable\",\"offPeakActionOnDisconnect\":\"Hibernate\",\"offPeakMinutesToWaitOnDisconnect\":1800612686,\"offPeakActionOnLogoff\":\"Hibernate\",\"offPeakMinutesToWaitOnLogoff\":1279542640}") - .toObject(ScalingPlanPersonalScheduleProperties.class); - Assertions.assertEquals(DayOfWeek.SATURDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(1477938118, model.rampUpStartTime().hour()); - Assertions.assertEquals(1757000388, model.rampUpStartTime().minute()); - Assertions.assertEquals(StartupBehavior.ALL, model.rampUpAutoStartHosts()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.rampUpStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnDisconnect()); - Assertions.assertEquals(1656357002, model.rampUpMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampUpActionOnLogoff()); - Assertions.assertEquals(151199466, model.rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(395045632, model.peakStartTime().hour()); - Assertions.assertEquals(524895743, model.peakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.peakActionOnDisconnect()); - Assertions.assertEquals(948183907, model.peakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.peakActionOnLogoff()); - Assertions.assertEquals(604177419, model.peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(1214178064, model.rampDownStartTime().hour()); - Assertions.assertEquals(432099850, model.rampDownStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampDownActionOnDisconnect()); - Assertions.assertEquals(681452902, model.rampDownMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampDownActionOnLogoff()); - Assertions.assertEquals(412409909, model.rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(1627840881, model.offPeakStartTime().hour()); - Assertions.assertEquals(1126761283, model.offPeakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.offPeakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnDisconnect()); - Assertions.assertEquals(1800612686, model.offPeakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnLogoff()); - Assertions.assertEquals(1279542640, model.offPeakMinutesToWaitOnLogoff()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScalingPlanPersonalScheduleProperties model = new ScalingPlanPersonalScheduleProperties() - .withDaysOfWeek( - Arrays.asList(DayOfWeek.SATURDAY, DayOfWeek.SATURDAY, DayOfWeek.MONDAY, DayOfWeek.WEDNESDAY)) - .withRampUpStartTime(new Time().withHour(1477938118).withMinute(1757000388)) - .withRampUpAutoStartHosts(StartupBehavior.ALL) - .withRampUpStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withRampUpActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withRampUpMinutesToWaitOnDisconnect(1656357002) - .withRampUpActionOnLogoff(SessionHandlingOperation.NONE) - .withRampUpMinutesToWaitOnLogoff(151199466) - .withPeakStartTime(new Time().withHour(395045632).withMinute(524895743)) - .withPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withPeakActionOnDisconnect(SessionHandlingOperation.DEALLOCATE) - .withPeakMinutesToWaitOnDisconnect(948183907) - .withPeakActionOnLogoff(SessionHandlingOperation.NONE) - .withPeakMinutesToWaitOnLogoff(604177419) - .withRampDownStartTime(new Time().withHour(1214178064).withMinute(432099850)) - .withRampDownStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withRampDownActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withRampDownMinutesToWaitOnDisconnect(681452902) - .withRampDownActionOnLogoff(SessionHandlingOperation.NONE) - .withRampDownMinutesToWaitOnLogoff(412409909) - .withOffPeakStartTime(new Time().withHour(1627840881).withMinute(1126761283)) - .withOffPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withOffPeakActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withOffPeakMinutesToWaitOnDisconnect(1800612686) - .withOffPeakActionOnLogoff(SessionHandlingOperation.HIBERNATE) - .withOffPeakMinutesToWaitOnLogoff(1279542640); - model = BinaryData.fromObject(model).toObject(ScalingPlanPersonalScheduleProperties.class); - Assertions.assertEquals(DayOfWeek.SATURDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(1477938118, model.rampUpStartTime().hour()); - Assertions.assertEquals(1757000388, model.rampUpStartTime().minute()); - Assertions.assertEquals(StartupBehavior.ALL, model.rampUpAutoStartHosts()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.rampUpStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnDisconnect()); - Assertions.assertEquals(1656357002, model.rampUpMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampUpActionOnLogoff()); - Assertions.assertEquals(151199466, model.rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(395045632, model.peakStartTime().hour()); - Assertions.assertEquals(524895743, model.peakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.peakActionOnDisconnect()); - Assertions.assertEquals(948183907, model.peakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.peakActionOnLogoff()); - Assertions.assertEquals(604177419, model.peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(1214178064, model.rampDownStartTime().hour()); - Assertions.assertEquals(432099850, model.rampDownStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampDownActionOnDisconnect()); - Assertions.assertEquals(681452902, model.rampDownMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampDownActionOnLogoff()); - Assertions.assertEquals(412409909, model.rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(1627840881, model.offPeakStartTime().hour()); - Assertions.assertEquals(1126761283, model.offPeakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.offPeakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnDisconnect()); - Assertions.assertEquals(1800612686, model.offPeakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnLogoff()); - Assertions.assertEquals(1279542640, model.offPeakMinutesToWaitOnLogoff()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesCreateWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesCreateWithResponseMockTests.java deleted file mode 100644 index f5c2ddce9c5d..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesCreateWithResponseMockTests.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedule; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; -import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; -import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; -import com.azure.resourcemanager.desktopvirtualization.models.Time; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ScalingPlanPersonalSchedulesCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"daysOfWeek\":[\"Tuesday\"],\"rampUpStartTime\":{\"hour\":1740485415,\"minute\":1580981613},\"rampUpAutoStartHosts\":\"None\",\"rampUpStartVMOnConnect\":\"Enable\",\"rampUpActionOnDisconnect\":\"Deallocate\",\"rampUpMinutesToWaitOnDisconnect\":425650083,\"rampUpActionOnLogoff\":\"Deallocate\",\"rampUpMinutesToWaitOnLogoff\":1409401531,\"peakStartTime\":{\"hour\":1569096648,\"minute\":1529419314},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"Hibernate\",\"peakMinutesToWaitOnDisconnect\":233230140,\"peakActionOnLogoff\":\"None\",\"peakMinutesToWaitOnLogoff\":2042229356,\"rampDownStartTime\":{\"hour\":1674537674,\"minute\":717249946},\"rampDownStartVMOnConnect\":\"Disable\",\"rampDownActionOnDisconnect\":\"Deallocate\",\"rampDownMinutesToWaitOnDisconnect\":1772909914,\"rampDownActionOnLogoff\":\"Deallocate\",\"rampDownMinutesToWaitOnLogoff\":70597241,\"offPeakStartTime\":{\"hour\":990938401,\"minute\":1699692322},\"offPeakStartVMOnConnect\":\"Enable\",\"offPeakActionOnDisconnect\":\"Hibernate\",\"offPeakMinutesToWaitOnDisconnect\":1400894548,\"offPeakActionOnLogoff\":\"None\",\"offPeakMinutesToWaitOnLogoff\":1125182676},\"id\":\"xqvapcohh\",\"name\":\"ucqpqojxcxzrz\",\"type\":\"cgdz\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ScalingPlanPersonalSchedule response = manager.scalingPlanPersonalSchedules() - .define("gdhxi") - .withExistingScalingPlan("rrueqthwmg", "mbscbbx") - .withDaysOfWeek(Arrays.asList(DayOfWeek.SATURDAY, DayOfWeek.THURSDAY, DayOfWeek.TUESDAY, DayOfWeek.TUESDAY)) - .withRampUpStartTime(new Time().withHour(1096839019).withMinute(896412004)) - .withRampUpAutoStartHosts(StartupBehavior.ALL) - .withRampUpStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withRampUpActionOnDisconnect(SessionHandlingOperation.NONE) - .withRampUpMinutesToWaitOnDisconnect(1122142083) - .withRampUpActionOnLogoff(SessionHandlingOperation.HIBERNATE) - .withRampUpMinutesToWaitOnLogoff(1483648250) - .withPeakStartTime(new Time().withHour(935812516).withMinute(686332411)) - .withPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withPeakMinutesToWaitOnDisconnect(912585397) - .withPeakActionOnLogoff(SessionHandlingOperation.HIBERNATE) - .withPeakMinutesToWaitOnLogoff(939528719) - .withRampDownStartTime(new Time().withHour(1438564589).withMinute(1525948244)) - .withRampDownStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withRampDownActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withRampDownMinutesToWaitOnDisconnect(757969717) - .withRampDownActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withRampDownMinutesToWaitOnLogoff(883742006) - .withOffPeakStartTime(new Time().withHour(1335444948).withMinute(1699509778)) - .withOffPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withOffPeakActionOnDisconnect(SessionHandlingOperation.DEALLOCATE) - .withOffPeakMinutesToWaitOnDisconnect(1120950278) - .withOffPeakActionOnLogoff(SessionHandlingOperation.NONE) - .withOffPeakMinutesToWaitOnLogoff(49618457) - .create(); - - Assertions.assertEquals(DayOfWeek.TUESDAY, response.daysOfWeek().get(0)); - Assertions.assertEquals(1740485415, response.rampUpStartTime().hour()); - Assertions.assertEquals(1580981613, response.rampUpStartTime().minute()); - Assertions.assertEquals(StartupBehavior.NONE, response.rampUpAutoStartHosts()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, response.rampUpStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, response.rampUpActionOnDisconnect()); - Assertions.assertEquals(425650083, response.rampUpMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, response.rampUpActionOnLogoff()); - Assertions.assertEquals(1409401531, response.rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(1569096648, response.peakStartTime().hour()); - Assertions.assertEquals(1529419314, response.peakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, response.peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.peakActionOnDisconnect()); - Assertions.assertEquals(233230140, response.peakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, response.peakActionOnLogoff()); - Assertions.assertEquals(2042229356, response.peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(1674537674, response.rampDownStartTime().hour()); - Assertions.assertEquals(717249946, response.rampDownStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, response.rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, response.rampDownActionOnDisconnect()); - Assertions.assertEquals(1772909914, response.rampDownMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, response.rampDownActionOnLogoff()); - Assertions.assertEquals(70597241, response.rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(990938401, response.offPeakStartTime().hour()); - Assertions.assertEquals(1699692322, response.offPeakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, response.offPeakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.offPeakActionOnDisconnect()); - Assertions.assertEquals(1400894548, response.offPeakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, response.offPeakActionOnLogoff()); - Assertions.assertEquals(1125182676, response.offPeakMinutesToWaitOnLogoff()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesDeleteWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesDeleteWithResponseMockTests.java deleted file mode 100644 index 89acb5ad12fc..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ScalingPlanPersonalSchedulesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.scalingPlanPersonalSchedules() - .deleteWithResponse("ja", "urnnqbnqbpiz", "qltgrd", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesGetWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesGetWithResponseMockTests.java deleted file mode 100644 index dee50bb3c5b1..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesGetWithResponseMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedule; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; -import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; -import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ScalingPlanPersonalSchedulesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"daysOfWeek\":[\"Thursday\",\"Friday\",\"Thursday\",\"Wednesday\"],\"rampUpStartTime\":{\"hour\":1304447311,\"minute\":718390639},\"rampUpAutoStartHosts\":\"All\",\"rampUpStartVMOnConnect\":\"Enable\",\"rampUpActionOnDisconnect\":\"Hibernate\",\"rampUpMinutesToWaitOnDisconnect\":1691318308,\"rampUpActionOnLogoff\":\"Hibernate\",\"rampUpMinutesToWaitOnLogoff\":355623092,\"peakStartTime\":{\"hour\":143922465,\"minute\":1101353538},\"peakStartVMOnConnect\":\"Enable\",\"peakActionOnDisconnect\":\"Deallocate\",\"peakMinutesToWaitOnDisconnect\":2104491949,\"peakActionOnLogoff\":\"None\",\"peakMinutesToWaitOnLogoff\":834790015,\"rampDownStartTime\":{\"hour\":755029786,\"minute\":862092448},\"rampDownStartVMOnConnect\":\"Enable\",\"rampDownActionOnDisconnect\":\"None\",\"rampDownMinutesToWaitOnDisconnect\":36520302,\"rampDownActionOnLogoff\":\"None\",\"rampDownMinutesToWaitOnLogoff\":536933568,\"offPeakStartTime\":{\"hour\":2089748283,\"minute\":1377606972},\"offPeakStartVMOnConnect\":\"Disable\",\"offPeakActionOnDisconnect\":\"Deallocate\",\"offPeakMinutesToWaitOnDisconnect\":203587565,\"offPeakActionOnLogoff\":\"Deallocate\",\"offPeakMinutesToWaitOnLogoff\":367147351},\"id\":\"jpvuaurkihcirld\",\"name\":\"fx\",\"type\":\"dcoxnbk\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ScalingPlanPersonalSchedule response = manager.scalingPlanPersonalSchedules() - .getWithResponse("hkgmnsg", "pxycphdr", "jjkhvyomaclu", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(DayOfWeek.THURSDAY, response.daysOfWeek().get(0)); - Assertions.assertEquals(1304447311, response.rampUpStartTime().hour()); - Assertions.assertEquals(718390639, response.rampUpStartTime().minute()); - Assertions.assertEquals(StartupBehavior.ALL, response.rampUpAutoStartHosts()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, response.rampUpStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.rampUpActionOnDisconnect()); - Assertions.assertEquals(1691318308, response.rampUpMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.rampUpActionOnLogoff()); - Assertions.assertEquals(355623092, response.rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(143922465, response.peakStartTime().hour()); - Assertions.assertEquals(1101353538, response.peakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, response.peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, response.peakActionOnDisconnect()); - Assertions.assertEquals(2104491949, response.peakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, response.peakActionOnLogoff()); - Assertions.assertEquals(834790015, response.peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(755029786, response.rampDownStartTime().hour()); - Assertions.assertEquals(862092448, response.rampDownStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, response.rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, response.rampDownActionOnDisconnect()); - Assertions.assertEquals(36520302, response.rampDownMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, response.rampDownActionOnLogoff()); - Assertions.assertEquals(536933568, response.rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(2089748283, response.offPeakStartTime().hour()); - Assertions.assertEquals(1377606972, response.offPeakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, response.offPeakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, response.offPeakActionOnDisconnect()); - Assertions.assertEquals(203587565, response.offPeakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, response.offPeakActionOnLogoff()); - Assertions.assertEquals(367147351, response.offPeakMinutesToWaitOnLogoff()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesListMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesListMockTests.java deleted file mode 100644 index 7ffc752b8f6d..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesListMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedule; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; -import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; -import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ScalingPlanPersonalSchedulesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"daysOfWeek\":[\"Monday\",\"Friday\"],\"rampUpStartTime\":{\"hour\":384841052,\"minute\":1302563571},\"rampUpAutoStartHosts\":\"All\",\"rampUpStartVMOnConnect\":\"Disable\",\"rampUpActionOnDisconnect\":\"None\",\"rampUpMinutesToWaitOnDisconnect\":569544642,\"rampUpActionOnLogoff\":\"Hibernate\",\"rampUpMinutesToWaitOnLogoff\":937935605,\"peakStartTime\":{\"hour\":149368324,\"minute\":1258404942},\"peakStartVMOnConnect\":\"Enable\",\"peakActionOnDisconnect\":\"Hibernate\",\"peakMinutesToWaitOnDisconnect\":1055328892,\"peakActionOnLogoff\":\"Hibernate\",\"peakMinutesToWaitOnLogoff\":716318057,\"rampDownStartTime\":{\"hour\":1761348556,\"minute\":620018681},\"rampDownStartVMOnConnect\":\"Disable\",\"rampDownActionOnDisconnect\":\"Deallocate\",\"rampDownMinutesToWaitOnDisconnect\":971775646,\"rampDownActionOnLogoff\":\"None\",\"rampDownMinutesToWaitOnLogoff\":1389401676,\"offPeakStartTime\":{\"hour\":537279980,\"minute\":2138808813},\"offPeakStartVMOnConnect\":\"Disable\",\"offPeakActionOnDisconnect\":\"Hibernate\",\"offPeakMinutesToWaitOnDisconnect\":1546615539,\"offPeakActionOnLogoff\":\"None\",\"offPeakMinutesToWaitOnLogoff\":1583480383},\"id\":\"tnjadhq\",\"name\":\"aw\",\"type\":\"qoyueayfbpcmsplb\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.scalingPlanPersonalSchedules() - .list("gypxrxvbfihwuhvc", "a", 64697059, true, 2010585731, com.azure.core.util.Context.NONE); - - Assertions.assertEquals(DayOfWeek.MONDAY, response.iterator().next().daysOfWeek().get(0)); - Assertions.assertEquals(384841052, response.iterator().next().rampUpStartTime().hour()); - Assertions.assertEquals(1302563571, response.iterator().next().rampUpStartTime().minute()); - Assertions.assertEquals(StartupBehavior.ALL, response.iterator().next().rampUpAutoStartHosts()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, response.iterator().next().rampUpStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, response.iterator().next().rampUpActionOnDisconnect()); - Assertions.assertEquals(569544642, response.iterator().next().rampUpMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.iterator().next().rampUpActionOnLogoff()); - Assertions.assertEquals(937935605, response.iterator().next().rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(149368324, response.iterator().next().peakStartTime().hour()); - Assertions.assertEquals(1258404942, response.iterator().next().peakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, response.iterator().next().peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, - response.iterator().next().peakActionOnDisconnect()); - Assertions.assertEquals(1055328892, response.iterator().next().peakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.iterator().next().peakActionOnLogoff()); - Assertions.assertEquals(716318057, response.iterator().next().peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(1761348556, response.iterator().next().rampDownStartTime().hour()); - Assertions.assertEquals(620018681, response.iterator().next().rampDownStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, response.iterator().next().rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, - response.iterator().next().rampDownActionOnDisconnect()); - Assertions.assertEquals(971775646, response.iterator().next().rampDownMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, response.iterator().next().rampDownActionOnLogoff()); - Assertions.assertEquals(1389401676, response.iterator().next().rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(537279980, response.iterator().next().offPeakStartTime().hour()); - Assertions.assertEquals(2138808813, response.iterator().next().offPeakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, response.iterator().next().offPeakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, - response.iterator().next().offPeakActionOnDisconnect()); - Assertions.assertEquals(1546615539, response.iterator().next().offPeakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, response.iterator().next().offPeakActionOnLogoff()); - Assertions.assertEquals(1583480383, response.iterator().next().offPeakMinutesToWaitOnLogoff()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledScheduleInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledScheduleInnerTests.java deleted file mode 100644 index df7abe37d332..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledScheduleInnerTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPooledScheduleInner; -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; -import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; -import com.azure.resourcemanager.desktopvirtualization.models.Time; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScalingPlanPooledScheduleInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScalingPlanPooledScheduleInner model = BinaryData.fromString( - "{\"properties\":{\"daysOfWeek\":[\"Thursday\"],\"rampUpStartTime\":{\"hour\":1647609549,\"minute\":2048055130},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1715507551,\"rampUpCapacityThresholdPct\":1436102139,\"peakStartTime\":{\"hour\":1600165537,\"minute\":1827531187},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":391970506,\"minute\":2048168714},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":1152020606,\"rampDownCapacityThresholdPct\":1151827085,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":2069794521,\"rampDownNotificationMessage\":\"zovawjvz\",\"offPeakStartTime\":{\"hour\":1168094954,\"minute\":2116872834},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},\"id\":\"n\",\"name\":\"rnxipei\",\"type\":\"pjzu\"}") - .toObject(ScalingPlanPooledScheduleInner.class); - Assertions.assertEquals(DayOfWeek.THURSDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(1647609549, model.rampUpStartTime().hour()); - Assertions.assertEquals(2048055130, model.rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(1715507551, model.rampUpMinimumHostsPct()); - Assertions.assertEquals(1436102139, model.rampUpCapacityThresholdPct()); - Assertions.assertEquals(1600165537, model.peakStartTime().hour()); - Assertions.assertEquals(1827531187, model.peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.peakLoadBalancingAlgorithm()); - Assertions.assertEquals(391970506, model.rampDownStartTime().hour()); - Assertions.assertEquals(2048168714, model.rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1152020606, model.rampDownMinimumHostsPct()); - Assertions.assertEquals(1151827085, model.rampDownCapacityThresholdPct()); - Assertions.assertEquals(true, model.rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.rampDownStopHostsWhen()); - Assertions.assertEquals(2069794521, model.rampDownWaitTimeMinutes()); - Assertions.assertEquals("zovawjvz", model.rampDownNotificationMessage()); - Assertions.assertEquals(1168094954, model.offPeakStartTime().hour()); - Assertions.assertEquals(2116872834, model.offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.offPeakLoadBalancingAlgorithm()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScalingPlanPooledScheduleInner model - = new ScalingPlanPooledScheduleInner().withDaysOfWeek(Arrays.asList(DayOfWeek.THURSDAY)) - .withRampUpStartTime(new Time().withHour(1647609549).withMinute(2048055130)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(1715507551) - .withRampUpCapacityThresholdPct(1436102139) - .withPeakStartTime(new Time().withHour(1600165537).withMinute(1827531187)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownStartTime(new Time().withHour(391970506).withMinute(2048168714)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(1152020606) - .withRampDownCapacityThresholdPct(1151827085) - .withRampDownForceLogoffUsers(true) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) - .withRampDownWaitTimeMinutes(2069794521) - .withRampDownNotificationMessage("zovawjvz") - .withOffPeakStartTime(new Time().withHour(1168094954).withMinute(2116872834)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST); - model = BinaryData.fromObject(model).toObject(ScalingPlanPooledScheduleInner.class); - Assertions.assertEquals(DayOfWeek.THURSDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(1647609549, model.rampUpStartTime().hour()); - Assertions.assertEquals(2048055130, model.rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(1715507551, model.rampUpMinimumHostsPct()); - Assertions.assertEquals(1436102139, model.rampUpCapacityThresholdPct()); - Assertions.assertEquals(1600165537, model.peakStartTime().hour()); - Assertions.assertEquals(1827531187, model.peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.peakLoadBalancingAlgorithm()); - Assertions.assertEquals(391970506, model.rampDownStartTime().hour()); - Assertions.assertEquals(2048168714, model.rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1152020606, model.rampDownMinimumHostsPct()); - Assertions.assertEquals(1151827085, model.rampDownCapacityThresholdPct()); - Assertions.assertEquals(true, model.rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.rampDownStopHostsWhen()); - Assertions.assertEquals(2069794521, model.rampDownWaitTimeMinutes()); - Assertions.assertEquals("zovawjvz", model.rampDownNotificationMessage()); - Assertions.assertEquals(1168094954, model.offPeakStartTime().hour()); - Assertions.assertEquals(2116872834, model.offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.offPeakLoadBalancingAlgorithm()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledScheduleListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledScheduleListTests.java deleted file mode 100644 index 1a5caeaf1eb3..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledScheduleListTests.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPooledScheduleInner; -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledScheduleList; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; -import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; -import com.azure.resourcemanager.desktopvirtualization.models.Time; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScalingPlanPooledScheduleListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScalingPlanPooledScheduleList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"daysOfWeek\":[\"Friday\",\"Wednesday\",\"Tuesday\"],\"rampUpStartTime\":{\"hour\":2019040636,\"minute\":338367472},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":809589965,\"rampUpCapacityThresholdPct\":1987785731,\"peakStartTime\":{\"hour\":1767174247,\"minute\":1198942422},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":1796159221,\"minute\":24250609},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":1189484284,\"rampDownCapacityThresholdPct\":2098592267,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":882329549,\"rampDownNotificationMessage\":\"qgitxmed\",\"offPeakStartTime\":{\"hour\":119641642,\"minute\":229566097},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},\"id\":\"qwwncw\",\"name\":\"zhxgktrmgucn\",\"type\":\"pkteo\"},{\"properties\":{\"daysOfWeek\":[\"Monday\",\"Wednesday\"],\"rampUpStartTime\":{\"hour\":1750481006,\"minute\":220477618},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":622690283,\"rampUpCapacityThresholdPct\":190116972,\"peakStartTime\":{\"hour\":377649989,\"minute\":1732351428},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":598270118,\"minute\":1015467310},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":1863472171,\"rampDownCapacityThresholdPct\":350693240,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":1290719044,\"rampDownNotificationMessage\":\"qxolzdahzx\",\"offPeakStartTime\":{\"hour\":792773086,\"minute\":1183289800},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},\"id\":\"dmoizpostmg\",\"name\":\"cfbu\",\"type\":\"rmfqjhhkxbpvj\"},{\"properties\":{\"daysOfWeek\":[\"Wednesday\",\"Tuesday\"],\"rampUpStartTime\":{\"hour\":256415791,\"minute\":1905459835},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1547170393,\"rampUpCapacityThresholdPct\":709411733,\"peakStartTime\":{\"hour\":258725864,\"minute\":1003023874},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":173760475,\"minute\":1688847935},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":668834645,\"rampDownCapacityThresholdPct\":133351915,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":1315854655,\"rampDownNotificationMessage\":\"xivetvt\",\"offPeakStartTime\":{\"hour\":393815457,\"minute\":928990245},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},\"id\":\"qmcbxvwvxyslqbhs\",\"name\":\"xoblytkbl\",\"type\":\"pe\"}],\"nextLink\":\"wfbkrvrns\"}") - .toObject(ScalingPlanPooledScheduleList.class); - Assertions.assertEquals(DayOfWeek.FRIDAY, model.value().get(0).daysOfWeek().get(0)); - Assertions.assertEquals(2019040636, model.value().get(0).rampUpStartTime().hour()); - Assertions.assertEquals(338367472, model.value().get(0).rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.value().get(0).rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(809589965, model.value().get(0).rampUpMinimumHostsPct()); - Assertions.assertEquals(1987785731, model.value().get(0).rampUpCapacityThresholdPct()); - Assertions.assertEquals(1767174247, model.value().get(0).peakStartTime().hour()); - Assertions.assertEquals(1198942422, model.value().get(0).peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.value().get(0).peakLoadBalancingAlgorithm()); - Assertions.assertEquals(1796159221, model.value().get(0).rampDownStartTime().hour()); - Assertions.assertEquals(24250609, model.value().get(0).rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.value().get(0).rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1189484284, model.value().get(0).rampDownMinimumHostsPct()); - Assertions.assertEquals(2098592267, model.value().get(0).rampDownCapacityThresholdPct()); - Assertions.assertEquals(true, model.value().get(0).rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.value().get(0).rampDownStopHostsWhen()); - Assertions.assertEquals(882329549, model.value().get(0).rampDownWaitTimeMinutes()); - Assertions.assertEquals("qgitxmed", model.value().get(0).rampDownNotificationMessage()); - Assertions.assertEquals(119641642, model.value().get(0).offPeakStartTime().hour()); - Assertions.assertEquals(229566097, model.value().get(0).offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.value().get(0).offPeakLoadBalancingAlgorithm()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScalingPlanPooledScheduleList model = new ScalingPlanPooledScheduleList().withValue(Arrays.asList( - new ScalingPlanPooledScheduleInner() - .withDaysOfWeek(Arrays.asList(DayOfWeek.FRIDAY, DayOfWeek.WEDNESDAY, DayOfWeek.TUESDAY)) - .withRampUpStartTime(new Time().withHour(2019040636).withMinute(338367472)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampUpMinimumHostsPct(809589965) - .withRampUpCapacityThresholdPct(1987785731) - .withPeakStartTime(new Time().withHour(1767174247).withMinute(1198942422)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownStartTime(new Time().withHour(1796159221).withMinute(24250609)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownMinimumHostsPct(1189484284) - .withRampDownCapacityThresholdPct(2098592267) - .withRampDownForceLogoffUsers(true) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) - .withRampDownWaitTimeMinutes(882329549) - .withRampDownNotificationMessage("qgitxmed") - .withOffPeakStartTime(new Time().withHour(119641642).withMinute(229566097)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST), - new ScalingPlanPooledScheduleInner().withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.WEDNESDAY)) - .withRampUpStartTime(new Time().withHour(1750481006).withMinute(220477618)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(622690283) - .withRampUpCapacityThresholdPct(190116972) - .withPeakStartTime(new Time().withHour(377649989).withMinute(1732351428)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(598270118).withMinute(1015467310)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(1863472171) - .withRampDownCapacityThresholdPct(350693240) - .withRampDownForceLogoffUsers(true) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) - .withRampDownWaitTimeMinutes(1290719044) - .withRampDownNotificationMessage("qxolzdahzx") - .withOffPeakStartTime(new Time().withHour(792773086).withMinute(1183289800)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST), - new ScalingPlanPooledScheduleInner().withDaysOfWeek(Arrays.asList(DayOfWeek.WEDNESDAY, DayOfWeek.TUESDAY)) - .withRampUpStartTime(new Time().withHour(256415791).withMinute(1905459835)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(1547170393) - .withRampUpCapacityThresholdPct(709411733) - .withPeakStartTime(new Time().withHour(258725864).withMinute(1003023874)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownStartTime(new Time().withHour(173760475).withMinute(1688847935)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(668834645) - .withRampDownCapacityThresholdPct(133351915) - .withRampDownForceLogoffUsers(true) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) - .withRampDownWaitTimeMinutes(1315854655) - .withRampDownNotificationMessage("xivetvt") - .withOffPeakStartTime(new Time().withHour(393815457).withMinute(928990245)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST))); - model = BinaryData.fromObject(model).toObject(ScalingPlanPooledScheduleList.class); - Assertions.assertEquals(DayOfWeek.FRIDAY, model.value().get(0).daysOfWeek().get(0)); - Assertions.assertEquals(2019040636, model.value().get(0).rampUpStartTime().hour()); - Assertions.assertEquals(338367472, model.value().get(0).rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.value().get(0).rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(809589965, model.value().get(0).rampUpMinimumHostsPct()); - Assertions.assertEquals(1987785731, model.value().get(0).rampUpCapacityThresholdPct()); - Assertions.assertEquals(1767174247, model.value().get(0).peakStartTime().hour()); - Assertions.assertEquals(1198942422, model.value().get(0).peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.value().get(0).peakLoadBalancingAlgorithm()); - Assertions.assertEquals(1796159221, model.value().get(0).rampDownStartTime().hour()); - Assertions.assertEquals(24250609, model.value().get(0).rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.value().get(0).rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1189484284, model.value().get(0).rampDownMinimumHostsPct()); - Assertions.assertEquals(2098592267, model.value().get(0).rampDownCapacityThresholdPct()); - Assertions.assertEquals(true, model.value().get(0).rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.value().get(0).rampDownStopHostsWhen()); - Assertions.assertEquals(882329549, model.value().get(0).rampDownWaitTimeMinutes()); - Assertions.assertEquals("qgitxmed", model.value().get(0).rampDownNotificationMessage()); - Assertions.assertEquals(119641642, model.value().get(0).offPeakStartTime().hour()); - Assertions.assertEquals(229566097, model.value().get(0).offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.value().get(0).offPeakLoadBalancingAlgorithm()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulePatchTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulePatchTests.java deleted file mode 100644 index cb0d64bba044..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulePatchTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedulePatch; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; -import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; -import com.azure.resourcemanager.desktopvirtualization.models.Time; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScalingPlanPooledSchedulePatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScalingPlanPooledSchedulePatch model = BinaryData.fromString( - "{\"properties\":{\"daysOfWeek\":[\"Saturday\",\"Friday\",\"Wednesday\"],\"rampUpStartTime\":{\"hour\":45872869,\"minute\":1362552050},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":25295953,\"rampUpCapacityThresholdPct\":104296969,\"peakStartTime\":{\"hour\":109250802,\"minute\":643648278},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":314739755,\"minute\":1952282875},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":2139040680,\"rampDownCapacityThresholdPct\":1504289199,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":131354519,\"rampDownNotificationMessage\":\"ixisxyawjoy\",\"offPeakStartTime\":{\"hour\":1772436776,\"minute\":21633228},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},\"id\":\"pkii\",\"name\":\"zyexzn\",\"type\":\"lixhnrztfol\"}") - .toObject(ScalingPlanPooledSchedulePatch.class); - Assertions.assertEquals(DayOfWeek.SATURDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(45872869, model.rampUpStartTime().hour()); - Assertions.assertEquals(1362552050, model.rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(25295953, model.rampUpMinimumHostsPct()); - Assertions.assertEquals(104296969, model.rampUpCapacityThresholdPct()); - Assertions.assertEquals(109250802, model.peakStartTime().hour()); - Assertions.assertEquals(643648278, model.peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.peakLoadBalancingAlgorithm()); - Assertions.assertEquals(314739755, model.rampDownStartTime().hour()); - Assertions.assertEquals(1952282875, model.rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(2139040680, model.rampDownMinimumHostsPct()); - Assertions.assertEquals(1504289199, model.rampDownCapacityThresholdPct()); - Assertions.assertEquals(true, model.rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.rampDownStopHostsWhen()); - Assertions.assertEquals(131354519, model.rampDownWaitTimeMinutes()); - Assertions.assertEquals("ixisxyawjoy", model.rampDownNotificationMessage()); - Assertions.assertEquals(1772436776, model.offPeakStartTime().hour()); - Assertions.assertEquals(21633228, model.offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.offPeakLoadBalancingAlgorithm()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScalingPlanPooledSchedulePatch model = new ScalingPlanPooledSchedulePatch() - .withDaysOfWeek(Arrays.asList(DayOfWeek.SATURDAY, DayOfWeek.FRIDAY, DayOfWeek.WEDNESDAY)) - .withRampUpStartTime(new Time().withHour(45872869).withMinute(1362552050)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(25295953) - .withRampUpCapacityThresholdPct(104296969) - .withPeakStartTime(new Time().withHour(109250802).withMinute(643648278)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownStartTime(new Time().withHour(314739755).withMinute(1952282875)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(2139040680) - .withRampDownCapacityThresholdPct(1504289199) - .withRampDownForceLogoffUsers(true) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) - .withRampDownWaitTimeMinutes(131354519) - .withRampDownNotificationMessage("ixisxyawjoy") - .withOffPeakStartTime(new Time().withHour(1772436776).withMinute(21633228)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST); - model = BinaryData.fromObject(model).toObject(ScalingPlanPooledSchedulePatch.class); - Assertions.assertEquals(DayOfWeek.SATURDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(45872869, model.rampUpStartTime().hour()); - Assertions.assertEquals(1362552050, model.rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(25295953, model.rampUpMinimumHostsPct()); - Assertions.assertEquals(104296969, model.rampUpCapacityThresholdPct()); - Assertions.assertEquals(109250802, model.peakStartTime().hour()); - Assertions.assertEquals(643648278, model.peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.peakLoadBalancingAlgorithm()); - Assertions.assertEquals(314739755, model.rampDownStartTime().hour()); - Assertions.assertEquals(1952282875, model.rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(2139040680, model.rampDownMinimumHostsPct()); - Assertions.assertEquals(1504289199, model.rampDownCapacityThresholdPct()); - Assertions.assertEquals(true, model.rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.rampDownStopHostsWhen()); - Assertions.assertEquals(131354519, model.rampDownWaitTimeMinutes()); - Assertions.assertEquals("ixisxyawjoy", model.rampDownNotificationMessage()); - Assertions.assertEquals(1772436776, model.offPeakStartTime().hour()); - Assertions.assertEquals(21633228, model.offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.offPeakLoadBalancingAlgorithm()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulePropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulePropertiesTests.java deleted file mode 100644 index 54cf6ce9d22f..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulePropertiesTests.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPooledScheduleProperties; -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; -import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; -import com.azure.resourcemanager.desktopvirtualization.models.Time; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScalingPlanPooledSchedulePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScalingPlanPooledScheduleProperties model = BinaryData.fromString( - "{\"daysOfWeek\":[\"Tuesday\",\"Saturday\",\"Friday\",\"Wednesday\"],\"rampUpStartTime\":{\"hour\":1310045138,\"minute\":1368880432},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":950263579,\"rampUpCapacityThresholdPct\":538368150,\"peakStartTime\":{\"hour\":369228588,\"minute\":1391640173},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":583849936,\"minute\":692695288},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":311434030,\"rampDownCapacityThresholdPct\":1290652027,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":820009390,\"rampDownNotificationMessage\":\"f\",\"offPeakStartTime\":{\"hour\":568244971,\"minute\":519560547},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"}") - .toObject(ScalingPlanPooledScheduleProperties.class); - Assertions.assertEquals(DayOfWeek.TUESDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(1310045138, model.rampUpStartTime().hour()); - Assertions.assertEquals(1368880432, model.rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(950263579, model.rampUpMinimumHostsPct()); - Assertions.assertEquals(538368150, model.rampUpCapacityThresholdPct()); - Assertions.assertEquals(369228588, model.peakStartTime().hour()); - Assertions.assertEquals(1391640173, model.peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.peakLoadBalancingAlgorithm()); - Assertions.assertEquals(583849936, model.rampDownStartTime().hour()); - Assertions.assertEquals(692695288, model.rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(311434030, model.rampDownMinimumHostsPct()); - Assertions.assertEquals(1290652027, model.rampDownCapacityThresholdPct()); - Assertions.assertEquals(false, model.rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.rampDownStopHostsWhen()); - Assertions.assertEquals(820009390, model.rampDownWaitTimeMinutes()); - Assertions.assertEquals("f", model.rampDownNotificationMessage()); - Assertions.assertEquals(568244971, model.offPeakStartTime().hour()); - Assertions.assertEquals(519560547, model.offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.offPeakLoadBalancingAlgorithm()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScalingPlanPooledScheduleProperties model = new ScalingPlanPooledScheduleProperties() - .withDaysOfWeek(Arrays.asList(DayOfWeek.TUESDAY, DayOfWeek.SATURDAY, DayOfWeek.FRIDAY, DayOfWeek.WEDNESDAY)) - .withRampUpStartTime(new Time().withHour(1310045138).withMinute(1368880432)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(950263579) - .withRampUpCapacityThresholdPct(538368150) - .withPeakStartTime(new Time().withHour(369228588).withMinute(1391640173)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(583849936).withMinute(692695288)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownMinimumHostsPct(311434030) - .withRampDownCapacityThresholdPct(1290652027) - .withRampDownForceLogoffUsers(false) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) - .withRampDownWaitTimeMinutes(820009390) - .withRampDownNotificationMessage("f") - .withOffPeakStartTime(new Time().withHour(568244971).withMinute(519560547)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST); - model = BinaryData.fromObject(model).toObject(ScalingPlanPooledScheduleProperties.class); - Assertions.assertEquals(DayOfWeek.TUESDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(1310045138, model.rampUpStartTime().hour()); - Assertions.assertEquals(1368880432, model.rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(950263579, model.rampUpMinimumHostsPct()); - Assertions.assertEquals(538368150, model.rampUpCapacityThresholdPct()); - Assertions.assertEquals(369228588, model.peakStartTime().hour()); - Assertions.assertEquals(1391640173, model.peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.peakLoadBalancingAlgorithm()); - Assertions.assertEquals(583849936, model.rampDownStartTime().hour()); - Assertions.assertEquals(692695288, model.rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(311434030, model.rampDownMinimumHostsPct()); - Assertions.assertEquals(1290652027, model.rampDownCapacityThresholdPct()); - Assertions.assertEquals(false, model.rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.rampDownStopHostsWhen()); - Assertions.assertEquals(820009390, model.rampDownWaitTimeMinutes()); - Assertions.assertEquals("f", model.rampDownNotificationMessage()); - Assertions.assertEquals(568244971, model.offPeakStartTime().hour()); - Assertions.assertEquals(519560547, model.offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.offPeakLoadBalancingAlgorithm()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesCreateWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesCreateWithResponseMockTests.java deleted file mode 100644 index 251734b32360..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesCreateWithResponseMockTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedule; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; -import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; -import com.azure.resourcemanager.desktopvirtualization.models.Time; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ScalingPlanPooledSchedulesCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"daysOfWeek\":[\"Wednesday\",\"Saturday\"],\"rampUpStartTime\":{\"hour\":1894414352,\"minute\":1596880769},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":1600495341,\"rampUpCapacityThresholdPct\":1829685622,\"peakStartTime\":{\"hour\":179076410,\"minute\":20816690},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":1302013713,\"minute\":1486616410},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":517596277,\"rampDownCapacityThresholdPct\":1116825850,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":1688050054,\"rampDownNotificationMessage\":\"gnxkympqan\",\"offPeakStartTime\":{\"hour\":490513850,\"minute\":526112283},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},\"id\":\"wbtaoyp\",\"name\":\"yghs\",\"type\":\"xcy\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ScalingPlanPooledSchedule response = manager.scalingPlanPooledSchedules() - .define("ui") - .withExistingScalingPlan("yfqi", "gxhnpomyqwcabv") - .withDaysOfWeek(Arrays.asList(DayOfWeek.SATURDAY)) - .withRampUpStartTime(new Time().withHour(967163680).withMinute(1969142096)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(1591261256) - .withRampUpCapacityThresholdPct(1407391920) - .withPeakStartTime(new Time().withHour(732928958).withMinute(689377521)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(917013147).withMinute(230489139)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownMinimumHostsPct(1644377593) - .withRampDownCapacityThresholdPct(2037522133) - .withRampDownForceLogoffUsers(false) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) - .withRampDownWaitTimeMinutes(1630733068) - .withRampDownNotificationMessage("zmoaeds") - .withOffPeakStartTime(new Time().withHour(1606633619).withMinute(2101312168)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .create(); - - Assertions.assertEquals(DayOfWeek.WEDNESDAY, response.daysOfWeek().get(0)); - Assertions.assertEquals(1894414352, response.rampUpStartTime().hour()); - Assertions.assertEquals(1596880769, response.rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - response.rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(1600495341, response.rampUpMinimumHostsPct()); - Assertions.assertEquals(1829685622, response.rampUpCapacityThresholdPct()); - Assertions.assertEquals(179076410, response.peakStartTime().hour()); - Assertions.assertEquals(20816690, response.peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, response.peakLoadBalancingAlgorithm()); - Assertions.assertEquals(1302013713, response.rampDownStartTime().hour()); - Assertions.assertEquals(1486616410, response.rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - response.rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(517596277, response.rampDownMinimumHostsPct()); - Assertions.assertEquals(1116825850, response.rampDownCapacityThresholdPct()); - Assertions.assertEquals(true, response.rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, response.rampDownStopHostsWhen()); - Assertions.assertEquals(1688050054, response.rampDownWaitTimeMinutes()); - Assertions.assertEquals("gnxkympqan", response.rampDownNotificationMessage()); - Assertions.assertEquals(490513850, response.offPeakStartTime().hour()); - Assertions.assertEquals(526112283, response.offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - response.offPeakLoadBalancingAlgorithm()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesDeleteWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesDeleteWithResponseMockTests.java deleted file mode 100644 index 0d560f1a0a57..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ScalingPlanPooledSchedulesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.scalingPlanPooledSchedules() - .deleteWithResponse("iul", "gniiprglvaw", "wzdufypivlsbb", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesGetWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesGetWithResponseMockTests.java deleted file mode 100644 index f299cd2fe689..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesGetWithResponseMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedule; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; -import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ScalingPlanPooledSchedulesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"daysOfWeek\":[\"Wednesday\",\"Wednesday\"],\"rampUpStartTime\":{\"hour\":820394546,\"minute\":2117916425},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":420557504,\"rampUpCapacityThresholdPct\":1360307264,\"peakStartTime\":{\"hour\":521943782,\"minute\":630460158},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":296986917,\"minute\":1960012272},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":663204273,\"rampDownCapacityThresholdPct\":140049860,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":1179154127,\"rampDownNotificationMessage\":\"gqkctotiowlxte\",\"offPeakStartTime\":{\"hour\":1865610143,\"minute\":234322459},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},\"id\":\"dtguk\",\"name\":\"anblwphqlkccu\",\"type\":\"gygqwah\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ScalingPlanPooledSchedule response = manager.scalingPlanPooledSchedules() - .getWithResponse("ixkykxd", "sj", "emmucfxh", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(DayOfWeek.WEDNESDAY, response.daysOfWeek().get(0)); - Assertions.assertEquals(820394546, response.rampUpStartTime().hour()); - Assertions.assertEquals(2117916425, response.rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - response.rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(420557504, response.rampUpMinimumHostsPct()); - Assertions.assertEquals(1360307264, response.rampUpCapacityThresholdPct()); - Assertions.assertEquals(521943782, response.peakStartTime().hour()); - Assertions.assertEquals(630460158, response.peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, response.peakLoadBalancingAlgorithm()); - Assertions.assertEquals(296986917, response.rampDownStartTime().hour()); - Assertions.assertEquals(1960012272, response.rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - response.rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(663204273, response.rampDownMinimumHostsPct()); - Assertions.assertEquals(140049860, response.rampDownCapacityThresholdPct()); - Assertions.assertEquals(false, response.rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, response.rampDownStopHostsWhen()); - Assertions.assertEquals(1179154127, response.rampDownWaitTimeMinutes()); - Assertions.assertEquals("gqkctotiowlxte", response.rampDownNotificationMessage()); - Assertions.assertEquals(1865610143, response.offPeakStartTime().hour()); - Assertions.assertEquals(234322459, response.offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - response.offPeakLoadBalancingAlgorithm()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesListMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesListMockTests.java deleted file mode 100644 index 31117e249258..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesListMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedule; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; -import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ScalingPlanPooledSchedulesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"daysOfWeek\":[\"Wednesday\",\"Thursday\"],\"rampUpStartTime\":{\"hour\":702030035,\"minute\":1296918547},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":1647760135,\"rampUpCapacityThresholdPct\":259877172,\"peakStartTime\":{\"hour\":882727572,\"minute\":1158513524},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":685883648,\"minute\":218977704},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":1489611742,\"rampDownCapacityThresholdPct\":529091506,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":1170752971,\"rampDownNotificationMessage\":\"eihfq\",\"offPeakStartTime\":{\"hour\":1276446692,\"minute\":61409648},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},\"id\":\"zcxmjpbyep\",\"name\":\"mgtvlj\",\"type\":\"rc\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.scalingPlanPooledSchedules() - .list("pmcubkmifoxxkub", "phavpmhbrb", 1491297661, true, 215978587, com.azure.core.util.Context.NONE); - - Assertions.assertEquals(DayOfWeek.WEDNESDAY, response.iterator().next().daysOfWeek().get(0)); - Assertions.assertEquals(702030035, response.iterator().next().rampUpStartTime().hour()); - Assertions.assertEquals(1296918547, response.iterator().next().rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - response.iterator().next().rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(1647760135, response.iterator().next().rampUpMinimumHostsPct()); - Assertions.assertEquals(259877172, response.iterator().next().rampUpCapacityThresholdPct()); - Assertions.assertEquals(882727572, response.iterator().next().peakStartTime().hour()); - Assertions.assertEquals(1158513524, response.iterator().next().peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - response.iterator().next().peakLoadBalancingAlgorithm()); - Assertions.assertEquals(685883648, response.iterator().next().rampDownStartTime().hour()); - Assertions.assertEquals(218977704, response.iterator().next().rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - response.iterator().next().rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1489611742, response.iterator().next().rampDownMinimumHostsPct()); - Assertions.assertEquals(529091506, response.iterator().next().rampDownCapacityThresholdPct()); - Assertions.assertEquals(true, response.iterator().next().rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, response.iterator().next().rampDownStopHostsWhen()); - Assertions.assertEquals(1170752971, response.iterator().next().rampDownWaitTimeMinutes()); - Assertions.assertEquals("eihfq", response.iterator().next().rampDownNotificationMessage()); - Assertions.assertEquals(1276446692, response.iterator().next().offPeakStartTime().hour()); - Assertions.assertEquals(61409648, response.iterator().next().offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - response.iterator().next().offPeakLoadBalancingAlgorithm()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPropertiesTests.java deleted file mode 100644 index 29b4053f0f84..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPropertiesTests.java +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanProperties; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolReference; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolType; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingSchedule; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingScheduleDaysOfWeekItem; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; -import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; -import com.azure.resourcemanager.desktopvirtualization.models.Time; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScalingPlanPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScalingPlanProperties model = BinaryData.fromString( - "{\"objectId\":\"mjmwvvjektcx\",\"description\":\"nhwlrsffrzpwvl\",\"friendlyName\":\"q\",\"timeZone\":\"biqylihkaet\",\"hostPoolType\":\"Pooled\",\"exclusionTag\":\"fcivfsnkym\",\"schedules\":[{\"name\":\"hjfbebrjcxe\",\"daysOfWeek\":[\"Sunday\",\"Thursday\",\"Tuesday\",\"Thursday\"],\"rampUpStartTime\":{\"hour\":107980614,\"minute\":1379118334},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":871472535,\"rampUpCapacityThresholdPct\":380913381,\"peakStartTime\":{\"hour\":1236632858,\"minute\":468707866},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":536989913,\"minute\":1103023268},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":1195568358,\"rampDownCapacityThresholdPct\":573812586,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":1238878906,\"rampDownNotificationMessage\":\"ujqgidok\",\"offPeakStartTime\":{\"hour\":792619615,\"minute\":10143119},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},{\"name\":\"gvcl\",\"daysOfWeek\":[\"Thursday\",\"Wednesday\",\"Friday\"],\"rampUpStartTime\":{\"hour\":298785749,\"minute\":1435851366},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":331647248,\"rampUpCapacityThresholdPct\":991237131,\"peakStartTime\":{\"hour\":1537141479,\"minute\":1755265349},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":836032675,\"minute\":1589441162},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":615517918,\"rampDownCapacityThresholdPct\":1787736845,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":284383009,\"rampDownNotificationMessage\":\"ec\",\"offPeakStartTime\":{\"hour\":1266686553,\"minute\":1976417253},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},{\"name\":\"qkkrb\",\"daysOfWeek\":[\"Tuesday\",\"Saturday\"],\"rampUpStartTime\":{\"hour\":481409327,\"minute\":1233954324},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1233074363,\"rampUpCapacityThresholdPct\":595725350,\"peakStartTime\":{\"hour\":266686286,\"minute\":599393599},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":1526069036,\"minute\":1610498845},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":315992042,\"rampDownCapacityThresholdPct\":2071345899,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":318334591,\"rampDownNotificationMessage\":\"yydhibnuqqk\",\"offPeakStartTime\":{\"hour\":1850827957,\"minute\":35719444},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"}],\"hostPoolReferences\":[{\"hostPoolArmPath\":\"qagnbuyn\",\"scalingPlanEnabled\":true}]}") - .toObject(ScalingPlanProperties.class); - Assertions.assertEquals("nhwlrsffrzpwvl", model.description()); - Assertions.assertEquals("q", model.friendlyName()); - Assertions.assertEquals("biqylihkaet", model.timeZone()); - Assertions.assertEquals(ScalingHostPoolType.POOLED, model.hostPoolType()); - Assertions.assertEquals("fcivfsnkym", model.exclusionTag()); - Assertions.assertEquals("hjfbebrjcxe", model.schedules().get(0).name()); - Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.SUNDAY, model.schedules().get(0).daysOfWeek().get(0)); - Assertions.assertEquals(107980614, model.schedules().get(0).rampUpStartTime().hour()); - Assertions.assertEquals(1379118334, model.schedules().get(0).rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.schedules().get(0).rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(871472535, model.schedules().get(0).rampUpMinimumHostsPct()); - Assertions.assertEquals(380913381, model.schedules().get(0).rampUpCapacityThresholdPct()); - Assertions.assertEquals(1236632858, model.schedules().get(0).peakStartTime().hour()); - Assertions.assertEquals(468707866, model.schedules().get(0).peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.schedules().get(0).peakLoadBalancingAlgorithm()); - Assertions.assertEquals(536989913, model.schedules().get(0).rampDownStartTime().hour()); - Assertions.assertEquals(1103023268, model.schedules().get(0).rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1195568358, model.schedules().get(0).rampDownMinimumHostsPct()); - Assertions.assertEquals(573812586, model.schedules().get(0).rampDownCapacityThresholdPct()); - Assertions.assertEquals(false, model.schedules().get(0).rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.schedules().get(0).rampDownStopHostsWhen()); - Assertions.assertEquals(1238878906, model.schedules().get(0).rampDownWaitTimeMinutes()); - Assertions.assertEquals("ujqgidok", model.schedules().get(0).rampDownNotificationMessage()); - Assertions.assertEquals(792619615, model.schedules().get(0).offPeakStartTime().hour()); - Assertions.assertEquals(10143119, model.schedules().get(0).offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).offPeakLoadBalancingAlgorithm()); - Assertions.assertEquals("qagnbuyn", model.hostPoolReferences().get(0).hostPoolArmPath()); - Assertions.assertEquals(true, model.hostPoolReferences().get(0).scalingPlanEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScalingPlanProperties model = new ScalingPlanProperties().withDescription("nhwlrsffrzpwvl") - .withFriendlyName("q") - .withTimeZone("biqylihkaet") - .withHostPoolType(ScalingHostPoolType.POOLED) - .withExclusionTag("fcivfsnkym") - .withSchedules(Arrays.asList( - new ScalingSchedule().withName("hjfbebrjcxe") - .withDaysOfWeek( - Arrays.asList(ScalingScheduleDaysOfWeekItem.SUNDAY, ScalingScheduleDaysOfWeekItem.THURSDAY, - ScalingScheduleDaysOfWeekItem.TUESDAY, ScalingScheduleDaysOfWeekItem.THURSDAY)) - .withRampUpStartTime(new Time().withHour(107980614).withMinute(1379118334)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(871472535) - .withRampUpCapacityThresholdPct(380913381) - .withPeakStartTime(new Time().withHour(1236632858).withMinute(468707866)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownStartTime(new Time().withHour(536989913).withMinute(1103023268)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownMinimumHostsPct(1195568358) - .withRampDownCapacityThresholdPct(573812586) - .withRampDownForceLogoffUsers(false) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) - .withRampDownWaitTimeMinutes(1238878906) - .withRampDownNotificationMessage("ujqgidok") - .withOffPeakStartTime(new Time().withHour(792619615).withMinute(10143119)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST), - new ScalingSchedule().withName("gvcl") - .withDaysOfWeek(Arrays.asList(ScalingScheduleDaysOfWeekItem.THURSDAY, - ScalingScheduleDaysOfWeekItem.WEDNESDAY, ScalingScheduleDaysOfWeekItem.FRIDAY)) - .withRampUpStartTime(new Time().withHour(298785749).withMinute(1435851366)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampUpMinimumHostsPct(331647248) - .withRampUpCapacityThresholdPct(991237131) - .withPeakStartTime(new Time().withHour(1537141479).withMinute(1755265349)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(836032675).withMinute(1589441162)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownMinimumHostsPct(615517918) - .withRampDownCapacityThresholdPct(1787736845) - .withRampDownForceLogoffUsers(true) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) - .withRampDownWaitTimeMinutes(284383009) - .withRampDownNotificationMessage("ec") - .withOffPeakStartTime(new Time().withHour(1266686553).withMinute(1976417253)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST), - new ScalingSchedule().withName("qkkrb") - .withDaysOfWeek( - Arrays.asList(ScalingScheduleDaysOfWeekItem.TUESDAY, ScalingScheduleDaysOfWeekItem.SATURDAY)) - .withRampUpStartTime(new Time().withHour(481409327).withMinute(1233954324)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(1233074363) - .withRampUpCapacityThresholdPct(595725350) - .withPeakStartTime(new Time().withHour(266686286).withMinute(599393599)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(1526069036).withMinute(1610498845)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownMinimumHostsPct(315992042) - .withRampDownCapacityThresholdPct(2071345899) - .withRampDownForceLogoffUsers(true) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) - .withRampDownWaitTimeMinutes(318334591) - .withRampDownNotificationMessage("yydhibnuqqk") - .withOffPeakStartTime(new Time().withHour(1850827957).withMinute(35719444)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST))) - .withHostPoolReferences(Arrays - .asList(new ScalingHostPoolReference().withHostPoolArmPath("qagnbuyn").withScalingPlanEnabled(true))); - model = BinaryData.fromObject(model).toObject(ScalingPlanProperties.class); - Assertions.assertEquals("nhwlrsffrzpwvl", model.description()); - Assertions.assertEquals("q", model.friendlyName()); - Assertions.assertEquals("biqylihkaet", model.timeZone()); - Assertions.assertEquals(ScalingHostPoolType.POOLED, model.hostPoolType()); - Assertions.assertEquals("fcivfsnkym", model.exclusionTag()); - Assertions.assertEquals("hjfbebrjcxe", model.schedules().get(0).name()); - Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.SUNDAY, model.schedules().get(0).daysOfWeek().get(0)); - Assertions.assertEquals(107980614, model.schedules().get(0).rampUpStartTime().hour()); - Assertions.assertEquals(1379118334, model.schedules().get(0).rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.schedules().get(0).rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(871472535, model.schedules().get(0).rampUpMinimumHostsPct()); - Assertions.assertEquals(380913381, model.schedules().get(0).rampUpCapacityThresholdPct()); - Assertions.assertEquals(1236632858, model.schedules().get(0).peakStartTime().hour()); - Assertions.assertEquals(468707866, model.schedules().get(0).peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.schedules().get(0).peakLoadBalancingAlgorithm()); - Assertions.assertEquals(536989913, model.schedules().get(0).rampDownStartTime().hour()); - Assertions.assertEquals(1103023268, model.schedules().get(0).rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1195568358, model.schedules().get(0).rampDownMinimumHostsPct()); - Assertions.assertEquals(573812586, model.schedules().get(0).rampDownCapacityThresholdPct()); - Assertions.assertEquals(false, model.schedules().get(0).rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.schedules().get(0).rampDownStopHostsWhen()); - Assertions.assertEquals(1238878906, model.schedules().get(0).rampDownWaitTimeMinutes()); - Assertions.assertEquals("ujqgidok", model.schedules().get(0).rampDownNotificationMessage()); - Assertions.assertEquals(792619615, model.schedules().get(0).offPeakStartTime().hour()); - Assertions.assertEquals(10143119, model.schedules().get(0).offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).offPeakLoadBalancingAlgorithm()); - Assertions.assertEquals("qagnbuyn", model.hostPoolReferences().get(0).hostPoolArmPath()); - Assertions.assertEquals(true, model.hostPoolReferences().get(0).scalingPlanEnabled()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansDeleteByResourceGroupWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index e0041f4c6d76..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ScalingPlansDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.scalingPlans().deleteByResourceGroupWithResponse("op", "hbzxli", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingScheduleTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingScheduleTests.java deleted file mode 100644 index b55240c79fcf..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingScheduleTests.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingSchedule; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingScheduleDaysOfWeekItem; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; -import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; -import com.azure.resourcemanager.desktopvirtualization.models.Time; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScalingScheduleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScalingSchedule model = BinaryData.fromString( - "{\"name\":\"gmebfsiarbutrcv\",\"daysOfWeek\":[\"Wednesday\",\"Thursday\",\"Wednesday\",\"Saturday\"],\"rampUpStartTime\":{\"hour\":1159658467,\"minute\":2024670267},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":840461055,\"rampUpCapacityThresholdPct\":18555434,\"peakStartTime\":{\"hour\":480744947,\"minute\":1899471786},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":79339755,\"minute\":1474388654},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":1850668583,\"rampDownCapacityThresholdPct\":1795094625,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":1074926668,\"rampDownNotificationMessage\":\"tkcxywnytnrsy\",\"offPeakStartTime\":{\"hour\":1857239406,\"minute\":123803740},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"}") - .toObject(ScalingSchedule.class); - Assertions.assertEquals("gmebfsiarbutrcv", model.name()); - Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.WEDNESDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(1159658467, model.rampUpStartTime().hour()); - Assertions.assertEquals(2024670267, model.rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(840461055, model.rampUpMinimumHostsPct()); - Assertions.assertEquals(18555434, model.rampUpCapacityThresholdPct()); - Assertions.assertEquals(480744947, model.peakStartTime().hour()); - Assertions.assertEquals(1899471786, model.peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.peakLoadBalancingAlgorithm()); - Assertions.assertEquals(79339755, model.rampDownStartTime().hour()); - Assertions.assertEquals(1474388654, model.rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1850668583, model.rampDownMinimumHostsPct()); - Assertions.assertEquals(1795094625, model.rampDownCapacityThresholdPct()); - Assertions.assertEquals(false, model.rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.rampDownStopHostsWhen()); - Assertions.assertEquals(1074926668, model.rampDownWaitTimeMinutes()); - Assertions.assertEquals("tkcxywnytnrsy", model.rampDownNotificationMessage()); - Assertions.assertEquals(1857239406, model.offPeakStartTime().hour()); - Assertions.assertEquals(123803740, model.offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.offPeakLoadBalancingAlgorithm()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScalingSchedule model = new ScalingSchedule().withName("gmebfsiarbutrcv") - .withDaysOfWeek( - Arrays.asList(ScalingScheduleDaysOfWeekItem.WEDNESDAY, ScalingScheduleDaysOfWeekItem.THURSDAY, - ScalingScheduleDaysOfWeekItem.WEDNESDAY, ScalingScheduleDaysOfWeekItem.SATURDAY)) - .withRampUpStartTime(new Time().withHour(1159658467).withMinute(2024670267)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(840461055) - .withRampUpCapacityThresholdPct(18555434) - .withPeakStartTime(new Time().withHour(480744947).withMinute(1899471786)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownStartTime(new Time().withHour(79339755).withMinute(1474388654)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownMinimumHostsPct(1850668583) - .withRampDownCapacityThresholdPct(1795094625) - .withRampDownForceLogoffUsers(false) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) - .withRampDownWaitTimeMinutes(1074926668) - .withRampDownNotificationMessage("tkcxywnytnrsy") - .withOffPeakStartTime(new Time().withHour(1857239406).withMinute(123803740)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST); - model = BinaryData.fromObject(model).toObject(ScalingSchedule.class); - Assertions.assertEquals("gmebfsiarbutrcv", model.name()); - Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.WEDNESDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(1159658467, model.rampUpStartTime().hour()); - Assertions.assertEquals(2024670267, model.rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(840461055, model.rampUpMinimumHostsPct()); - Assertions.assertEquals(18555434, model.rampUpCapacityThresholdPct()); - Assertions.assertEquals(480744947, model.peakStartTime().hour()); - Assertions.assertEquals(1899471786, model.peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.peakLoadBalancingAlgorithm()); - Assertions.assertEquals(79339755, model.rampDownStartTime().hour()); - Assertions.assertEquals(1474388654, model.rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1850668583, model.rampDownMinimumHostsPct()); - Assertions.assertEquals(1795094625, model.rampDownCapacityThresholdPct()); - Assertions.assertEquals(false, model.rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.rampDownStopHostsWhen()); - Assertions.assertEquals(1074926668, model.rampDownWaitTimeMinutes()); - Assertions.assertEquals("tkcxywnytnrsy", model.rampDownNotificationMessage()); - Assertions.assertEquals(1857239406, model.offPeakStartTime().hour()); - Assertions.assertEquals(123803740, model.offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.offPeakLoadBalancingAlgorithm()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SendMessageTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SendMessageTests.java deleted file mode 100644 index 369ac59ab138..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SendMessageTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.SendMessage; -import org.junit.jupiter.api.Assertions; - -public final class SendMessageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SendMessage model = BinaryData.fromString("{\"messageTitle\":\"zrxcczurt\",\"messageBody\":\"ipqxbkwvzgnzv\"}") - .toObject(SendMessage.class); - Assertions.assertEquals("zrxcczurt", model.messageTitle()); - Assertions.assertEquals("ipqxbkwvzgnzv", model.messageBody()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SendMessage model = new SendMessage().withMessageTitle("zrxcczurt").withMessageBody("ipqxbkwvzgnzv"); - model = BinaryData.fromObject(model).toObject(SendMessage.class); - Assertions.assertEquals("zrxcczurt", model.messageTitle()); - Assertions.assertEquals("ipqxbkwvzgnzv", model.messageBody()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ServiceSpecificationTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ServiceSpecificationTests.java deleted file mode 100644 index b4ab4b2bd41d..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ServiceSpecificationTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.LogSpecification; -import com.azure.resourcemanager.desktopvirtualization.models.ServiceSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServiceSpecificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceSpecification model = BinaryData.fromString( - "{\"logSpecifications\":[{\"name\":\"qniwbybrkxvdumj\",\"displayName\":\"tfwvukxgaudc\",\"blobDuration\":\"nhsjcnyej\"}]}") - .toObject(ServiceSpecification.class); - Assertions.assertEquals("qniwbybrkxvdumj", model.logSpecifications().get(0).name()); - Assertions.assertEquals("tfwvukxgaudc", model.logSpecifications().get(0).displayName()); - Assertions.assertEquals("nhsjcnyej", model.logSpecifications().get(0).blobDuration()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceSpecification model = new ServiceSpecification() - .withLogSpecifications(Arrays.asList(new LogSpecification().withName("qniwbybrkxvdumj") - .withDisplayName("tfwvukxgaudc") - .withBlobDuration("nhsjcnyej"))); - model = BinaryData.fromObject(model).toObject(ServiceSpecification.class); - Assertions.assertEquals("qniwbybrkxvdumj", model.logSpecifications().get(0).name()); - Assertions.assertEquals("tfwvukxgaudc", model.logSpecifications().get(0).displayName()); - Assertions.assertEquals("nhsjcnyej", model.logSpecifications().get(0).blobDuration()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostListTests.java deleted file mode 100644 index 3e96a4977cc6..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostListTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostInner; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostList; -import com.azure.resourcemanager.desktopvirtualization.models.Status; -import com.azure.resourcemanager.desktopvirtualization.models.UpdateState; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SessionHostListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SessionHostList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"objectId\":\"tpwijnh\",\"lastHeartBeat\":\"2021-01-19T12:23:33Z\",\"sessions\":3385554,\"agentVersion\":\"cxzbfvoowvr\",\"allowNewSession\":false,\"virtualMachineId\":\"jqppyostronzmy\",\"resourceId\":\"fipns\",\"assignedUser\":\"mcwaekrrjr\",\"friendlyName\":\"fxtsgum\",\"status\":\"NotJoinedToDomain\",\"statusTimestamp\":\"2021-02-02T04:40:45Z\",\"osVersion\":\"kxw\",\"sxSStackVersion\":\"olbq\",\"updateState\":\"Pending\",\"lastUpdateTime\":\"2021-11-30T16:53:07Z\",\"updateErrorMessage\":\"vfelfktgplcrpwj\",\"sessionHostHealthCheckResults\":[{\"healthCheckName\":\"MonitoringAgentCheck\",\"healthCheckResult\":\"Unknown\",\"additionalFailureDetails\":{}},{\"healthCheckName\":\"UrlsAccessibleCheck\",\"healthCheckResult\":\"Unknown\",\"additionalFailureDetails\":{}}]},\"id\":\"kpnb\",\"name\":\"azej\",\"type\":\"oqkag\"},{\"properties\":{\"objectId\":\"xttaugzxnfaaz\",\"lastHeartBeat\":\"2021-02-27T11:39:37Z\",\"sessions\":159219307,\"agentVersion\":\"dm\",\"allowNewSession\":false,\"virtualMachineId\":\"lwuenvrkp\",\"resourceId\":\"uaibrebqaaysj\",\"assignedUser\":\"xqtnq\",\"friendlyName\":\"ezl\",\"status\":\"SxSStackListenerNotReady\",\"statusTimestamp\":\"2021-09-28T01:26:01Z\",\"osVersion\":\"kpj\",\"sxSStackVersion\":\"qmt\",\"updateState\":\"Pending\",\"lastUpdateTime\":\"2021-09-01T21:15:43Z\",\"updateErrorMessage\":\"jihy\",\"sessionHostHealthCheckResults\":[{\"healthCheckName\":\"SupportedEncryptionCheck\",\"healthCheckResult\":\"Unknown\",\"additionalFailureDetails\":{}}]},\"id\":\"y\",\"name\":\"ncyg\",\"type\":\"p\"},{\"properties\":{\"objectId\":\"p\",\"lastHeartBeat\":\"2021-05-01T10:24:09Z\",\"sessions\":497556076,\"agentVersion\":\"qupevzh\",\"allowNewSession\":true,\"virtualMachineId\":\"txhojujb\",\"resourceId\":\"elmcuvhixbjxyfw\",\"assignedUser\":\"lrcoolsttpki\",\"friendlyName\":\"kbnujr\",\"status\":\"FSLogixNotHealthy\",\"statusTimestamp\":\"2021-06-06T05:18:15Z\",\"osVersion\":\"bfpncurdo\",\"sxSStackVersion\":\"iithtywu\",\"updateState\":\"Initial\",\"lastUpdateTime\":\"2021-01-21T06:01:17Z\",\"updateErrorMessage\":\"wqknfdn\",\"sessionHostHealthCheckResults\":[{\"healthCheckName\":\"DomainTrustCheck\",\"healthCheckResult\":\"SessionHostShutdown\",\"additionalFailureDetails\":{}},{\"healthCheckName\":\"UrlsAccessibleCheck\",\"healthCheckResult\":\"Unknown\",\"additionalFailureDetails\":{}},{\"healthCheckName\":\"UrlsAccessibleCheck\",\"healthCheckResult\":\"Unknown\",\"additionalFailureDetails\":{}},{\"healthCheckName\":\"MonitoringAgentCheck\",\"healthCheckResult\":\"Unknown\",\"additionalFailureDetails\":{}}]},\"id\":\"udfdlwgg\",\"name\":\"tsbwtovvtgse\",\"type\":\"nqfiufxqknpi\"}],\"nextLink\":\"nepttwqmsni\"}") - .toObject(SessionHostList.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-19T12:23:33Z"), model.value().get(0).lastHeartBeat()); - Assertions.assertEquals(3385554, model.value().get(0).sessions()); - Assertions.assertEquals("cxzbfvoowvr", model.value().get(0).agentVersion()); - Assertions.assertEquals(false, model.value().get(0).allowNewSession()); - Assertions.assertEquals("mcwaekrrjr", model.value().get(0).assignedUser()); - Assertions.assertEquals("fxtsgum", model.value().get(0).friendlyName()); - Assertions.assertEquals(Status.NOT_JOINED_TO_DOMAIN, model.value().get(0).status()); - Assertions.assertEquals("kxw", model.value().get(0).osVersion()); - Assertions.assertEquals("olbq", model.value().get(0).sxSStackVersion()); - Assertions.assertEquals(UpdateState.PENDING, model.value().get(0).updateState()); - Assertions.assertEquals("vfelfktgplcrpwj", model.value().get(0).updateErrorMessage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SessionHostList model = new SessionHostList().withValue(Arrays.asList( - new SessionHostInner().withLastHeartBeat(OffsetDateTime.parse("2021-01-19T12:23:33Z")) - .withSessions(3385554) - .withAgentVersion("cxzbfvoowvr") - .withAllowNewSession(false) - .withAssignedUser("mcwaekrrjr") - .withFriendlyName("fxtsgum") - .withStatus(Status.NOT_JOINED_TO_DOMAIN) - .withOsVersion("kxw") - .withSxSStackVersion("olbq") - .withUpdateState(UpdateState.PENDING) - .withUpdateErrorMessage("vfelfktgplcrpwj"), - new SessionHostInner().withLastHeartBeat(OffsetDateTime.parse("2021-02-27T11:39:37Z")) - .withSessions(159219307) - .withAgentVersion("dm") - .withAllowNewSession(false) - .withAssignedUser("xqtnq") - .withFriendlyName("ezl") - .withStatus(Status.SX_SSTACK_LISTENER_NOT_READY) - .withOsVersion("kpj") - .withSxSStackVersion("qmt") - .withUpdateState(UpdateState.PENDING) - .withUpdateErrorMessage("jihy"), - new SessionHostInner().withLastHeartBeat(OffsetDateTime.parse("2021-05-01T10:24:09Z")) - .withSessions(497556076) - .withAgentVersion("qupevzh") - .withAllowNewSession(true) - .withAssignedUser("lrcoolsttpki") - .withFriendlyName("kbnujr") - .withStatus(Status.FSLOGIX_NOT_HEALTHY) - .withOsVersion("bfpncurdo") - .withSxSStackVersion("iithtywu") - .withUpdateState(UpdateState.INITIAL) - .withUpdateErrorMessage("wqknfdn"))); - model = BinaryData.fromObject(model).toObject(SessionHostList.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-19T12:23:33Z"), model.value().get(0).lastHeartBeat()); - Assertions.assertEquals(3385554, model.value().get(0).sessions()); - Assertions.assertEquals("cxzbfvoowvr", model.value().get(0).agentVersion()); - Assertions.assertEquals(false, model.value().get(0).allowNewSession()); - Assertions.assertEquals("mcwaekrrjr", model.value().get(0).assignedUser()); - Assertions.assertEquals("fxtsgum", model.value().get(0).friendlyName()); - Assertions.assertEquals(Status.NOT_JOINED_TO_DOMAIN, model.value().get(0).status()); - Assertions.assertEquals("kxw", model.value().get(0).osVersion()); - Assertions.assertEquals("olbq", model.value().get(0).sxSStackVersion()); - Assertions.assertEquals(UpdateState.PENDING, model.value().get(0).updateState()); - Assertions.assertEquals("vfelfktgplcrpwj", model.value().get(0).updateErrorMessage()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostPatchPropertiesTests.java deleted file mode 100644 index 98409aff3d61..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostPatchPropertiesTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostPatchProperties; -import org.junit.jupiter.api.Assertions; - -public final class SessionHostPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SessionHostPatchProperties model = BinaryData - .fromString("{\"allowNewSession\":true,\"assignedUser\":\"ccbdre\",\"friendlyName\":\"hcexdrrvqa\"}") - .toObject(SessionHostPatchProperties.class); - Assertions.assertEquals(true, model.allowNewSession()); - Assertions.assertEquals("ccbdre", model.assignedUser()); - Assertions.assertEquals("hcexdrrvqa", model.friendlyName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SessionHostPatchProperties model = new SessionHostPatchProperties().withAllowNewSession(true) - .withAssignedUser("ccbdre") - .withFriendlyName("hcexdrrvqa"); - model = BinaryData.fromObject(model).toObject(SessionHostPatchProperties.class); - Assertions.assertEquals(true, model.allowNewSession()); - Assertions.assertEquals("ccbdre", model.assignedUser()); - Assertions.assertEquals("hcexdrrvqa", model.friendlyName()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostPatchTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostPatchTests.java deleted file mode 100644 index b5bc491b016a..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostPatchTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatch; -import org.junit.jupiter.api.Assertions; - -public final class SessionHostPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SessionHostPatch model = BinaryData.fromString( - "{\"properties\":{\"allowNewSession\":false,\"assignedUser\":\"zfbn\",\"friendlyName\":\"mctlpdngitv\"},\"id\":\"mhrixkwmyijejve\",\"name\":\"rh\",\"type\":\"pna\"}") - .toObject(SessionHostPatch.class); - Assertions.assertEquals(false, model.allowNewSession()); - Assertions.assertEquals("zfbn", model.assignedUser()); - Assertions.assertEquals("mctlpdngitv", model.friendlyName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SessionHostPatch model = new SessionHostPatch().withAllowNewSession(false) - .withAssignedUser("zfbn") - .withFriendlyName("mctlpdngitv"); - model = BinaryData.fromObject(model).toObject(SessionHostPatch.class); - Assertions.assertEquals(false, model.allowNewSession()); - Assertions.assertEquals("zfbn", model.assignedUser()); - Assertions.assertEquals("mctlpdngitv", model.friendlyName()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsDeleteWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsDeleteWithResponseMockTests.java deleted file mode 100644 index 2a0686386954..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SessionHostsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.sessionHosts() - .deleteWithResponse("tbdrvcqgue", "zhomp", "eqdurelyujlfyoum", true, com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SkuTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SkuTests.java deleted file mode 100644 index f961df827faa..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SkuTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.Sku; -import com.azure.resourcemanager.desktopvirtualization.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class SkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Sku model = BinaryData.fromString( - "{\"name\":\"jxvsnbyxqabn\",\"tier\":\"Free\",\"size\":\"cyshurzafbljjgp\",\"family\":\"oq\",\"capacity\":1736666223}") - .toObject(Sku.class); - Assertions.assertEquals("jxvsnbyxqabn", model.name()); - Assertions.assertEquals(SkuTier.FREE, model.tier()); - Assertions.assertEquals("cyshurzafbljjgp", model.size()); - Assertions.assertEquals("oq", model.family()); - Assertions.assertEquals(1736666223, model.capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Sku model = new Sku().withName("jxvsnbyxqabn") - .withTier(SkuTier.FREE) - .withSize("cyshurzafbljjgp") - .withFamily("oq") - .withCapacity(1736666223); - model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals("jxvsnbyxqabn", model.name()); - Assertions.assertEquals(SkuTier.FREE, model.tier()); - Assertions.assertEquals("cyshurzafbljjgp", model.size()); - Assertions.assertEquals("oq", model.family()); - Assertions.assertEquals(1736666223, model.capacity()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemInnerTests.java deleted file mode 100644 index 52eb0b87a392..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemInnerTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.StartMenuItemInner; -import org.junit.jupiter.api.Assertions; - -public final class StartMenuItemInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StartMenuItemInner model = BinaryData.fromString( - "{\"properties\":{\"appAlias\":\"lqiyntorzihl\",\"filePath\":\"sjswsrms\",\"commandLineArguments\":\"zrpzb\",\"iconPath\":\"ckqqzqioxiysui\",\"iconIndex\":2121235922},\"id\":\"ked\",\"name\":\"atrwyhqmibzyh\",\"type\":\"itsmypyyn\"}") - .toObject(StartMenuItemInner.class); - Assertions.assertEquals("lqiyntorzihl", model.appAlias()); - Assertions.assertEquals("sjswsrms", model.filePath()); - Assertions.assertEquals("zrpzb", model.commandLineArguments()); - Assertions.assertEquals("ckqqzqioxiysui", model.iconPath()); - Assertions.assertEquals(2121235922, model.iconIndex()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StartMenuItemInner model = new StartMenuItemInner().withAppAlias("lqiyntorzihl") - .withFilePath("sjswsrms") - .withCommandLineArguments("zrpzb") - .withIconPath("ckqqzqioxiysui") - .withIconIndex(2121235922); - model = BinaryData.fromObject(model).toObject(StartMenuItemInner.class); - Assertions.assertEquals("lqiyntorzihl", model.appAlias()); - Assertions.assertEquals("sjswsrms", model.filePath()); - Assertions.assertEquals("zrpzb", model.commandLineArguments()); - Assertions.assertEquals("ckqqzqioxiysui", model.iconPath()); - Assertions.assertEquals(2121235922, model.iconIndex()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemListTests.java deleted file mode 100644 index 82997f6c189d..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemListTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.StartMenuItemInner; -import com.azure.resourcemanager.desktopvirtualization.models.StartMenuItemList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class StartMenuItemListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StartMenuItemList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"appAlias\":\"ndsytgadg\",\"filePath\":\"aeaeneqnzarrw\",\"commandLineArguments\":\"uu\",\"iconPath\":\"fqka\",\"iconIndex\":1905366329},\"id\":\"ipfpubji\",\"name\":\"wwiftohqkvpuv\",\"type\":\"sgplsakn\"}],\"nextLink\":\"fsynljphuop\"}") - .toObject(StartMenuItemList.class); - Assertions.assertEquals("ndsytgadg", model.value().get(0).appAlias()); - Assertions.assertEquals("aeaeneqnzarrw", model.value().get(0).filePath()); - Assertions.assertEquals("uu", model.value().get(0).commandLineArguments()); - Assertions.assertEquals("fqka", model.value().get(0).iconPath()); - Assertions.assertEquals(1905366329, model.value().get(0).iconIndex()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StartMenuItemList model - = new StartMenuItemList().withValue(Arrays.asList(new StartMenuItemInner().withAppAlias("ndsytgadg") - .withFilePath("aeaeneqnzarrw") - .withCommandLineArguments("uu") - .withIconPath("fqka") - .withIconIndex(1905366329))); - model = BinaryData.fromObject(model).toObject(StartMenuItemList.class); - Assertions.assertEquals("ndsytgadg", model.value().get(0).appAlias()); - Assertions.assertEquals("aeaeneqnzarrw", model.value().get(0).filePath()); - Assertions.assertEquals("uu", model.value().get(0).commandLineArguments()); - Assertions.assertEquals("fqka", model.value().get(0).iconPath()); - Assertions.assertEquals(1905366329, model.value().get(0).iconIndex()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemPropertiesTests.java deleted file mode 100644 index c4d1c22cb8c6..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemPropertiesTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.StartMenuItemProperties; -import org.junit.jupiter.api.Assertions; - -public final class StartMenuItemPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StartMenuItemProperties model = BinaryData.fromString( - "{\"appAlias\":\"dpumnzgmw\",\"filePath\":\"mabiknsorgjhxb\",\"commandLineArguments\":\"tlwwrlk\",\"iconPath\":\"tncvokot\",\"iconIndex\":643963707}") - .toObject(StartMenuItemProperties.class); - Assertions.assertEquals("dpumnzgmw", model.appAlias()); - Assertions.assertEquals("mabiknsorgjhxb", model.filePath()); - Assertions.assertEquals("tlwwrlk", model.commandLineArguments()); - Assertions.assertEquals("tncvokot", model.iconPath()); - Assertions.assertEquals(643963707, model.iconIndex()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StartMenuItemProperties model = new StartMenuItemProperties().withAppAlias("dpumnzgmw") - .withFilePath("mabiknsorgjhxb") - .withCommandLineArguments("tlwwrlk") - .withIconPath("tncvokot") - .withIconIndex(643963707); - model = BinaryData.fromObject(model).toObject(StartMenuItemProperties.class); - Assertions.assertEquals("dpumnzgmw", model.appAlias()); - Assertions.assertEquals("mabiknsorgjhxb", model.filePath()); - Assertions.assertEquals("tlwwrlk", model.commandLineArguments()); - Assertions.assertEquals("tncvokot", model.iconPath()); - Assertions.assertEquals(643963707, model.iconIndex()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemsListMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemsListMockTests.java deleted file mode 100644 index 6174a5ba6f7e..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemsListMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.StartMenuItem; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class StartMenuItemsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"appAlias\":\"gvttx\",\"filePath\":\"rupzaamrdixtre\",\"commandLineArguments\":\"dswys\",\"iconPath\":\"ruffgllukk\",\"iconIndex\":1275101011},\"id\":\"xhrp\",\"name\":\"hvmblcouqehbhbc\",\"type\":\"sziryrandoyp\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.startMenuItems() - .list("fkak", "oldtvevboclzhz", 909885231, false, 1517914791, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("gvttx", response.iterator().next().appAlias()); - Assertions.assertEquals("rupzaamrdixtre", response.iterator().next().filePath()); - Assertions.assertEquals("dswys", response.iterator().next().commandLineArguments()); - Assertions.assertEquals("ruffgllukk", response.iterator().next().iconPath()); - Assertions.assertEquals(1275101011, response.iterator().next().iconIndex()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/TimeTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/TimeTests.java deleted file mode 100644 index 7cf40600078d..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/TimeTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.Time; -import org.junit.jupiter.api.Assertions; - -public final class TimeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Time model = BinaryData.fromString("{\"hour\":525052628,\"minute\":2063322926}").toObject(Time.class); - Assertions.assertEquals(525052628, model.hour()); - Assertions.assertEquals(2063322926, model.minute()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Time model = new Time().withHour(525052628).withMinute(2063322926); - model = BinaryData.fromObject(model).toObject(Time.class); - Assertions.assertEquals(525052628, model.hour()); - Assertions.assertEquals(2063322926, model.minute()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionInnerTests.java deleted file mode 100644 index d13430e25a2c..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionInnerTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.UserSessionInner; -import com.azure.resourcemanager.desktopvirtualization.models.ApplicationType; -import com.azure.resourcemanager.desktopvirtualization.models.SessionState; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class UserSessionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserSessionInner model = BinaryData.fromString( - "{\"properties\":{\"objectId\":\"nalghfkvtvsexso\",\"userPrincipalName\":\"el\",\"applicationType\":\"Desktop\",\"sessionState\":\"Pending\",\"activeDirectoryUserName\":\"hxvrhmzkwpjg\",\"createTime\":\"2021-10-11T18:28:46Z\"},\"id\":\"ughftqsx\",\"name\":\"qxujxukndxd\",\"type\":\"grjguufzd\"}") - .toObject(UserSessionInner.class); - Assertions.assertEquals("el", model.userPrincipalName()); - Assertions.assertEquals(ApplicationType.DESKTOP, model.applicationType()); - Assertions.assertEquals(SessionState.PENDING, model.sessionState()); - Assertions.assertEquals("hxvrhmzkwpjg", model.activeDirectoryUsername()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-11T18:28:46Z"), model.createTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserSessionInner model = new UserSessionInner().withUserPrincipalName("el") - .withApplicationType(ApplicationType.DESKTOP) - .withSessionState(SessionState.PENDING) - .withActiveDirectoryUsername("hxvrhmzkwpjg") - .withCreateTime(OffsetDateTime.parse("2021-10-11T18:28:46Z")); - model = BinaryData.fromObject(model).toObject(UserSessionInner.class); - Assertions.assertEquals("el", model.userPrincipalName()); - Assertions.assertEquals(ApplicationType.DESKTOP, model.applicationType()); - Assertions.assertEquals(SessionState.PENDING, model.sessionState()); - Assertions.assertEquals("hxvrhmzkwpjg", model.activeDirectoryUsername()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-11T18:28:46Z"), model.createTime()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionListTests.java deleted file mode 100644 index 4c1477565b7f..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionListTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.UserSessionInner; -import com.azure.resourcemanager.desktopvirtualization.models.ApplicationType; -import com.azure.resourcemanager.desktopvirtualization.models.SessionState; -import com.azure.resourcemanager.desktopvirtualization.models.UserSessionList; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UserSessionListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserSessionList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"objectId\":\"cirgzp\",\"userPrincipalName\":\"lazszrn\",\"applicationType\":\"RemoteApp\",\"sessionState\":\"Unknown\",\"activeDirectoryUserName\":\"fpwpjylwbt\",\"createTime\":\"2021-03-02T06:04:37Z\"},\"id\":\"sj\",\"name\":\"dhszfjv\",\"type\":\"bgofeljag\"}],\"nextLink\":\"mqhldvrii\"}") - .toObject(UserSessionList.class); - Assertions.assertEquals("lazszrn", model.value().get(0).userPrincipalName()); - Assertions.assertEquals(ApplicationType.REMOTE_APP, model.value().get(0).applicationType()); - Assertions.assertEquals(SessionState.UNKNOWN, model.value().get(0).sessionState()); - Assertions.assertEquals("fpwpjylwbt", model.value().get(0).activeDirectoryUsername()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-02T06:04:37Z"), model.value().get(0).createTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserSessionList model - = new UserSessionList().withValue(Arrays.asList(new UserSessionInner().withUserPrincipalName("lazszrn") - .withApplicationType(ApplicationType.REMOTE_APP) - .withSessionState(SessionState.UNKNOWN) - .withActiveDirectoryUsername("fpwpjylwbt") - .withCreateTime(OffsetDateTime.parse("2021-03-02T06:04:37Z")))); - model = BinaryData.fromObject(model).toObject(UserSessionList.class); - Assertions.assertEquals("lazszrn", model.value().get(0).userPrincipalName()); - Assertions.assertEquals(ApplicationType.REMOTE_APP, model.value().get(0).applicationType()); - Assertions.assertEquals(SessionState.UNKNOWN, model.value().get(0).sessionState()); - Assertions.assertEquals("fpwpjylwbt", model.value().get(0).activeDirectoryUsername()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-02T06:04:37Z"), model.value().get(0).createTime()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionPropertiesTests.java deleted file mode 100644 index 38088db99efe..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionPropertiesTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.UserSessionProperties; -import com.azure.resourcemanager.desktopvirtualization.models.ApplicationType; -import com.azure.resourcemanager.desktopvirtualization.models.SessionState; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class UserSessionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserSessionProperties model = BinaryData.fromString( - "{\"objectId\":\"yqtfihwh\",\"userPrincipalName\":\"tzingamvpph\",\"applicationType\":\"RemoteApp\",\"sessionState\":\"LogOff\",\"activeDirectoryUserName\":\"dphqamv\",\"createTime\":\"2021-02-05T20:02:56Z\"}") - .toObject(UserSessionProperties.class); - Assertions.assertEquals("tzingamvpph", model.userPrincipalName()); - Assertions.assertEquals(ApplicationType.REMOTE_APP, model.applicationType()); - Assertions.assertEquals(SessionState.LOG_OFF, model.sessionState()); - Assertions.assertEquals("dphqamv", model.activeDirectoryUsername()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-05T20:02:56Z"), model.createTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserSessionProperties model = new UserSessionProperties().withUserPrincipalName("tzingamvpph") - .withApplicationType(ApplicationType.REMOTE_APP) - .withSessionState(SessionState.LOG_OFF) - .withActiveDirectoryUsername("dphqamv") - .withCreateTime(OffsetDateTime.parse("2021-02-05T20:02:56Z")); - model = BinaryData.fromObject(model).toObject(UserSessionProperties.class); - Assertions.assertEquals("tzingamvpph", model.userPrincipalName()); - Assertions.assertEquals(ApplicationType.REMOTE_APP, model.applicationType()); - Assertions.assertEquals(SessionState.LOG_OFF, model.sessionState()); - Assertions.assertEquals("dphqamv", model.activeDirectoryUsername()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-05T20:02:56Z"), model.createTime()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDeleteWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDeleteWithResponseMockTests.java deleted file mode 100644 index b1378fb75ed3..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class UserSessionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.userSessions() - .deleteWithResponse("mdgglmepjpfs", "ykgsangpszng", "fpgylkve", "jujcngoad", true, - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDisconnectWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDisconnectWithResponseMockTests.java deleted file mode 100644 index 2296bcd98ed2..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDisconnectWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class UserSessionsDisconnectWithResponseMockTests { - @Test - public void testDisconnectWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.userSessions() - .disconnectWithResponse("csjml", "e", "yeji", "iuxegth", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsGetWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsGetWithResponseMockTests.java deleted file mode 100644 index d0f2d1acf218..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsGetWithResponseMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.ApplicationType; -import com.azure.resourcemanager.desktopvirtualization.models.SessionState; -import com.azure.resourcemanager.desktopvirtualization.models.UserSession; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class UserSessionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"objectId\":\"q\",\"userPrincipalName\":\"yahluqwqulsutr\",\"applicationType\":\"Desktop\",\"sessionState\":\"UserProfileDiskMounted\",\"activeDirectoryUserName\":\"fhyqezvqqugdrft\",\"createTime\":\"2021-09-17T05:59:38Z\"},\"id\":\"xreuquowtlj\",\"name\":\"fwhreagkhyxv\",\"type\":\"qtvbczsu\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - UserSession response = manager.userSessions() - .getWithResponse("yildudxjascow", "f", "jkpdxphlkksnm", "zvyfijdkzuqnwsi", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("yahluqwqulsutr", response.userPrincipalName()); - Assertions.assertEquals(ApplicationType.DESKTOP, response.applicationType()); - Assertions.assertEquals(SessionState.USER_PROFILE_DISK_MOUNTED, response.sessionState()); - Assertions.assertEquals("fhyqezvqqugdrft", response.activeDirectoryUsername()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-17T05:59:38Z"), response.createTime()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListByHostPoolMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListByHostPoolMockTests.java deleted file mode 100644 index 7fd36cf95c81..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListByHostPoolMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.ApplicationType; -import com.azure.resourcemanager.desktopvirtualization.models.SessionState; -import com.azure.resourcemanager.desktopvirtualization.models.UserSession; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class UserSessionsListByHostPoolMockTests { - @Test - public void testListByHostPool() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"objectId\":\"guyxlyk\",\"userPrincipalName\":\"hvxzcwxhmp\",\"applicationType\":\"RemoteApp\",\"sessionState\":\"UserProfileDiskMounted\",\"activeDirectoryUserName\":\"xaonwivkcqh\",\"createTime\":\"2021-11-27T12:45:35Z\"},\"id\":\"knlccrmmkyup\",\"name\":\"jubyqjfkakfq\",\"type\":\"rke\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.userSessions() - .listByHostPool("fexl", "xn", "akizvoaikna", 2097899264, true, 427869575, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("hvxzcwxhmp", response.iterator().next().userPrincipalName()); - Assertions.assertEquals(ApplicationType.REMOTE_APP, response.iterator().next().applicationType()); - Assertions.assertEquals(SessionState.USER_PROFILE_DISK_MOUNTED, response.iterator().next().sessionState()); - Assertions.assertEquals("xaonwivkcqh", response.iterator().next().activeDirectoryUsername()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-27T12:45:35Z"), response.iterator().next().createTime()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListMockTests.java deleted file mode 100644 index d91fef7b7137..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.ApplicationType; -import com.azure.resourcemanager.desktopvirtualization.models.SessionState; -import com.azure.resourcemanager.desktopvirtualization.models.UserSession; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class UserSessionsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"objectId\":\"qraswugyxpqitwei\",\"userPrincipalName\":\"wvskbuhzacaqtylt\",\"applicationType\":\"RemoteApp\",\"sessionState\":\"Disconnected\",\"activeDirectoryUserName\":\"pdsxzakuejkm\",\"createTime\":\"2021-05-24T10:30:43Z\"},\"id\":\"tjo\",\"name\":\"qcvov\",\"type\":\"uf\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.userSessions() - .list("dm", "rgjfoknubnoi", "pkpztrg", 382465235, false, 1781830307, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wvskbuhzacaqtylt", response.iterator().next().userPrincipalName()); - Assertions.assertEquals(ApplicationType.REMOTE_APP, response.iterator().next().applicationType()); - Assertions.assertEquals(SessionState.DISCONNECTED, response.iterator().next().sessionState()); - Assertions.assertEquals("pdsxzakuejkm", response.iterator().next().activeDirectoryUsername()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-24T10:30:43Z"), response.iterator().next().createTime()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsSendMessageWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsSendMessageWithResponseMockTests.java deleted file mode 100644 index 03ab772c1053..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsSendMessageWithResponseMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import com.azure.resourcemanager.desktopvirtualization.models.SendMessage; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class UserSessionsSendMessageWithResponseMockTests { - @Test - public void testSendMessageWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.userSessions() - .sendMessageWithResponse("rtudawlpjfel", "erppt", "bgqnz", "nhii", - new SendMessage().withMessageTitle("alwcjgckbb").withMessageBody("cgzpraoxnyu"), - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePatchPropertiesTests.java deleted file mode 100644 index a93fe12c3fb0..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePatchPropertiesTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.WorkspacePatchProperties; -import com.azure.resourcemanager.desktopvirtualization.models.PublicNetworkAccess; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkspacePatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspacePatchProperties model = BinaryData.fromString( - "{\"description\":\"sycbkbfk\",\"friendlyName\":\"kdkexxp\",\"applicationGroupReferences\":[\"mxaxc\"],\"publicNetworkAccess\":\"Enabled\"}") - .toObject(WorkspacePatchProperties.class); - Assertions.assertEquals("sycbkbfk", model.description()); - Assertions.assertEquals("kdkexxp", model.friendlyName()); - Assertions.assertEquals("mxaxc", model.applicationGroupReferences().get(0)); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspacePatchProperties model = new WorkspacePatchProperties().withDescription("sycbkbfk") - .withFriendlyName("kdkexxp") - .withApplicationGroupReferences(Arrays.asList("mxaxc")) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED); - model = BinaryData.fromObject(model).toObject(WorkspacePatchProperties.class); - Assertions.assertEquals("sycbkbfk", model.description()); - Assertions.assertEquals("kdkexxp", model.friendlyName()); - Assertions.assertEquals("mxaxc", model.applicationGroupReferences().get(0)); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePatchTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePatchTests.java deleted file mode 100644 index 6a6ed30f264d..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePatchTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.models.PublicNetworkAccess; -import com.azure.resourcemanager.desktopvirtualization.models.WorkspacePatch; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class WorkspacePatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspacePatch model = BinaryData.fromString( - "{\"tags\":{\"jionpimexgstxgc\":\"xobnbdxkqpxok\"},\"properties\":{\"description\":\"gmaajrm\",\"friendlyName\":\"jwzrl\",\"applicationGroupReferences\":[\"clwhijcoejctbz\"],\"publicNetworkAccess\":\"Enabled\"}}") - .toObject(WorkspacePatch.class); - Assertions.assertEquals("xobnbdxkqpxok", model.tags().get("jionpimexgstxgc")); - Assertions.assertEquals("gmaajrm", model.description()); - Assertions.assertEquals("jwzrl", model.friendlyName()); - Assertions.assertEquals("clwhijcoejctbz", model.applicationGroupReferences().get(0)); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspacePatch model = new WorkspacePatch().withTags(mapOf("jionpimexgstxgc", "xobnbdxkqpxok")) - .withDescription("gmaajrm") - .withFriendlyName("jwzrl") - .withApplicationGroupReferences(Arrays.asList("clwhijcoejctbz")) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED); - model = BinaryData.fromObject(model).toObject(WorkspacePatch.class); - Assertions.assertEquals("xobnbdxkqpxok", model.tags().get("jionpimexgstxgc")); - Assertions.assertEquals("gmaajrm", model.description()); - Assertions.assertEquals("jwzrl", model.friendlyName()); - Assertions.assertEquals("clwhijcoejctbz", model.applicationGroupReferences().get(0)); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - } - - // 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/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePropertiesTests.java deleted file mode 100644 index d510d1d2180b..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePropertiesTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.WorkspaceProperties; -import com.azure.resourcemanager.desktopvirtualization.models.PublicNetworkAccess; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkspacePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceProperties model = BinaryData.fromString( - "{\"objectId\":\"si\",\"description\":\"evcciqihnhun\",\"friendlyName\":\"wjzrnfygxgisp\",\"applicationGroupReferences\":[\"tzfkufubl\"],\"cloudPcResource\":false,\"publicNetworkAccess\":\"Enabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"e\",\"jhqjbasvmsmjqul\",\"gsntnbybkzgcwr\",\"clxxwrljdo\"],\"privateEndpoint\":{\"id\":\"cqvkocrcjdkwtn\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"jbiksqrglssai\",\"actionsRequired\":\"p\"},\"provisioningState\":\"Succeeded\"},\"id\":\"lljfmppeeb\",\"name\":\"mgxsab\",\"type\":\"yqduujit\"},{\"properties\":{\"groupIds\":[\"dzevndhkrw\",\"d\"],\"privateEndpoint\":{\"id\":\"dsbdkvwrwjf\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"hutje\",\"actionsRequired\":\"mrldhu\"},\"provisioningState\":\"Succeeded\"},\"id\":\"datqxhocdgeabl\",\"name\":\"phut\",\"type\":\"cndvkaozwyiftyhx\"},{\"properties\":{\"groupIds\":[\"k\",\"tyxolniwpwc\",\"kjfkg\",\"awxklr\"],\"privateEndpoint\":{\"id\":\"wckbasyypnd\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"cbacphejkotynqg\",\"actionsRequired\":\"l\"},\"provisioningState\":\"Failed\"},\"id\":\"i\",\"name\":\"wyqkgfgibm\",\"type\":\"dgak\"}]}") - .toObject(WorkspaceProperties.class); - Assertions.assertEquals("evcciqihnhun", model.description()); - Assertions.assertEquals("wjzrnfygxgisp", model.friendlyName()); - Assertions.assertEquals("tzfkufubl", model.applicationGroupReferences().get(0)); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceProperties model = new WorkspaceProperties().withDescription("evcciqihnhun") - .withFriendlyName("wjzrnfygxgisp") - .withApplicationGroupReferences(Arrays.asList("tzfkufubl")) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED); - model = BinaryData.fromObject(model).toObject(WorkspaceProperties.class); - Assertions.assertEquals("evcciqihnhun", model.description()); - Assertions.assertEquals("wjzrnfygxgisp", model.friendlyName()); - Assertions.assertEquals("tzfkufubl", model.applicationGroupReferences().get(0)); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesDeleteByResourceGroupWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index ea3ab3ab46a8..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class WorkspacesDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.workspaces() - .deleteByResourceGroupWithResponse("phai", "mxyasflvgsgzw", com.azure.core.util.Context.NONE); - - } -}