diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/CHANGELOG.md b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/CHANGELOG.md index 2613ba9e9ea4..004266177a3e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/CHANGELOG.md +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/CHANGELOG.md @@ -1,14 +1,929 @@ # Release History -## 1.3.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2025-03-06) -### Features Added +- Azure Resource Manager DesktopVirtualization client library for Java. This package contains Microsoft Azure SDK for DesktopVirtualization Management SDK. This Typespec represents the Desktop Virtualization API interfaces. Package tag package-preview-2024-08. 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.ResourceProviderOperationList` was removed + +#### `models.ResourceModelWithAllowedPropertySet` was removed + +#### `models.AppAttachPackageProperties` 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.ScalingPlanPooledSchedule$Update` was modified + +* `withPeakStartTime(models.Time)` was removed +* `withRampDownStartTime(models.Time)` was removed +* `withRampUpMinimumHostsPct(java.lang.Integer)` was removed +* `withRampDownForceLogoffUsers(java.lang.Boolean)` was removed +* `withOffPeakLoadBalancingAlgorithm(models.SessionHostLoadBalancingAlgorithm)` was removed +* `withDaysOfWeek(java.util.List)` was removed +* `withRampDownMinimumHostsPct(java.lang.Integer)` was removed +* `withOffPeakStartTime(models.Time)` was removed +* `withRampDownCapacityThresholdPct(java.lang.Integer)` was removed +* `withRampUpStartTime(models.Time)` was removed +* `withRampDownNotificationMessage(java.lang.String)` was removed +* `withPeakLoadBalancingAlgorithm(models.SessionHostLoadBalancingAlgorithm)` was removed +* `withRampDownLoadBalancingAlgorithm(models.SessionHostLoadBalancingAlgorithm)` was removed +* `withRampDownWaitTimeMinutes(java.lang.Integer)` was removed +* `withRampUpCapacityThresholdPct(java.lang.Integer)` was removed +* `withRampDownStopHostsWhen(models.StopHostsWhen)` was removed +* `withRampUpLoadBalancingAlgorithm(models.SessionHostLoadBalancingAlgorithm)` was removed + +#### `models.HostPool$Update` was modified + +* `withAgentUpdate(models.AgentUpdatePatchProperties)` was removed +* `withSsoSecretType(models.SsoSecretType)` was removed +* `withValidationEnvironment(java.lang.Boolean)` was removed +* `withCustomRdpProperty(java.lang.String)` was removed +* `withPreferredAppGroupType(models.PreferredAppGroupType)` was removed +* `withVmTemplate(java.lang.String)` was removed +* `withSsoadfsAuthority(java.lang.String)` was removed +* `withPersonalDesktopAssignmentType(models.PersonalDesktopAssignmentType)` was removed +* `withPublicNetworkAccess(models.HostpoolPublicNetworkAccess)` was removed +* `withSsoClientSecretKeyVaultPath(java.lang.String)` was removed +* `withMaxSessionLimit(java.lang.Integer)` was removed +* `withSsoClientId(java.lang.String)` was removed +* `withStartVMOnConnect(java.lang.Boolean)` was removed +* `withRing(java.lang.Integer)` was removed +* `withRegistrationInfo(models.RegistrationInfoPatch)` was removed +* `withLoadBalancerType(models.LoadBalancerType)` was removed +* `withFriendlyName(java.lang.String)` was removed +* `withDescription(java.lang.String)` was removed + +#### `models.ScalingPlan$Update` was modified + +* `withHostPoolReferences(java.util.List)` was removed +* `withFriendlyName(java.lang.String)` was removed +* `withDescription(java.lang.String)` was removed +* `withTimeZone(java.lang.String)` was removed +* `withSchedules(java.util.List)` was removed +* `withExclusionTag(java.lang.String)` was removed + +#### `models.StartMenuItem` was modified + +* `appAlias()` was removed +* `iconIndex()` was removed +* `filePath()` was removed +* `commandLineArguments()` was removed +* `iconPath()` was removed + +#### `models.WorkspacePatch` was modified + +* `applicationGroupReferences()` was removed +* `description()` was removed +* `withApplicationGroupReferences(java.util.List)` was removed +* `publicNetworkAccess()` was removed +* `withPublicNetworkAccess(models.PublicNetworkAccess)` was removed +* `withDescription(java.lang.String)` was removed +* `friendlyName()` was removed +* `withFriendlyName(java.lang.String)` was removed + +#### `models.MsixPackage$Update` was modified + +* `withIsActive(java.lang.Boolean)` was removed +* `withDisplayName(java.lang.String)` was removed +* `withIsRegularRegistration(java.lang.Boolean)` 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.DesktopPatch` was modified + +* `tags()` was removed +* `friendlyName()` was removed +* `withFriendlyName(java.lang.String)` was removed +* `description()` was removed +* `withDescription(java.lang.String)` was removed +* `withTags(java.util.Map)` was removed + +#### `models.Application$Update` was modified + +* `withMsixPackageFamilyName(java.lang.String)` was removed +* `withFilePath(java.lang.String)` was removed +* `withIconIndex(java.lang.Integer)` was removed +* `withTags(java.util.Map)` was removed +* `withFriendlyName(java.lang.String)` was removed +* `withApplicationType(models.RemoteApplicationType)` was removed +* `withCommandLineSetting(models.CommandLineSetting)` was removed +* `withShowInPortal(java.lang.Boolean)` was removed +* `withMsixPackageApplicationId(java.lang.String)` was removed +* `withCommandLineArguments(java.lang.String)` was removed +* `withDescription(java.lang.String)` was removed +* `withIconPath(java.lang.String)` was removed + +#### `models.ApplicationGroup` was modified + +* `models.ResourceModelWithAllowedPropertySetPlan plan()` -> `models.Plan plan()` +* `models.ResourceModelWithAllowedPropertySetSku sku()` -> `models.Sku sku()` +* `models.ResourceModelWithAllowedPropertySetIdentity identity()` -> `models.ManagedServiceIdentity identity()` + +#### `models.HostPool` was modified + +* `models.ResourceModelWithAllowedPropertySetSku sku()` -> `models.Sku sku()` +* `models.ResourceModelWithAllowedPropertySetIdentity identity()` -> `models.ManagedServiceIdentity identity()` +* `models.ResourceModelWithAllowedPropertySetPlan plan()` -> `models.Plan plan()` + +#### `models.HostPoolPatch` was modified + +* `customRdpProperty()` was removed +* `ring()` was removed +* `ssoClientSecretKeyVaultPath()` was removed +* `withSsoSecretType(models.SsoSecretType)` was removed +* `description()` was removed +* `withCustomRdpProperty(java.lang.String)` was removed +* `withMaxSessionLimit(java.lang.Integer)` was removed +* `withSsoClientSecretKeyVaultPath(java.lang.String)` was removed +* `withLoadBalancerType(models.LoadBalancerType)` was removed +* `withStartVMOnConnect(java.lang.Boolean)` was removed +* `withValidationEnvironment(java.lang.Boolean)` was removed +* `startVMOnConnect()` was removed +* `withPersonalDesktopAssignmentType(models.PersonalDesktopAssignmentType)` was removed +* `withPreferredAppGroupType(models.PreferredAppGroupType)` was removed +* `publicNetworkAccess()` was removed +* `withRing(java.lang.Integer)` was removed +* `maxSessionLimit()` was removed +* `withDescription(java.lang.String)` was removed +* `withVmTemplate(java.lang.String)` was removed +* `personalDesktopAssignmentType()` was removed +* `withFriendlyName(java.lang.String)` was removed +* `agentUpdate()` was removed +* `withAgentUpdate(models.AgentUpdatePatchProperties)` was removed +* `registrationInfo()` was removed +* `withPublicNetworkAccess(models.HostpoolPublicNetworkAccess)` was removed +* `ssoSecretType()` was removed +* `validationEnvironment()` was removed +* `loadBalancerType()` was removed +* `ssoadfsAuthority()` was removed +* `withSsoClientId(java.lang.String)` was removed +* `vmTemplate()` was removed +* `ssoClientId()` was removed +* `withSsoadfsAuthority(java.lang.String)` was removed +* `friendlyName()` was removed +* `withRegistrationInfo(models.RegistrationInfoPatch)` was removed +* `preferredAppGroupType()` was removed + +#### `models.AppAttachPackage$Definition` was modified + +* `withProperties(models.AppAttachPackageProperties)` was removed + +#### `models.PrivateEndpointConnections` was modified + +* `updateByWorkspaceWithResponse(java.lang.String,java.lang.String,java.lang.String,models.PrivateEndpointConnection,com.azure.core.util.Context)` was removed +* `updateByWorkspace(java.lang.String,java.lang.String,java.lang.String,models.PrivateEndpointConnection)` was removed +* `updateByHostPoolWithResponse(java.lang.String,java.lang.String,java.lang.String,models.PrivateEndpointConnection,com.azure.core.util.Context)` was removed +* `updateByHostPool(java.lang.String,java.lang.String,java.lang.String,models.PrivateEndpointConnection)` was removed + +#### `models.ScalingPlanPersonalSchedule$Update` was modified + +* `withOffPeakActionOnLogoff(models.SessionHandlingOperation)` was removed +* `withPeakMinutesToWaitOnDisconnect(java.lang.Integer)` was removed +* `withOffPeakStartVMOnConnect(models.SetStartVMOnConnect)` was removed +* `withOffPeakMinutesToWaitOnDisconnect(java.lang.Integer)` was removed +* `withRampUpAutoStartHosts(models.StartupBehavior)` was removed +* `withRampUpActionOnLogoff(models.SessionHandlingOperation)` was removed +* `withPeakStartVMOnConnect(models.SetStartVMOnConnect)` was removed +* `withPeakMinutesToWaitOnLogoff(java.lang.Integer)` was removed +* `withRampUpActionOnDisconnect(models.SessionHandlingOperation)` was removed +* `withRampUpStartTime(models.Time)` was removed +* `withRampDownMinutesToWaitOnDisconnect(java.lang.Integer)` was removed +* `withRampDownMinutesToWaitOnLogoff(java.lang.Integer)` was removed +* `withDaysOfWeek(java.util.List)` was removed +* `withRampDownActionOnLogoff(models.SessionHandlingOperation)` was removed +* `withRampUpMinutesToWaitOnLogoff(java.lang.Integer)` was removed +* `withRampDownStartVMOnConnect(models.SetStartVMOnConnect)` was removed +* `withRampDownStartTime(models.Time)` was removed +* `withPeakActionOnLogoff(models.SessionHandlingOperation)` was removed +* `withPeakStartTime(models.Time)` was removed +* `withOffPeakActionOnDisconnect(models.SessionHandlingOperation)` was removed +* `withRampUpMinutesToWaitOnDisconnect(java.lang.Integer)` was removed +* `withRampUpStartVMOnConnect(models.SetStartVMOnConnect)` was removed +* `withRampDownActionOnDisconnect(models.SessionHandlingOperation)` was removed +* `withOffPeakStartTime(models.Time)` was removed +* `withPeakActionOnDisconnect(models.SessionHandlingOperation)` was removed +* `withOffPeakMinutesToWaitOnLogoff(java.lang.Integer)` was removed + +#### `models.PrivateLinkResource` was modified + +* `requiredMembers()` was removed +* `groupId()` was removed +* `requiredZoneNames()` was removed + +#### `models.PrivateEndpointConnection` was modified + +* `privateEndpoint()` was removed +* `withPrivateEndpoint(models.PrivateEndpoint)` was removed +* `provisioningState()` was removed +* `groupIds()` was removed +* `privateLinkServiceConnectionState()` was removed +* `withPrivateLinkServiceConnectionState(models.PrivateLinkServiceConnectionState)` was removed + +#### `models.AppAttachPackages` was modified + +* `deleteByResourceGroup(java.lang.String,java.lang.String)` was removed +* `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 + +#### `models.ScalingPlanPooledSchedulePatch` was modified + +* `rampDownStartTime()` was removed +* `withDaysOfWeek(java.util.List)` was removed +* `withRampUpCapacityThresholdPct(java.lang.Integer)` was removed +* `withRampDownWaitTimeMinutes(java.lang.Integer)` was removed +* `peakStartTime()` was removed +* `withPeakStartTime(models.Time)` was removed +* `withRampDownStopHostsWhen(models.StopHostsWhen)` was removed +* `withRampDownCapacityThresholdPct(java.lang.Integer)` was removed +* `withRampUpStartTime(models.Time)` was removed +* `rampDownMinimumHostsPct()` was removed +* `rampDownForceLogoffUsers()` was removed +* `withRampDownStartTime(models.Time)` was removed +* `withPeakLoadBalancingAlgorithm(models.SessionHostLoadBalancingAlgorithm)` was removed +* `rampUpStartTime()` was removed +* `withOffPeakLoadBalancingAlgorithm(models.SessionHostLoadBalancingAlgorithm)` was removed +* `rampDownCapacityThresholdPct()` was removed +* `withRampUpLoadBalancingAlgorithm(models.SessionHostLoadBalancingAlgorithm)` was removed +* `withRampDownForceLogoffUsers(java.lang.Boolean)` was removed +* `withOffPeakStartTime(models.Time)` was removed +* `withRampDownMinimumHostsPct(java.lang.Integer)` was removed +* `withRampDownLoadBalancingAlgorithm(models.SessionHostLoadBalancingAlgorithm)` was removed +* `rampDownWaitTimeMinutes()` was removed +* `offPeakLoadBalancingAlgorithm()` was removed +* `withRampDownNotificationMessage(java.lang.String)` was removed +* `peakLoadBalancingAlgorithm()` was removed +* `rampDownStopHostsWhen()` was removed +* `daysOfWeek()` was removed +* `rampUpCapacityThresholdPct()` was removed +* `rampUpLoadBalancingAlgorithm()` was removed +* `withRampUpMinimumHostsPct(java.lang.Integer)` was removed +* `rampDownLoadBalancingAlgorithm()` was removed +* `offPeakStartTime()` was removed +* `rampDownNotificationMessage()` was removed +* `rampUpMinimumHostsPct()` was removed + +#### `models.SessionHostPatch` was modified + +* `withAllowNewSession(java.lang.Boolean)` was removed +* `friendlyName()` was removed +* `withFriendlyName(java.lang.String)` was removed +* `withAssignedUser(java.lang.String)` was removed +* `assignedUser()` was removed +* `allowNewSession()` was removed + +#### `models.MsixPackagePatch` was modified + +* `isRegularRegistration()` was removed +* `withIsRegularRegistration(java.lang.Boolean)` was removed +* `withIsActive(java.lang.Boolean)` was removed +* `isActive()` was removed +* `displayName()` was removed +* `withDisplayName(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.ApplicationGroupPatch` was modified + +* `friendlyName()` was removed +* `showInFeed()` was removed +* `description()` was removed +* `withFriendlyName(java.lang.String)` was removed +* `withDescription(java.lang.String)` was removed +* `withShowInFeed(java.lang.Boolean)` was removed + +#### `models.HostPool$Definition` was modified + +* `withPlan(models.ResourceModelWithAllowedPropertySetPlan)` was removed +* `withIdentity(models.ResourceModelWithAllowedPropertySetIdentity)` was removed +* `withSku(models.ResourceModelWithAllowedPropertySetSku)` was removed + +#### `models.ScalingPlanPooledSchedule` was modified + +* `java.lang.Integer rampDownCapacityThresholdPct()` -> `int rampDownCapacityThresholdPct()` +* `java.lang.Integer rampUpCapacityThresholdPct()` -> `int rampUpCapacityThresholdPct()` + +#### `models.ScalingPlanPatch` was modified + +* `hostPoolReferences()` was removed +* `friendlyName()` was removed +* `schedules()` was removed +* `exclusionTag()` was removed +* `withExclusionTag(java.lang.String)` was removed +* `withHostPoolReferences(java.util.List)` was removed +* `timeZone()` was removed +* `withFriendlyName(java.lang.String)` was removed +* `withTimeZone(java.lang.String)` was removed +* `withDescription(java.lang.String)` was removed +* `withSchedules(java.util.List)` was removed +* `description()` was removed + +#### `models.Workspace$Update` was modified + +* `withPublicNetworkAccess(models.PublicNetworkAccess)` was removed +* `withApplicationGroupReferences(java.util.List)` was removed +* `withFriendlyName(java.lang.String)` was removed +* `withDescription(java.lang.String)` was removed + +#### `models.AppAttachPackage` was modified + +* `properties()` was removed + +#### `models.ExpandMsixImage` was modified + +* `certificateName()` was removed +* `packageFullName()` was removed +* `lastUpdated()` was removed +* `packageRelativePath()` was removed +* `certificateExpiry()` was removed +* `imagePath()` was removed +* `packageFamilyName()` was removed +* `isRegularRegistration()` was removed +* `packageDependencies()` was removed +* `displayName()` was removed +* `version()` was removed +* `packageName()` was removed +* `packageAlias()` was removed +* `isActive()` was removed +* `packageApplications()` was removed + +#### `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.ScalingPlanPersonalSchedulePatch` was modified + +* `rampDownMinutesToWaitOnDisconnect()` was removed +* `rampUpAutoStartHosts()` was removed +* `withRampUpMinutesToWaitOnLogoff(java.lang.Integer)` was removed +* `withDaysOfWeek(java.util.List)` was removed +* `withOffPeakActionOnDisconnect(models.SessionHandlingOperation)` was removed +* `daysOfWeek()` was removed +* `peakMinutesToWaitOnDisconnect()` was removed +* `offPeakMinutesToWaitOnLogoff()` was removed +* `rampDownActionOnDisconnect()` was removed +* `rampUpStartTime()` was removed +* `withRampUpActionOnDisconnect(models.SessionHandlingOperation)` was removed +* `withOffPeakStartTime(models.Time)` was removed +* `rampDownActionOnLogoff()` was removed +* `peakActionOnDisconnect()` was removed +* `withPeakActionOnLogoff(models.SessionHandlingOperation)` was removed +* `peakStartTime()` was removed +* `withRampDownMinutesToWaitOnLogoff(java.lang.Integer)` was removed +* `rampUpMinutesToWaitOnLogoff()` was removed +* `withRampDownActionOnDisconnect(models.SessionHandlingOperation)` was removed +* `rampDownMinutesToWaitOnLogoff()` was removed +* `offPeakActionOnDisconnect()` was removed +* `peakActionOnLogoff()` was removed +* `rampUpActionOnLogoff()` was removed +* `withPeakActionOnDisconnect(models.SessionHandlingOperation)` was removed +* `peakMinutesToWaitOnLogoff()` was removed +* `withRampDownActionOnLogoff(models.SessionHandlingOperation)` was removed +* `withOffPeakStartVMOnConnect(models.SetStartVMOnConnect)` was removed +* `withOffPeakActionOnLogoff(models.SessionHandlingOperation)` was removed +* `withRampDownStartTime(models.Time)` was removed +* `rampUpActionOnDisconnect()` was removed +* `rampUpMinutesToWaitOnDisconnect()` was removed +* `withOffPeakMinutesToWaitOnDisconnect(java.lang.Integer)` was removed +* `withPeakMinutesToWaitOnLogoff(java.lang.Integer)` was removed +* `withPeakMinutesToWaitOnDisconnect(java.lang.Integer)` was removed +* `offPeakActionOnLogoff()` was removed +* `withOffPeakMinutesToWaitOnLogoff(java.lang.Integer)` was removed +* `withRampUpActionOnLogoff(models.SessionHandlingOperation)` was removed +* `offPeakStartTime()` was removed +* `withRampUpMinutesToWaitOnDisconnect(java.lang.Integer)` was removed +* `withRampUpStartVMOnConnect(models.SetStartVMOnConnect)` was removed +* `withRampUpAutoStartHosts(models.StartupBehavior)` was removed +* `peakStartVMOnConnect()` was removed +* `withPeakStartTime(models.Time)` was removed +* `rampUpStartVMOnConnect()` was removed +* `withRampDownMinutesToWaitOnDisconnect(java.lang.Integer)` was removed +* `withRampUpStartTime(models.Time)` was removed +* `withRampDownStartVMOnConnect(models.SetStartVMOnConnect)` was removed +* `offPeakStartVMOnConnect()` was removed +* `withPeakStartVMOnConnect(models.SetStartVMOnConnect)` was removed +* `offPeakMinutesToWaitOnDisconnect()` was removed +* `rampDownStartTime()` was removed +* `rampDownStartVMOnConnect()` was removed + +#### `models.ScalingPlan` was modified + +* `models.ResourceModelWithAllowedPropertySetIdentity identity()` -> `models.ManagedServiceIdentity identity()` +* `models.ResourceModelWithAllowedPropertySetPlan plan()` -> `models.Plan plan()` +* `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 + +* `withSku(models.ResourceModelWithAllowedPropertySetSku)` was removed +* `withIdentity(models.ResourceModelWithAllowedPropertySetIdentity)` was removed +* `withPlan(models.ResourceModelWithAllowedPropertySetPlan)` was removed + +#### `models.ApplicationPatch` was modified + +* `commandLineSetting()` was removed +* `withMsixPackageFamilyName(java.lang.String)` was removed +* `msixPackageApplicationId()` was removed +* `withShowInPortal(java.lang.Boolean)` was removed +* `withCommandLineSetting(models.CommandLineSetting)` was removed +* `withCommandLineArguments(java.lang.String)` was removed +* `showInPortal()` was removed +* `iconIndex()` was removed +* `applicationType()` was removed +* `commandLineArguments()` was removed +* `tags()` was removed +* `description()` was removed +* `filePath()` was removed +* `withDescription(java.lang.String)` was removed +* `withFilePath(java.lang.String)` was removed +* `msixPackageFamilyName()` was removed +* `withTags(java.util.Map)` was removed +* `withIconPath(java.lang.String)` was removed +* `withMsixPackageApplicationId(java.lang.String)` was removed +* `friendlyName()` was removed +* `iconPath()` was removed +* `withFriendlyName(java.lang.String)` was removed +* `withApplicationType(models.RemoteApplicationType)` was removed +* `withIconIndex(java.lang.Integer)` was removed + +#### `models.ApplicationGroup$Update` was modified + +* `withDescription(java.lang.String)` was removed +* `withShowInFeed(java.lang.Boolean)` was removed +* `withFriendlyName(java.lang.String)` 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.MsixPackagePatchProperties` 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.SessionHostManagementUpdateOperationStatus` was added + +* `models.ScalingPlanPooledSchedulePatchProperties` was added + +* `models.DesktopPatchProperties` was added + +* `models.SecurityInfoPatchProperties` was added + +* `models.HostPoolPatchProperties` was added + +* `models.BootDiagnosticsInfoProperties` was added + +* `models.ActiveSessionHostConfiguration` was added + +* `models.ApplicationGroupPatchProperties` was added + +* `models.ControlSessionHostUpdates` was added + +* `models.DomainInfoProperties` was added + +* `models.ActiveSessionHostConfigurationList` was added + +* `models.CustomInfoPatchProperties` was added + +* `models.ExpandMsixImageProperties` 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.WorkspacePatchProperties` was added + +* `models.ScalingPlanPatchProperties` was added + +* `models.NetworkInfoPatchProperties` was added + +* `models.SessionHostManagement` was added + +* `models.MarketplaceInfoProperties` was added + +* `models.SecurityInfoProperties` was added + +* `models.PrivateLinkResourceProperties` was added + +* `models.HostPoolUpdateAction` 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.SessionHostPatchProperties` was added + +* `models.NetworkInfoProperties` was added + +* `models.ResourceProviderOperationListResult` was added + +* `models.SessionHostConfigurationPatchProperties` was added + +* `models.VirtualMachineSecurityType` was added + +* `models.ManagementType` was added + +* `models.SessionHostManagementPatchProperties` was added + +* `models.SessionHostManagementUpdateStatusProperties` was added + +* `models.RelayUdp` was added + +* `models.ActiveDirectoryInfoPatchProperties` was added + +* `models.DomainJoinType` was added + +* `models.ScalingPlanPersonalSchedulePatchProperties` was added + +* `models.HostPoolUpdateConfigurationPatchProperties` was added + +* `models.ApplicationPatchProperties` was added + +* `models.CustomInfoProperties` was added + +* `models.SessionHostManagements` was added + +* `models.Type` was added + +* `models.StartMenuItemProperties` was added + +#### `models.ExpandMsixImageList` was modified + +* `withNextLink(java.lang.String)` was added + +#### `models.ScalingPlanPooledSchedule$Definition` was modified + +* `withRampUpCapacityThresholdPct(int)` was added +* `withNamePropertiesName(java.lang.String)` was added +* `withRampDownCapacityThresholdPct(int)` was added + +#### `models.HostPoolList` was modified + +* `withNextLink(java.lang.String)` was added + +#### `models.SessionHostList` was modified + +* `withNextLink(java.lang.String)` was added + +#### `models.StartMenuItemList` was modified + +* `withNextLink(java.lang.String)` was added + +#### `models.ScalingPlanPooledSchedule$Update` was modified + +* `withProperties(models.ScalingPlanPooledSchedulePatchProperties)` was added + +#### `models.HostPool$Update` was modified + +* `withProperties(models.HostPoolPatchProperties)` was added + +#### `models.ScalingPlan$Update` was modified + +* `withProperties(models.ScalingPlanPatchProperties)` was added + +#### `models.AppAttachPackagePatch` was modified + +* `tags()` was added +* `withTags(java.util.Map)` was added + +#### `models.StartMenuItem` was modified + +* `properties()` was added + +#### `models.AppAttachPackagePatchProperties` was modified + +* `packageLookbackUrl()` was added +* `customData()` was added +* `withCustomData(java.lang.String)` was added +* `withPackageLookbackUrl(java.lang.String)` was added + +#### `models.WorkspacePatch` was modified + +* `withProperties(models.WorkspacePatchProperties)` was added +* `properties()` was added + +#### `models.MsixPackage$Update` was modified + +* `withProperties(models.MsixPackagePatchProperties)` was added + +#### `models.DesktopPatch` was modified + +* `properties()` was added +* `withProperties(models.DesktopPatchProperties)` was added + +#### `models.Application$Update` was modified + +* `withProperties(models.ApplicationPatchProperties)` was added + +#### `models.ScalingPlanPersonalScheduleList` was modified + +* `withNextLink(java.lang.String)` was added + +#### `models.MsixPackageList` was modified + +* `withNextLink(java.lang.String)` was added + +#### `models.HostPool` was modified + +* `managedPrivateUdp()` was added +* `managementType()` was added +* `relayUdp()` was added +* `directUdp()` was added +* `publicUdp()` was added + +#### `models.HostPoolPatch` was modified + +* `properties()` was added +* `withProperties(models.HostPoolPatchProperties)` was added + +#### `models.AppAttachPackage$Definition` was modified + +* `withImage(models.AppAttachPackageInfoProperties)` was added +* `withFailHealthCheckOnStagingFailure(models.FailHealthCheckOnStagingFailure)` was added +* `withPackageLookbackUrl(java.lang.String)` was added +* `withCustomData(java.lang.String)` was added +* `withKeyVaultUrl(java.lang.String)` was added +* `withHostPoolReferences(java.util.List)` was added +* `withPackageOwnerName(java.lang.String)` was added + +#### `models.PrivateEndpointConnections` was modified + +* `updateByHostPoolWithResponse(java.lang.String,java.lang.String,java.lang.String,fluent.models.PrivateEndpointConnectionWithSystemDataInner,com.azure.core.util.Context)` was added +* `updateByWorkspace(java.lang.String,java.lang.String,java.lang.String,fluent.models.PrivateEndpointConnectionWithSystemDataInner)` was added +* `updateByWorkspaceWithResponse(java.lang.String,java.lang.String,java.lang.String,fluent.models.PrivateEndpointConnectionWithSystemDataInner,com.azure.core.util.Context)` was added +* `updateByHostPool(java.lang.String,java.lang.String,java.lang.String,fluent.models.PrivateEndpointConnectionWithSystemDataInner)` was added + +#### `models.ScalingPlanPersonalSchedule$Update` was modified + +* `withProperties(models.ScalingPlanPersonalSchedulePatchProperties)` was added + +#### `models.PrivateLinkResource` was modified + +* `properties()` was added + +#### `models.WorkspaceList` was modified + +* `withNextLink(java.lang.String)` was added + +#### `models.HostPoolProperties` was modified + +* `relayUdp()` was added +* `managementType()` was added +* `publicUdp()` was added +* `directUdp()` was added +* `managedPrivateUdp()` was added + +#### `DesktopVirtualizationManager` was modified + +* `activeSessionHostConfigurations()` was added +* `sessionHostManagementsUpdateStatus()` was added +* `sessionHostManagements()` was added +* `initiateSessionHostUpdates()` was added +* `controlSessionHostUpdates()` was added +* `sessionHostConfigurations()` was added + +#### `models.ApplicationList` was modified + +* `withNextLink(java.lang.String)` was added + +#### `models.PrivateEndpointConnection` was modified + +* `properties()` was added +* `withProperties(fluent.models.PrivateEndpointConnectionProperties)` was added + +#### `models.ApplicationGroupList` was modified + +* `withNextLink(java.lang.String)` 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.ScalingPlanPooledSchedulePatch` was modified + +* `properties()` was added +* `withProperties(models.ScalingPlanPooledSchedulePatchProperties)` was added + +#### `models.SessionHostPatch` was modified + +* `properties()` was added +* `withProperties(models.SessionHostPatchProperties)` was added + +#### `models.MsixPackagePatch` was modified + +* `withProperties(models.MsixPackagePatchProperties)` was added +* `properties()` was added + +#### `models.ApplicationGroup$Definition` was modified + +* `withPlan(models.Plan)` was added +* `withIdentity(models.ManagedServiceIdentity)` was added +* `withSku(models.Sku)` was added + +#### `models.ScalingPlanPooledScheduleList` was modified + +* `withNextLink(java.lang.String)` was added + +#### `models.AppAttachPackageList` was modified + +* `withNextLink(java.lang.String)` was added + +#### `models.ApplicationGroupPatch` was modified + +* `properties()` was added +* `withProperties(models.ApplicationGroupPatchProperties)` was added + +#### `models.HostPool$Definition` was modified + +* `withManagementType(models.ManagementType)` was added +* `withSku(models.Sku)` was added +* `withIdentity(models.ManagedServiceIdentity)` was added +* `withPublicUdp(models.PublicUdp)` was added +* `withRelayUdp(models.RelayUdp)` was added +* `withDirectUdp(models.DirectUdp)` was added +* `withPlan(models.Plan)` was added +* `withManagedPrivateUdp(models.ManagedPrivateUdp)` was added + +#### `models.ScalingPlanPooledSchedule` was modified + +* `namePropertiesName()` was added + +#### `models.ScalingPlanPatch` was modified + +* `withProperties(models.ScalingPlanPatchProperties)` was added +* `properties()` was added + +#### `models.Workspace$Update` was modified + +* `withProperties(models.WorkspacePatchProperties)` was added + +#### `models.SessionHost` was modified + +* `lastSessionHostUpdateTime()` was added +* `sessionHostConfiguration()` was added + +#### `models.AppAttachPackage` was modified + +* `hostPoolReferences()` was added +* `image()` was added +* `keyVaultUrl()` was added +* `customData()` was added +* `provisioningState()` was added +* `packageLookbackUrl()` was added +* `packageOwnerName()` was added +* `failHealthCheckOnStagingFailure()` was added + +#### `models.PrivateLinkResourceListResult` was modified + +* `withNextLink(java.lang.String)` was added + +#### `models.ExpandMsixImage` was modified + +* `properties()` was added + +#### `models.SessionHosts` was modified + +* `retryProvisioning(java.lang.String,java.lang.String,java.lang.String)` was added +* `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 +* `retryProvisioningWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.PrivateEndpointConnectionListResultWithSystemData` was modified + +* `withNextLink(java.lang.String)` was added + +#### `models.ScalingPlanList` was modified + +* `withNextLink(java.lang.String)` was added + +#### `models.ScalingPlanPersonalSchedulePatch` was modified + +* `properties()` was added +* `withProperties(models.ScalingPlanPersonalSchedulePatchProperties)` was added + +#### `models.UserSessionList` was modified + +* `withNextLink(java.lang.String)` 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 + +* `withPlan(models.Plan)` was added +* `withIdentity(models.ManagedServiceIdentity)` was added +* `withSku(models.Sku)` was added + +#### `models.DesktopList` was modified + +* `withNextLink(java.lang.String)` was added + +#### `models.ApplicationPatch` was modified + +* `properties()` was added +* `withProperties(models.ApplicationPatchProperties)` was added + +#### `models.ApplicationGroup$Update` was modified -### Other Changes +* `withProperties(models.ApplicationGroupPatchProperties)` 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..b42a415aa0aa 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. This Typespec represents the Desktop Virtualization API interfaces. Package tag package-preview-2024-08. 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..b5a3b773acf4 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,11 +119,30 @@ - [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) + ## SessionHosts - [Delete](#sessionhosts_delete) - [Get](#sessionhosts_get) - [List](#sessionhosts_list) +- [RetryProvisioning](#sessionhosts_retryprovisioning) - [Update](#sessionhosts_update) ## StartMenuItems @@ -134,11 +166,60 @@ - [List](#workspaces_list) - [ListByResourceGroup](#workspaces_listbyresourcegroup) - [Update](#workspaces_update) +### ActiveSessionHostConfigurations_Get + +```java +/** + * Samples for ActiveSessionHostConfigurations Get. + */ +public final class ActiveSessionHostConfigurationsGetSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/ + * examples/ActiveSessionHostConfigurations_Get.json + */ + /** + * Sample code: ActiveSessionHostConfigurations_Get. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void activeSessionHostConfigurationsGet( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.activeSessionHostConfigurations() + .getWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); + } +} +``` + +### ActiveSessionHostConfigurations_ListByHostPool + +```java +/** + * Samples for ActiveSessionHostConfigurations ListByHostPool. + */ +public final class ActiveSessionHostConfigurationsListByHostPoolSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/ + * examples/ActiveSessionHostConfigurations_ListByHostPool.json + */ + /** + * Sample code: ActiveSessionHostConfigurations_ListByHostPool. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void activeSessionHostConfigurationsListByHostPool( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.activeSessionHostConfigurations() + .listByHostPool("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); + } +} +``` + ### AppAttachPackage_CreateOrUpdate ```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; @@ -151,8 +232,8 @@ import java.util.Arrays; 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-08-08-preview/ + * examples/AppAttachPackage_CreateOrUpdate.json */ /** * Sample code: AppAttachPackage_Create. @@ -165,34 +246,33 @@ public final class AppAttachPackageCreateOrUpdateSamples { .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)) + .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("") + .withFailHealthCheckOnStagingFailure(FailHealthCheckOnStagingFailure.NEEDS_ASSISTANCE) .create(); } } @@ -207,8 +287,8 @@ public final class AppAttachPackageCreateOrUpdateSamples { 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-08-08-preview/ + * examples/AppAttachPackage_Delete.json */ /** * Sample code: AppAttachPackage_Delete. @@ -218,7 +298,7 @@ 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); } } ``` @@ -232,8 +312,8 @@ public final class AppAttachPackageDeleteSamples { 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-08-08-preview/ + * examples/AppAttachPackage_Get.json */ /** * Sample code: AppAttachPackage_Get. @@ -257,8 +337,8 @@ public final class AppAttachPackageGetByResourceGroupSamples { 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-08-08-preview/ + * examples/AppAttachPackage_ListBySubscription.json */ /** * Sample code: AppAttachPackage_ListBySubscription. @@ -281,8 +361,8 @@ public final class AppAttachPackageListSamples { 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-08-08-preview/ + * examples/AppAttachPackage_ListByResourceGroup.json */ /** * Sample code: AppAttachPackage_ListByResourceGroup. @@ -301,6 +381,13 @@ public final class AppAttachPackageListByResourceGroupSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackage; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackagePatchProperties; +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 Update. @@ -308,8 +395,8 @@ import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackage; 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-08-08-preview/ + * examples/AppAttachPackage_Update.json */ /** * Sample code: AppAttachPackage_Update. @@ -321,7 +408,38 @@ public final class AppAttachPackageUpdateSamples { AppAttachPackage resource = manager.appAttachPackages() .getByResourceGroupWithResponse("resourceGroup1", "msixpackagefullname", com.azure.core.util.Context.NONE) .getValue(); - resource.update().apply(); + resource.update() + .withProperties(new AppAttachPackagePatchProperties() + .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( + "/subscriptions/d15725f7-6577-4a8c-95f1-3da903b42364/resourcegroups/charlesk-southcentralus/providers/Microsoft.DesktopVirtualization/hostPool/hp1", + "/subscriptions/d15725f7-6577-4a8c-95f1-3da903b42364/resourcegroups/charlesk-southcentralus/providers/Microsoft.DesktopVirtualization/hostPool/hp2")) + .withKeyVaultUrl("fakeTokenPlaceholder") + .withFailHealthCheckOnStagingFailure(FailHealthCheckOnStagingFailure.DO_NOT_FAIL)) + .apply(); } } ``` @@ -338,8 +456,8 @@ import com.azure.resourcemanager.desktopvirtualization.models.ImportPackageInfoR 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-08-08-preview/ + * examples/AppAttachPackageInfo_Import.json */ /** * Sample code: AppAttachPackageInfo_Import. @@ -349,8 +467,10 @@ public final class AppAttachPackageInfoImportMethodSamples { 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); + .importMethod("resourceGroup1", "hostpool1", + new ImportPackageInfoRequest().withPath("https://url.com/imagePath") + .withPackageArchitecture(AppAttachPackageArchitectures.X64), + com.azure.core.util.Context.NONE); } } ``` @@ -368,8 +488,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-08-08-preview/ + * examples/ApplicationGroups_CreateOrUpdate.json */ /** * Sample code: ApplicationGroup_Create. @@ -415,16 +535,16 @@ public final class ApplicationGroupsCreateOrUpdateSamples { 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-08-08-preview/ + * examples/ApplicationGroups_Delete.json */ /** - * Sample code: ApplicationGroup_Delete. + * Sample code: ApplicationGroups_Delete. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - applicationGroupDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + applicationGroupsDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.applicationGroups() .deleteByResourceGroupWithResponse("resourceGroup1", "applicationGroup1", com.azure.core.util.Context.NONE); } @@ -440,8 +560,8 @@ public final class ApplicationGroupsDeleteSamples { 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-08-08-preview/ + * examples/ApplicationGroups_Get.json */ /** * Sample code: ApplicationGroup_Get. @@ -465,8 +585,8 @@ public final class ApplicationGroupsGetByResourceGroupSamples { 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-08-08-preview/ + * examples/ApplicationGroups_ListBySubscription.json */ /** * Sample code: ApplicationGroup_List. @@ -489,8 +609,8 @@ public final class ApplicationGroupsListSamples { 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-08-08-preview/ + * examples/ApplicationGroups_ListByResourceGroup.json */ /** * Sample code: ApplicationGroup_ListByResourceGroup. @@ -510,6 +630,7 @@ public final class ApplicationGroupsListByResourceGroupSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroup; +import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupPatchProperties; import java.util.HashMap; import java.util.Map; @@ -519,24 +640,24 @@ import java.util.Map; 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-08-08-preview/ + * examples/ApplicationGroups_Update.json */ /** - * Sample code: ApplicationGroups_Update. + * Sample code: ApplicationGroup_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - applicationGroupsUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + applicationGroupUpdate(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) + .withProperties(new ApplicationGroupPatchProperties().withDescription("des1") + .withFriendlyName("friendly") + .withShowInFeed(true)) .apply(); } @@ -565,16 +686,16 @@ import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting 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-08-08-preview/ + * examples/Applications_CreateOrUpdate.json */ /** - * Sample code: Application_Create. + * Sample code: Applications_CreateOrUpdate. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - applicationCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + public static void applicationsCreateOrUpdate( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.applications() .define("application1") .withExistingApplicationGroup("resourceGroup1", "applicationGroup1") @@ -600,16 +721,16 @@ public final class ApplicationsCreateOrUpdateSamples { 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-08-08-preview/ + * examples/Applications_Delete.json */ /** - * Sample code: Application_Delete. + * Sample code: Applications_Delete. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - applicationDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + applicationsDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.applications() .deleteWithResponse("resourceGroup1", "applicationGroup1", "application1", com.azure.core.util.Context.NONE); @@ -626,16 +747,16 @@ public final class ApplicationsDeleteSamples { 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-08-08-preview/ + * examples/Applications_Get.json */ /** - * Sample code: Application_Get. + * Sample code: Applications_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - applicationGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + applicationsGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.applications() .getWithResponse("resourceGroup1", "applicationGroup1", "application1", com.azure.core.util.Context.NONE); } @@ -651,8 +772,8 @@ public final class ApplicationsGetSamples { 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-08-08-preview/ + * examples/Applications_List.json */ /** * Sample code: Applications_List. @@ -671,6 +792,7 @@ public final class ApplicationsListSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.Application; +import com.azure.resourcemanager.desktopvirtualization.models.ApplicationPatchProperties; import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; @@ -680,34 +802,65 @@ import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationT 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-08-08-preview/ + * examples/Applications_Update.json */ /** - * Sample code: Application_Update. + * Sample code: Applications_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - applicationUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + applicationsUpdate(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) + .withProperties(new ApplicationPatchProperties().withDescription("des1") + .withFriendlyName("friendly") + .withFilePath("path") + .withCommandLineSetting(CommandLineSetting.ALLOW) + .withCommandLineArguments("arguments") + .withShowInPortal(true) + .withIconPath("icon") + .withIconIndex(1) + .withApplicationType(RemoteApplicationType.IN_BUILT)) .apply(); } } ``` +### ControlSessionHostUpdate_Post + +```java +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-08-08-preview/ + * examples/SessionHostManagements_ControlSessionHostUpdate_Post.json + */ + /** + * Sample code: SessionHostManagements_ControlSessionHostUpdate_Post. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostManagementsControlSessionHostUpdatePost( + 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); + } +} +``` + ### Desktops_Get ```java @@ -717,16 +870,16 @@ public final class ApplicationsUpdateSamples { 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-08-08-preview/ + * examples/Desktops_Get.json */ /** - * Sample code: Desktop_Get. + * Sample code: Desktops_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - desktopGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + desktopsGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.desktops() .getWithResponse("resourceGroup1", "applicationGroup1", "SessionDesktop", com.azure.core.util.Context.NONE); } @@ -742,16 +895,16 @@ public final class DesktopsGetSamples { 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-08-08-preview/ + * examples/Desktops_List.json */ /** - * Sample code: Desktop_List. + * Sample code: Desktops_List. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - desktopList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + desktopsList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.desktops().list("resourceGroup1", "applicationGroup1", 10, true, 0, com.azure.core.util.Context.NONE); } } @@ -761,6 +914,7 @@ public final class DesktopsListSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.DesktopPatch; +import com.azure.resourcemanager.desktopvirtualization.models.DesktopPatchProperties; /** * Samples for Desktops Update. @@ -768,19 +922,20 @@ import com.azure.resourcemanager.desktopvirtualization.models.DesktopPatch; 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-08-08-preview/ + * examples/Desktops_Update.json */ /** - * Sample code: Desktop_Update. + * Sample code: Desktops_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - desktopUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + desktopsUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.desktops() .updateWithResponse("resourceGroup1", "applicationGroup1", "SessionDesktop", - new DesktopPatch().withDescription("des1").withFriendlyName("friendly"), + new DesktopPatch() + .withProperties(new DesktopPatchProperties().withDescription("des1").withFriendlyName("friendly")), com.azure.core.util.Context.NONE); } } @@ -792,12 +947,17 @@ public final class DesktopsUpdateSamples { 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; @@ -811,16 +971,16 @@ import java.util.Map; 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-08-08-preview/ + * examples/HostPool_CreateOrUpdate.json */ /** - * Sample code: HostPool_Create. + * Sample code: HostPools_CreateOrUpdate. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - hostPoolCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + hostPoolsCreateOrUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.hostPools() .define("hostPool1") .withRegion("centralus") @@ -848,6 +1008,11 @@ 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) + .withManagementType(ManagementType.AUTOMATED) .create(); } @@ -874,16 +1039,16 @@ public final class HostPoolsCreateOrUpdateSamples { 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-08-08-preview/ + * examples/HostPools_Delete.json */ /** - * Sample code: HostPool_Delete. + * Sample code: HostPools_Delete. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - hostPoolDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + hostPoolsDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.hostPools().deleteWithResponse("resourceGroup1", "hostPool1", true, com.azure.core.util.Context.NONE); } } @@ -898,16 +1063,16 @@ public final class HostPoolsDeleteSamples { 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-08-08-preview/ + * examples/HostPools_Get.json */ /** - * Sample code: HostPool_Get. + * Sample code: HostPools_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - hostPoolGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + hostPoolsGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.hostPools() .getByResourceGroupWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); } @@ -923,8 +1088,8 @@ public final class HostPoolsGetByResourceGroupSamples { 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-08-08-preview/ + * examples/HostPool_Lists.json */ /** * Sample code: HostPool_List. @@ -947,15 +1112,15 @@ public final class HostPoolsListSamples { 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-08-08-preview/ + * examples/HostPools_ListByResourceGroup.json */ /** - * Sample code: HostPool_ListByResourceGroup. + * Sample code: HostPools_ListByResourceGroup. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void hostPoolListByResourceGroup( + public static void hostPoolsListByResourceGroup( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.hostPools().listByResourceGroup("resourceGroup1", 10, true, 0, com.azure.core.util.Context.NONE); } @@ -971,15 +1136,15 @@ public final class HostPoolsListByResourceGroupSamples { 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-08-08-preview/ + * examples/HostPools_ListRegistrationTokens.json */ /** - * Sample code: HostPools_ListRegistrationToken_Post. + * Sample code: HostPools_ListRegistrationTokens. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void hostPoolsListRegistrationTokenPost( + public static void hostPoolsListRegistrationTokens( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.hostPools() .listRegistrationTokensWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); @@ -996,15 +1161,15 @@ public final class HostPoolsListRegistrationTokensSamples { 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-08-08-preview/ + * examples/HostPools_RetrieveRegistrationToken.json */ /** - * Sample code: HostPools_RetrieveRegistrationToken_Post. + * Sample code: HostPools_RetrieveRegistrationToken. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void hostPoolsRetrieveRegistrationTokenPost( + public static void hostPoolsRetrieveRegistrationToken( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.hostPools() .retrieveRegistrationTokenWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); @@ -1017,12 +1182,17 @@ public final class HostPoolsRetrieveRegistrationTokenSamples { ```java 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.HostPoolPatchProperties; 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; @@ -1036,42 +1206,46 @@ import java.util.Map; 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-08-08-preview/ + * examples/HostPools_Update.json */ /** - * Sample code: HostPool_Update. + * Sample code: HostPools_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - hostPoolUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + hostPoolsUpdate(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)))) + .withProperties( + new HostPoolPatchProperties().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("fakeTokenPlaceholder") + .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)))) + .withManagedPrivateUdp(ManagedPrivateUdp.ENABLED) + .withDirectUdp(DirectUdp.ENABLED) + .withPublicUdp(PublicUdp.ENABLED) + .withRelayUdp(RelayUdp.ENABLED)) .apply(); } @@ -1089,6 +1263,43 @@ public final class HostPoolsUpdateSamples { } ``` +### InitiateSessionHostUpdate_Post + +```java +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-08-08-preview/ + * examples/SessionHostManagements_UpdateSessionHosts_Post.json + */ + /** + * Sample code: SessionHostManagements_UpdateSessionHosts_Post. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostManagementsUpdateSessionHostsPost( + 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); + } +} +``` + ### MsixImages_Expand ```java @@ -1100,18 +1311,18 @@ import com.azure.resourcemanager.desktopvirtualization.models.MsixImageUri; 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-08-08-preview/ + * examples/MsixImages_Expand.json */ /** - * Sample code: MsixImage_Expand. + * Sample code: MsixImages_Expand. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - msixImageExpand(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + msixImagesExpand(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.msixImages() - .expand("resourceGroup1", "hostpool1", new MsixImageUri().withUri("imagepath"), + .expand("resourceGroup1", "hostpool1", new MsixImageUri().withUri("https://url.com/imagePath"), com.azure.core.util.Context.NONE); } } @@ -1131,16 +1342,16 @@ import java.util.Arrays; 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-08-08-preview/ + * examples/MsixPackages_CreateOrUpdate.json */ /** - * Sample code: MSIXPackage_Create. + * Sample code: MsixPackages_Create. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - mSIXPackageCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + msixPackagesCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.msixPackages() .define("msixpackagefullname") .withExistingHostPool("resourceGroup1", "hostpool1") @@ -1178,16 +1389,16 @@ public final class MsixPackagesCreateOrUpdateSamples { 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-08-08-preview/ + * examples/MsixPackages_Delete.json */ /** - * Sample code: MSIXPackage_Delete. + * Sample code: MsixPackages_Delete. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - mSIXPackageDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + msixPackagesDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.msixPackages() .deleteWithResponse("resourceGroup1", "hostpool1", "packagefullname", com.azure.core.util.Context.NONE); } @@ -1203,16 +1414,16 @@ public final class MsixPackagesDeleteSamples { 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-08-08-preview/ + * examples/MSIXPackages_Get.json */ /** - * Sample code: MSIXPackage_Get. + * Sample code: MSIXPackages_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - mSIXPackageGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + mSIXPackagesGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.msixPackages() .getWithResponse("resourceGroup1", "hostpool1", "packagefullname", com.azure.core.util.Context.NONE); } @@ -1228,16 +1439,16 @@ public final class MsixPackagesGetSamples { 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-08-08-preview/ + * examples/MSIXPackages_List.json */ /** - * Sample code: MSIXPackage_List. + * Sample code: MSIXPackages_List. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - mSIXPackageList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + mSIXPackagesList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.msixPackages().list("resourceGroup1", "hostpool1", 10, true, 0, com.azure.core.util.Context.NONE); } } @@ -1247,6 +1458,7 @@ public final class MsixPackagesListSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.MsixPackage; +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackagePatchProperties; /** * Samples for MsixPackages Update. @@ -1254,20 +1466,24 @@ import com.azure.resourcemanager.desktopvirtualization.models.MsixPackage; 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-08-08-preview/ + * examples/MsixPackages_Update.json */ /** - * Sample code: MSIXPackage_Update. + * Sample code: MsixPackage_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - mSIXPackageUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + 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(); + resource.update() + .withProperties(new MsixPackagePatchProperties().withIsActive(true) + .withIsRegularRegistration(false) + .withDisplayName("displayname")) + .apply(); } } ``` @@ -1281,16 +1497,16 @@ public final class MsixPackagesUpdateSamples { 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-08-08-preview/ + * examples/Operations_List.json */ /** - * Sample code: OperationDescription_List. + * Sample code: List Provider Operations. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - operationDescriptionList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + listProviderOperations(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.operations().list(com.azure.core.util.Context.NONE); } } @@ -1305,15 +1521,15 @@ public final class OperationsListSamples { 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-08-08-preview/ + * examples/PrivateEndpointConnections_DeleteByHostPool.json */ /** - * Sample code: PrivateEndpointConnection_DeleteByHostPool. + * Sample code: PrivateEndpointConnections_DeleteByHostPool. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionDeleteByHostPool( + public static void privateEndpointConnectionsDeleteByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.privateEndpointConnections() .deleteByHostPoolWithResponse("resourceGroup1", "hostPool1", @@ -1331,15 +1547,15 @@ public final class PrivateEndpointConnectionsDeleteByHostPoolSamples { 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-08-08-preview/ + * examples/PrivateEndpointConnections_DeleteByWorkspace.json */ /** - * Sample code: PrivateEndpointConnection_DeleteByWorkspace. + * Sample code: PrivateEndpointConnections_DeleteByWorkspace. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionDeleteByWorkspace( + public static void privateEndpointConnectionsDeleteByWorkspace( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.privateEndpointConnections() .deleteByWorkspaceWithResponse("resourceGroup1", "workspace1", @@ -1357,15 +1573,15 @@ public final class PrivateEndpointConnectionsDeleteByWorkspaceSamples { 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-08-08-preview/ + * examples/PrivateEndpointConnections_GetByHostPool.json */ /** - * Sample code: PrivateEndpointConnection_GetByHostPool. + * Sample code: PrivateEndpointConnections_GetByHostPool. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionGetByHostPool( + public static void privateEndpointConnectionsGetByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.privateEndpointConnections() .getByHostPoolWithResponse("resourceGroup1", "hostPool1", "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", @@ -1383,15 +1599,15 @@ public final class PrivateEndpointConnectionsGetByHostPoolSamples { 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-08-08-preview/ + * examples/PrivateEndpointConnections_GetByWorkspace.json */ /** - * Sample code: PrivateEndpointConnection_GetByWorkspace. + * Sample code: PrivateEndpointConnections_GetByWorkspace. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionGetByWorkspace( + public static void privateEndpointConnectionsGetByWorkspace( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.privateEndpointConnections() .getByWorkspaceWithResponse("resourceGroup1", "workspace1", @@ -1409,15 +1625,15 @@ public final class PrivateEndpointConnectionsGetByWorkspaceSamples { 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-08-08-preview/ + * examples/PrivateEndpointConnections_ListByHostPool.json */ /** - * Sample code: PrivateEndpointConnection_ListByHostPool. + * Sample code: PrivateEndpointConnections_ListByHostPool. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionListByHostPool( + public static void privateEndpointConnectionsListByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.privateEndpointConnections() .listByHostPool("resourceGroup1", "hostPool1", null, null, null, com.azure.core.util.Context.NONE); @@ -1434,15 +1650,15 @@ public final class PrivateEndpointConnectionsListByHostPoolSamples { 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-08-08-preview/ + * examples/PrivateEndpointConnections_ListByWorkspace.json */ /** - * Sample code: PrivateEndpointConnection_ListByWorkspace. + * Sample code: PrivateEndpointConnections_ListByWorkspace. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionListByWorkspace( + public static void privateEndpointConnectionsListByWorkspace( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.privateEndpointConnections() .listByWorkspace("resourceGroup1", "workspace1", com.azure.core.util.Context.NONE); @@ -1453,7 +1669,7 @@ public final class PrivateEndpointConnectionsListByWorkspaceSamples { ### PrivateEndpointConnections_UpdateByHostPool ```java -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionWithSystemDataInner; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; @@ -1463,20 +1679,20 @@ import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkService 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-08-08-preview/ + * examples/PrivateEndpointConnections_UpdateByHostPool.json */ /** - * Sample code: PrivateEndpointConnection_UpdateByHostPool. + * Sample code: PrivateEndpointConnections_UpdateByHostPool. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionUpdateByHostPool( + public static void privateEndpointConnectionsUpdateByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.privateEndpointConnections() .updateByHostPoolWithResponse("resourceGroup1", "hostPool1", "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", - new PrivateEndpointConnection().withPrivateLinkServiceConnectionState( + new PrivateEndpointConnectionWithSystemDataInner().withPrivateLinkServiceConnectionState( new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) .withDescription("Approved by admin@consoto.com") .withActionsRequired("None")), @@ -1488,7 +1704,7 @@ public final class PrivateEndpointConnectionsUpdateByHostPoolSamples { ### PrivateEndpointConnections_UpdateByWorkspace ```java -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionWithSystemDataInner; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; @@ -1498,20 +1714,20 @@ import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkService 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-08-08-preview/ + * examples/PrivateEndpointConnections_UpdateByWorkspace.json */ /** - * Sample code: PrivateEndpointConnection_UpdateByWorkspace. + * Sample code: PrivateEndpointConnections_UpdateByWorkspace. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionUpdateByWorkspace( + public static void privateEndpointConnectionsUpdateByWorkspace( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.privateEndpointConnections() .updateByWorkspaceWithResponse("resourceGroup1", "workspace1", "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", - new PrivateEndpointConnection().withPrivateLinkServiceConnectionState( + new PrivateEndpointConnectionWithSystemDataInner().withPrivateLinkServiceConnectionState( new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) .withDescription("Approved by admin@consoto.com") .withActionsRequired("None")), @@ -1529,8 +1745,8 @@ public final class PrivateEndpointConnectionsUpdateByWorkspaceSamples { 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-08-08-preview/ + * examples/PrivateLinkResources_ListByHostPool.json */ /** * Sample code: PrivateLinkResources_ListByHostPool. @@ -1554,8 +1770,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-08-08-preview/ + * examples/PrivateLinkResources_ListByWorkspace.json */ /** * Sample code: PrivateLinkResources_ListByWorkspace. @@ -1586,8 +1802,8 @@ import java.util.Arrays; 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-08-08-preview/ + * examples/ScalingPlanPersonalSchedules_Create.json */ /** * Sample code: ScalingPlanPersonalSchedules_Create. @@ -1602,25 +1818,25 @@ public final class ScalingPlanPersonalSchedulesCreateSamples { .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) @@ -1640,8 +1856,8 @@ public final class ScalingPlanPersonalSchedulesCreateSamples { 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-08-08-preview/ + * examples/ScalingPlanPersonalSchedules_Delete.json */ /** * Sample code: ScalingPlanPersonalSchedules_Delete. @@ -1666,8 +1882,8 @@ public final class ScalingPlanPersonalSchedulesDeleteSamples { 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-08-08-preview/ + * examples/ScalingPlanPersonalSchedules_Get.json */ /** * Sample code: ScalingPlanPersonalSchedules_Get. @@ -1692,8 +1908,8 @@ public final class ScalingPlanPersonalSchedulesGetSamples { 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-08-08-preview/ + * examples/ScalingPlanPersonalSchedules_List.json */ /** * Sample code: ScalingPlanPersonalSchedules_List. @@ -1712,6 +1928,7 @@ public final class ScalingPlanPersonalSchedulesListSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedule; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedulePatchProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; import com.azure.resourcemanager.desktopvirtualization.models.Time; @@ -1722,8 +1939,8 @@ import com.azure.resourcemanager.desktopvirtualization.models.Time; 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-08-08-preview/ + * examples/ScalingPlanPersonalSchedules_Update.json */ /** * Sample code: ScalingPlanPersonalSchedules_Update. @@ -1737,22 +1954,23 @@ public final class ScalingPlanPersonalSchedulesUpdateSamples { 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) + .withProperties( + new ScalingPlanPersonalSchedulePatchProperties().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(); } } @@ -1772,8 +1990,8 @@ import java.util.Arrays; 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-08-08-preview/ + * examples/ScalingPlanPooledSchedules_Create.json */ /** * Sample code: ScalingPlanPooledSchedules_Create. @@ -1788,19 +2006,19 @@ public final class ScalingPlanPooledSchedulesCreateSamples { .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(); } @@ -1816,8 +2034,8 @@ public final class ScalingPlanPooledSchedulesCreateSamples { 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-08-08-preview/ + * examples/ScalingPlanPooledSchedules_Delete.json */ /** * Sample code: ScalingPlanPooledSchedules_Delete. @@ -1842,8 +2060,8 @@ public final class ScalingPlanPooledSchedulesDeleteSamples { 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-08-08-preview/ + * examples/ScalingPlanPooledSchedules_Get.json */ /** * Sample code: ScalingPlanPooledSchedules_Get. @@ -1868,8 +2086,8 @@ public final class ScalingPlanPooledSchedulesGetSamples { 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-08-08-preview/ + * examples/ScalingPlanPooledSchedules_List.json */ /** * Sample code: ScalingPlanPooledSchedules_List. @@ -1889,6 +2107,7 @@ public final class ScalingPlanPooledSchedulesListSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedule; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedulePatchProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.Time; import java.util.Arrays; @@ -1899,8 +2118,8 @@ import java.util.Arrays; 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-08-08-preview/ + * examples/ScalingPlanPooledSchedules_Update.json */ /** * Sample code: ScalingPlanPooledSchedules_Update. @@ -1914,14 +2133,15 @@ public final class ScalingPlanPooledSchedulesUpdateSamples { 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) + .withProperties(new ScalingPlanPooledSchedulePatchProperties() + .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(); } } @@ -1930,10 +2150,10 @@ public final class ScalingPlanPooledSchedulesUpdateSamples { ### ScalingPlans_Create ```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.ScalingScheduleDaysOfWeekItem; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.Time; import java.util.Arrays; @@ -1946,8 +2166,8 @@ import java.util.Map; 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-08-08-preview/ + * examples/ScalingPlans_Create.json */ /** * Sample code: ScalingPlans_Create. @@ -1967,9 +2187,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) @@ -2014,8 +2233,8 @@ public final class ScalingPlansCreateSamples { 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-08-08-preview/ + * examples/ScalingPlans_Delete.json */ /** * Sample code: ScalingPlans_Delete. @@ -2039,8 +2258,8 @@ public final class ScalingPlansDeleteSamples { 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-08-08-preview/ + * examples/ScalingPlans_Get.json */ /** * Sample code: ScalingPlans_Get. @@ -2064,8 +2283,8 @@ public final class ScalingPlansGetByResourceGroupSamples { 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-08-08-preview/ + * examples/ScalingPlans_ListBySubscription.json */ /** * Sample code: ScalingPlans_ListBySubscription. @@ -2088,15 +2307,15 @@ public final class ScalingPlansListSamples { 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-08-08-preview/ + * examples/ScalingPlans_ListByHostPool.json */ /** - * Sample code: ScalingPlan_ListByHostPool. + * Sample code: ScalingPlans_ListByHostPool. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlanListByHostPool( + public static void scalingPlansListByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.scalingPlans() .listByHostPool("resourceGroup1", "hostPool1", 10, true, 0, com.azure.core.util.Context.NONE); @@ -2113,8 +2332,8 @@ public final class ScalingPlansListByHostPoolSamples { 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-08-08-preview/ + * examples/ScalingPlans_ListByResourceGroup.json */ /** * Sample code: ScalingPlans_ListByResourceGroup. @@ -2131,7 +2350,16 @@ public final class ScalingPlansListByResourceGroupSamples { ### ScalingPlans_Update ```java +import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolReference; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlan; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPatchProperties; +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 ScalingPlans Update. @@ -2139,8 +2367,8 @@ import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlan; 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-08-08-preview/ + * examples/ScalingPlans_Update.json */ /** * Sample code: ScalingPlans_Update. @@ -2152,7 +2380,429 @@ public final class ScalingPlansUpdateSamples { ScalingPlan resource = manager.scalingPlans() .getByResourceGroupWithResponse("resourceGroup1", "scalingPlan1", com.azure.core.util.Context.NONE) .getValue(); - resource.update().apply(); + resource.update() + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withProperties(new ScalingPlanPatchProperties().withDescription("Description of Scaling Plan") + .withFriendlyName("Scaling Plan 1") + .withTimeZone("Central Standard Time") + .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)))) + .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; + } +} +``` + +### SessionHostConfigurations_CreateOrUpdate + +```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 SessionHostConfigurations CreateOrUpdate. + */ +public final class SessionHostConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/ + * examples/SessionHostConfigurations_CreateOrUpdate.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().withType(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; + } +} +``` + +### SessionHostConfigurations_Get + +```java +/** + * Samples for SessionHostConfigurations Get. + */ +public final class SessionHostConfigurationsGetSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-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_ListByHostPool + +```java +/** + * Samples for SessionHostConfigurations ListByHostPool. + */ +public final class SessionHostConfigurationsListByHostPoolSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-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); + } +} +``` + +### SessionHostConfigurations_Update + +```java +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.SessionHostConfigurationPatchProperties; +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-08-08-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().withProperties(new SessionHostConfigurationPatchProperties() + .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().withType(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; + } +} +``` + +### SessionHostManagements_CreateOrUpdate + +```java +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-08-08-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); + } +} +``` + +### SessionHostManagements_Get + +```java +/** + * Samples for SessionHostManagements Get. + */ +public final class SessionHostManagementsGetSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-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); + } +} +``` + +### SessionHostManagements_ListByHostPool + +```java +/** + * Samples for SessionHostManagements ListByHostPool. + */ +public final class SessionHostManagementsListByHostPoolSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/ + * examples/SessionHostManagements_ListByHostPool.json + */ + /** + * Sample code: SessionHostManagements_ListByHostPool. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostManagementsListByHostPool( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostManagements() + .listByHostPool("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); + } +} +``` + +### SessionHostManagements_Update + +```java +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementPatch; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementPatchProperties; + +/** + * Samples for SessionHostManagements Update. + */ +public final class SessionHostManagementsUpdateSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-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().withProperties( + new SessionHostManagementPatchProperties().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); + } +} +``` + +### SessionHostManagementsUpdateStatus_Get + +```java +/** + * Samples for SessionHostManagementsUpdateStatus Get. + */ +public final class SessionHostManagementsUpdateStatusGetSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/ + * examples/SessionHostManagementsUpdateStatus_Get.json + */ + /** + * Sample code: SessionHostManagementsUpdateStatus_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); } } ``` @@ -2166,8 +2816,8 @@ public final class ScalingPlansUpdateSamples { 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-08-08-preview/ + * examples/SessionHosts_Delete.json */ /** * Sample code: SessionHost_Delete. @@ -2192,8 +2842,8 @@ public final class SessionHostsDeleteSamples { 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-08-08-preview/ + * examples/SessionHosts_Get.json */ /** * Sample code: SessionHost_Get. @@ -2218,8 +2868,8 @@ public final class SessionHostsGetSamples { 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-08-08-preview/ + * examples/SessionHosts_List.json */ /** * Sample code: SessionHost_List. @@ -2228,7 +2878,33 @@ 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); + } +} +``` + +### SessionHosts_RetryProvisioning + +```java +/** + * Samples for SessionHosts RetryProvisioning. + */ +public final class SessionHostsRetryProvisioningSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/ + * examples/SessionHost_RetryProvisioning_Post.json + */ + /** + * Sample code: SessionHosts_RetryProvisioning_Post. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostsRetryProvisioningPost( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHosts() + .retryProvisioningWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", + com.azure.core.util.Context.NONE); } } ``` @@ -2237,6 +2913,7 @@ public final class SessionHostsListSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatch; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatchProperties; /** * Samples for SessionHosts Update. @@ -2244,8 +2921,8 @@ import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatch; 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-08-08-preview/ + * examples/SessionHosts_Update.json */ /** * Sample code: SessionHost_Update. @@ -2256,9 +2933,9 @@ public final class SessionHostsUpdateSamples { sessionHostUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.sessionHosts() .updateWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", true, - new SessionHostPatch().withAllowNewSession(true) + new SessionHostPatch().withProperties(new SessionHostPatchProperties().withAllowNewSession(true) .withAssignedUser("user1@microsoft.com") - .withFriendlyName("friendly"), + .withFriendlyName("friendly")), com.azure.core.util.Context.NONE); } } @@ -2273,16 +2950,16 @@ public final class SessionHostsUpdateSamples { 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-08-08-preview/ + * examples/StartMenuItems_List.json */ /** - * Sample code: StartMenuItem_List. + * Sample code: StartMenuItems_List. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - startMenuItemList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + startMenuItemsList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.startMenuItems() .list("resourceGroup1", "applicationGroup1", null, null, null, com.azure.core.util.Context.NONE); } @@ -2298,8 +2975,8 @@ public final class StartMenuItemsListSamples { 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-08-08-preview/ + * examples/UserSessions_Delete.json */ /** * Sample code: UserSession_Delete. @@ -2324,8 +3001,8 @@ public final class UserSessionsDeleteSamples { 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-08-08-preview/ + * examples/UserSessions_Disconnect.json */ /** * Sample code: UserSession_Disconnect_Post. @@ -2350,16 +3027,16 @@ public final class UserSessionsDisconnectSamples { 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-08-08-preview/ + * examples/UserSession_Get.json */ /** - * Sample code: UserSession_Get. + * Sample code: UserSessions_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - userSessionGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + userSessionsGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.userSessions() .getWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", com.azure.core.util.Context.NONE); @@ -2376,8 +3053,8 @@ public final class UserSessionsGetSamples { 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-08-08-preview/ + * examples/UserSessions_List.json */ /** * Sample code: UserSession_List. @@ -2402,8 +3079,8 @@ public final class UserSessionsListSamples { 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-08-08-preview/ + * examples/UserSessions_ListByHostPool.json */ /** * Sample code: UserSession_ListByHostPool. @@ -2431,8 +3108,8 @@ import com.azure.resourcemanager.desktopvirtualization.models.SendMessage; 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-08-08-preview/ + * examples/UserSessions_SendMessage.json */ /** * Sample code: UserSession_SendMessage_Post. @@ -2460,8 +3137,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-08-08-preview/ + * examples/Workspaces_CreateOrUpdate.json */ /** * Sample code: Workspace_Create. @@ -2503,8 +3180,8 @@ public final class WorkspacesCreateOrUpdateSamples { 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-08-08-preview/ + * examples/Workspaces_Delete.json */ /** * Sample code: Workspace_Delete. @@ -2528,8 +3205,8 @@ public final class WorkspacesDeleteSamples { 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-08-08-preview/ + * examples/Workspaces_Get.json */ /** * Sample code: Workspace_Get. @@ -2553,15 +3230,15 @@ public final class WorkspacesGetByResourceGroupSamples { 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-08-08-preview/ + * examples/Workspaces_ListBySubscription.json */ /** - * Sample code: Workspace_ListBySubscription. + * Sample code: Workspaces_ListBySubscription. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void workspaceListBySubscription( + public static void workspacesListBySubscription( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.workspaces().list(com.azure.core.util.Context.NONE); } @@ -2577,8 +3254,8 @@ public final class WorkspacesListSamples { 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-08-08-preview/ + * examples/Workspaces_ListByResourceGroup.json */ /** * Sample code: Workspace_ListByResourceGroup. @@ -2596,6 +3273,7 @@ public final class WorkspacesListByResourceGroupSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.Workspace; +import com.azure.resourcemanager.desktopvirtualization.models.WorkspacePatchProperties; import java.util.HashMap; import java.util.Map; @@ -2605,8 +3283,8 @@ import java.util.Map; 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-08-08-preview/ + * examples/Workspaces_Update.json */ /** * Sample code: Workspace_Update. @@ -2620,8 +3298,7 @@ public final class WorkspacesUpdateSamples { .getValue(); resource.update() .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withDescription("des1") - .withFriendlyName("friendly") + .withProperties(new WorkspacePatchProperties().withDescription("des1").withFriendlyName("friendly")) .apply(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/pom.xml b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/pom.xml index 77412c62e1e8..9452e83bfe5a 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. This Typespec represents the Desktop Virtualization API interfaces. Package tag package-preview-2024-08. https://github.com/Azure/azure-sdk-for-java @@ -45,13 +45,10 @@ UTF-8 0 0 + true + false - - com.azure - azure-json - 1.4.0 - com.azure azure-core @@ -62,6 +59,11 @@ azure-core-management 1.16.2 + + com.azure + azure-json + 1.4.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..d7e375add81e 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,22 @@ 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.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 +67,9 @@ 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.SessionHosts; import com.azure.resourcemanager.desktopvirtualization.models.StartMenuItems; import com.azure.resourcemanager.desktopvirtualization.models.UserSessions; @@ -65,48 +78,62 @@ import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; /** * Entry point to DesktopVirtualizationManager. + * This Typespec represents the Desktop Virtualization API interfaces. */ public final class DesktopVirtualizationManager { private Operations operations; - private Workspaces workspaces; + private AppAttachPackages appAttachPackages; - private PrivateEndpointConnections privateEndpointConnections; + private ApplicationGroups applicationGroups; - private PrivateLinkResources privateLinkResources; + private HostPools hostPools; private ScalingPlans scalingPlans; - private ScalingPlanPooledSchedules scalingPlanPooledSchedules; + private Workspaces workspaces; - private ScalingPlanPersonalSchedules scalingPlanPersonalSchedules; + private Applications applications; - private ApplicationGroups applicationGroups; + private Desktops desktops; private StartMenuItems startMenuItems; - private Applications applications; + private ActiveSessionHostConfigurations activeSessionHostConfigurations; - private Desktops desktops; + private MsixImages msixImages; - private HostPools hostPools; + private AppAttachPackageInfoes appAttachPackageInfoes; - private UserSessions userSessions; + private MsixPackages msixPackages; - private SessionHosts sessionHosts; + private PrivateEndpointConnections privateEndpointConnections; - private MsixPackages msixPackages; + private PrivateLinkResources privateLinkResources; - private AppAttachPackageInfoes appAttachPackageInfoes; + private SessionHostConfigurations sessionHostConfigurations; - private MsixImages msixImages; + private SessionHostManagements sessionHostManagements; - private AppAttachPackages appAttachPackages; + private ControlSessionHostUpdates controlSessionHostUpdates; + + private InitiateSessionHostUpdates initiateSessionHostUpdates; + + private SessionHostManagementsUpdateStatus sessionHostManagementsUpdateStatus; + + private SessionHosts sessionHosts; + + private UserSessions userSessions; + + private ScalingPlanPersonalSchedules scalingPlanPersonalSchedules; + + private ScalingPlanPooledSchedules scalingPlanPooledSchedules; private final DesktopVirtualizationApiClient clientObject; @@ -161,6 +188,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 +298,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 +338,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())); @@ -332,40 +364,39 @@ public Operations operations() { } /** - * Gets the resource collection API of Workspaces. It manages Workspace. + * Gets the resource collection API of AppAttachPackages. It manages AppAttachPackage. * - * @return Resource collection API of Workspaces. + * @return Resource collection API of AppAttachPackages. */ - public Workspaces workspaces() { - if (this.workspaces == null) { - this.workspaces = new WorkspacesImpl(clientObject.getWorkspaces(), this); + public AppAttachPackages appAttachPackages() { + if (this.appAttachPackages == null) { + this.appAttachPackages = new AppAttachPackagesImpl(clientObject.getAppAttachPackages(), this); } - return workspaces; + return appAttachPackages; } /** - * Gets the resource collection API of PrivateEndpointConnections. + * Gets the resource collection API of ApplicationGroups. It manages ApplicationGroup. * - * @return Resource collection API of PrivateEndpointConnections. + * @return Resource collection API of ApplicationGroups. */ - public PrivateEndpointConnections privateEndpointConnections() { - if (this.privateEndpointConnections == null) { - this.privateEndpointConnections - = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + public ApplicationGroups applicationGroups() { + if (this.applicationGroups == null) { + this.applicationGroups = new ApplicationGroupsImpl(clientObject.getApplicationGroups(), this); } - return privateEndpointConnections; + return applicationGroups; } /** - * Gets the resource collection API of PrivateLinkResources. + * Gets the resource collection API of HostPools. It manages HostPool. * - * @return Resource collection API of PrivateLinkResources. + * @return Resource collection API of HostPools. */ - public PrivateLinkResources privateLinkResources() { - if (this.privateLinkResources == null) { - this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + public HostPools hostPools() { + if (this.hostPools == null) { + this.hostPools = new HostPoolsImpl(clientObject.getHostPools(), this); } - return privateLinkResources; + return hostPools; } /** @@ -381,41 +412,39 @@ public ScalingPlans scalingPlans() { } /** - * Gets the resource collection API of ScalingPlanPooledSchedules. It manages ScalingPlanPooledSchedule. + * Gets the resource collection API of Workspaces. It manages Workspace. * - * @return Resource collection API of ScalingPlanPooledSchedules. + * @return Resource collection API of Workspaces. */ - public ScalingPlanPooledSchedules scalingPlanPooledSchedules() { - if (this.scalingPlanPooledSchedules == null) { - this.scalingPlanPooledSchedules - = new ScalingPlanPooledSchedulesImpl(clientObject.getScalingPlanPooledSchedules(), this); + public Workspaces workspaces() { + if (this.workspaces == null) { + this.workspaces = new WorkspacesImpl(clientObject.getWorkspaces(), this); } - return scalingPlanPooledSchedules; + return workspaces; } /** - * Gets the resource collection API of ScalingPlanPersonalSchedules. It manages ScalingPlanPersonalSchedule. + * Gets the resource collection API of Applications. It manages Application. * - * @return Resource collection API of ScalingPlanPersonalSchedules. + * @return Resource collection API of Applications. */ - public ScalingPlanPersonalSchedules scalingPlanPersonalSchedules() { - if (this.scalingPlanPersonalSchedules == null) { - this.scalingPlanPersonalSchedules - = new ScalingPlanPersonalSchedulesImpl(clientObject.getScalingPlanPersonalSchedules(), this); + public Applications applications() { + if (this.applications == null) { + this.applications = new ApplicationsImpl(clientObject.getApplications(), this); } - return scalingPlanPersonalSchedules; + return applications; } /** - * Gets the resource collection API of ApplicationGroups. It manages ApplicationGroup. + * Gets the resource collection API of Desktops. * - * @return Resource collection API of ApplicationGroups. + * @return Resource collection API of Desktops. */ - public ApplicationGroups applicationGroups() { - if (this.applicationGroups == null) { - this.applicationGroups = new ApplicationGroupsImpl(clientObject.getApplicationGroups(), this); + public Desktops desktops() { + if (this.desktops == null) { + this.desktops = new DesktopsImpl(clientObject.getDesktops(), this); } - return applicationGroups; + return desktops; } /** @@ -431,112 +460,193 @@ public StartMenuItems startMenuItems() { } /** - * Gets the resource collection API of Applications. It manages Application. + * Gets the resource collection API of ActiveSessionHostConfigurations. * - * @return Resource collection API of Applications. + * @return Resource collection API of ActiveSessionHostConfigurations. */ - public Applications applications() { - if (this.applications == null) { - this.applications = new ApplicationsImpl(clientObject.getApplications(), this); + public ActiveSessionHostConfigurations activeSessionHostConfigurations() { + if (this.activeSessionHostConfigurations == null) { + this.activeSessionHostConfigurations + = new ActiveSessionHostConfigurationsImpl(clientObject.getActiveSessionHostConfigurations(), this); } - return applications; + return activeSessionHostConfigurations; } /** - * Gets the resource collection API of Desktops. + * Gets the resource collection API of MsixImages. * - * @return Resource collection API of Desktops. + * @return Resource collection API of MsixImages. */ - public Desktops desktops() { - if (this.desktops == null) { - this.desktops = new DesktopsImpl(clientObject.getDesktops(), this); + public MsixImages msixImages() { + if (this.msixImages == null) { + this.msixImages = new MsixImagesImpl(clientObject.getMsixImages(), this); } - return desktops; + return msixImages; } /** - * Gets the resource collection API of HostPools. It manages HostPool. + * Gets the resource collection API of AppAttachPackageInfoes. * - * @return Resource collection API of HostPools. + * @return Resource collection API of AppAttachPackageInfoes. */ - public HostPools hostPools() { - if (this.hostPools == null) { - this.hostPools = new HostPoolsImpl(clientObject.getHostPools(), this); + public AppAttachPackageInfoes appAttachPackageInfoes() { + if (this.appAttachPackageInfoes == null) { + this.appAttachPackageInfoes + = new AppAttachPackageInfoesImpl(clientObject.getAppAttachPackageInfoes(), this); } - return hostPools; + return appAttachPackageInfoes; } /** - * Gets the resource collection API of UserSessions. + * Gets the resource collection API of MsixPackages. It manages MsixPackage. * - * @return Resource collection API of UserSessions. + * @return Resource collection API of MsixPackages. */ - public UserSessions userSessions() { - if (this.userSessions == null) { - this.userSessions = new UserSessionsImpl(clientObject.getUserSessions(), this); + public MsixPackages msixPackages() { + if (this.msixPackages == null) { + this.msixPackages = new MsixPackagesImpl(clientObject.getMsixPackages(), this); } - return userSessions; + return msixPackages; } /** - * Gets the resource collection API of SessionHosts. + * Gets the resource collection API of PrivateEndpointConnections. * - * @return Resource collection API of SessionHosts. + * @return Resource collection API of PrivateEndpointConnections. */ - public SessionHosts sessionHosts() { - if (this.sessionHosts == null) { - this.sessionHosts = new SessionHostsImpl(clientObject.getSessionHosts(), this); + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections + = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); } - return sessionHosts; + return privateEndpointConnections; } /** - * Gets the resource collection API of MsixPackages. It manages MsixPackage. + * Gets the resource collection API of PrivateLinkResources. * - * @return Resource collection API of MsixPackages. + * @return Resource collection API of PrivateLinkResources. */ - public MsixPackages msixPackages() { - if (this.msixPackages == null) { - this.msixPackages = new MsixPackagesImpl(clientObject.getMsixPackages(), this); + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); } - return msixPackages; + return privateLinkResources; } /** - * Gets the resource collection API of AppAttachPackageInfoes. + * Gets the resource collection API of SessionHostConfigurations. * - * @return Resource collection API of AppAttachPackageInfoes. + * @return Resource collection API of SessionHostConfigurations. */ - public AppAttachPackageInfoes appAttachPackageInfoes() { - if (this.appAttachPackageInfoes == null) { - this.appAttachPackageInfoes - = new AppAttachPackageInfoesImpl(clientObject.getAppAttachPackageInfoes(), this); + public SessionHostConfigurations sessionHostConfigurations() { + if (this.sessionHostConfigurations == null) { + this.sessionHostConfigurations + = new SessionHostConfigurationsImpl(clientObject.getSessionHostConfigurations(), this); } - return appAttachPackageInfoes; + return sessionHostConfigurations; } /** - * Gets the resource collection API of MsixImages. + * Gets the resource collection API of SessionHostManagements. * - * @return Resource collection API of MsixImages. + * @return Resource collection API of SessionHostManagements. */ - public MsixImages msixImages() { - if (this.msixImages == null) { - this.msixImages = new MsixImagesImpl(clientObject.getMsixImages(), this); + public SessionHostManagements sessionHostManagements() { + if (this.sessionHostManagements == null) { + this.sessionHostManagements + = new SessionHostManagementsImpl(clientObject.getSessionHostManagements(), this); } - return msixImages; + return sessionHostManagements; } /** - * Gets the resource collection API of AppAttachPackages. It manages AppAttachPackage. + * Gets the resource collection API of ControlSessionHostUpdates. * - * @return Resource collection API of AppAttachPackages. + * @return Resource collection API of ControlSessionHostUpdates. */ - public AppAttachPackages appAttachPackages() { - if (this.appAttachPackages == null) { - this.appAttachPackages = new AppAttachPackagesImpl(clientObject.getAppAttachPackages(), this); + public ControlSessionHostUpdates controlSessionHostUpdates() { + if (this.controlSessionHostUpdates == null) { + this.controlSessionHostUpdates + = new ControlSessionHostUpdatesImpl(clientObject.getControlSessionHostUpdates(), this); } - return appAttachPackages; + return controlSessionHostUpdates; + } + + /** + * 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 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 SessionHosts. + * + * @return Resource collection API of SessionHosts. + */ + public SessionHosts sessionHosts() { + if (this.sessionHosts == null) { + this.sessionHosts = new SessionHostsImpl(clientObject.getSessionHosts(), this); + } + return sessionHosts; + } + + /** + * Gets the resource collection API of UserSessions. + * + * @return Resource collection API of UserSessions. + */ + public UserSessions userSessions() { + if (this.userSessions == null) { + this.userSessions = new UserSessionsImpl(clientObject.getUserSessions(), this); + } + return userSessions; + } + + /** + * Gets the resource collection API of ScalingPlanPersonalSchedules. It manages ScalingPlanPersonalSchedule. + * + * @return Resource collection API of ScalingPlanPersonalSchedules. + */ + public ScalingPlanPersonalSchedules scalingPlanPersonalSchedules() { + if (this.scalingPlanPersonalSchedules == null) { + this.scalingPlanPersonalSchedules + = new ScalingPlanPersonalSchedulesImpl(clientObject.getScalingPlanPersonalSchedules(), this); + } + return scalingPlanPersonalSchedules; + } + + /** + * Gets the resource collection API of ScalingPlanPooledSchedules. It manages ScalingPlanPooledSchedule. + * + * @return Resource collection API of ScalingPlanPooledSchedules. + */ + public ScalingPlanPooledSchedules scalingPlanPooledSchedules() { + if (this.scalingPlanPooledSchedules == null) { + this.scalingPlanPooledSchedules + = new ScalingPlanPooledSchedulesImpl(clientObject.getScalingPlanPooledSchedules(), this); + } + return scalingPlanPooledSchedules; } /** 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..09c34da4d037 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ActiveSessionHostConfigurationsClient.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 { + /** + * Operation to list the ActiveSessionHostConfigurations associated with the 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 list of ActiveSessionHostConfiguration definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName); + + /** + * Operation to list the ActiveSessionHostConfigurations associated with the 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 list of ActiveSessionHostConfiguration definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); + + /** + * Operation to list the ActiveSessionHostConfigurations associated with the 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 list of ActiveSessionHostConfiguration definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Context context); + + /** + * Get a ActiveSessionHostConfiguration. + * + * @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 ActiveSessionHostConfiguration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, + String hostPoolName); + + /** + * Get a ActiveSessionHostConfiguration. + * + * @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 ActiveSessionHostConfiguration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String hostPoolName); + + /** + * Get a ActiveSessionHostConfiguration. + * + * @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 ActiveSessionHostConfiguration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context); + + /** + * Get a ActiveSessionHostConfiguration. + * + * @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 ActiveSessionHostConfiguration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ActiveSessionHostConfigurationInner get(String resourceGroupName, String hostPoolName); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/AppAttachPackageInfoesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/AppAttachPackageInfoesClient.java index 8d638a66b3e0..0c060c0d8039 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/AppAttachPackageInfoesClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/AppAttachPackageInfoesClient.java @@ -21,7 +21,7 @@ public interface AppAttachPackageInfoesClient { * * @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 importPackageInfoRequest Object containing URI to package image and other optional properties. + * @param importPackageInfoRequest The importPackageInfoRequest parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -36,7 +36,7 @@ PagedFlux importMethodAsync(String resourceGroupName, Str * * @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 importPackageInfoRequest Object containing URI to package image and other optional properties. + * @param importPackageInfoRequest The importPackageInfoRequest parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -52,7 +52,7 @@ PagedIterable importMethod(String resourceGroupName, Stri * * @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 importPackageInfoRequest Object containing URI to package image and other optional properties. + * @param importPackageInfoRequest The importPackageInfoRequest parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. 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..7934e97f095d 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 @@ -18,6 +18,104 @@ * An instance of this class provides access to all the operations defined in AppAttachPackagesClient. */ public interface AppAttachPackagesClient { + /** + * List App Attach packages in subscription. + * + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and 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 list of App Attach Package definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String filter); + + /** + * List App Attach packages in subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Attach Package definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); + + /** + * List App Attach packages in subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Attach Package definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Attach Package definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Attach Package definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter); + + /** + * List App Attach packages in resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Attach Package definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName); + + /** + * List App Attach packages in resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Attach Package definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Attach Package definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context); + /** * Get an app attach package. * @@ -135,64 +233,12 @@ Response createOrUpdateWithResponse(String resourceGroupN AppAttachPackageInner createOrUpdate(String resourceGroupName, String appAttachPackageName, AppAttachPackageInner appAttachPackage); - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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); - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 deleteAsync(String resourceGroupName, String appAttachPackageName); - - /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String appAttachPackageName, 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String appAttachPackageName); - /** * 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 appAttachPackagePatch Object containing App Attach Package definition. + * @param appAttachPackagePatch The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -221,7 +267,7 @@ Mono> updateWithResponseAsync(String resourceGro * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appAttachPackageName The name of the App Attach package. - * @param appAttachPackagePatch Object containing App Attach Package definition. + * @param appAttachPackagePatch The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -246,100 +292,57 @@ Response updateWithResponse(String resourceGroupName, Str AppAttachPackageInner update(String resourceGroupName, String appAttachPackageName); /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter); - - /** - * List App Attach packages in resource group. + * 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 force Allows force delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList as paginated response with {@link PagedFlux}. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> deleteWithResponseAsync(String resourceGroupName, String appAttachPackageName, Boolean force); /** - * List App Attach packages in resource group. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList as paginated response with {@link PagedIterable}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String appAttachPackageName); /** - * List App Attach packages in resource group. + * Remove an App Attach Package. * * @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 appAttachPackageName The name of the App Attach package. + * @param force Allows force delete. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context); - - /** - * List App Attach packages in subscription. - * - * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and 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 appAttachPackageList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String filter); - - /** - * List App Attach packages in subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * List App Attach packages in subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String appAttachPackageName, Boolean force, + Context context); /** - * List App Attach packages in subscription. + * Remove an App Attach Package. * - * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and resource - * group. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the 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 appAttachPackageList as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String appAttachPackageName); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ApplicationGroupsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ApplicationGroupsClient.java index 2c35056382d2..6c8db79fbb70 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ApplicationGroupsClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ApplicationGroupsClient.java @@ -19,150 +19,138 @@ */ public interface ApplicationGroupsClient { /** - * Get an application group. + * List applicationGroups in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application group along with {@link Response} on successful completion of {@link Mono}. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String applicationGroupName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String filter); /** - * Get an application group. + * List applicationGroups in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application 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 an application group on successful completion of {@link Mono}. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String applicationGroupName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); /** - * Get an application group. + * List applicationGroups in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application 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 an application group along with {@link Response}. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, - String applicationGroupName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Get an application group. + * List applicationGroups in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application group. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationGroupInner getByResourceGroup(String resourceGroupName, String applicationGroupName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Context context); /** - * Create or update an applicationGroup. + * List applicationGroups. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. - * @param applicationGroup Object containing ApplicationGroup definitions. + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 ApplicationGroup definition along with {@link Response} on successful completion of - * {@link Mono}. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String applicationGroupName, ApplicationGroupInner applicationGroup); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, Integer pageSize, + Boolean isDescending, Integer initialSkip); /** - * Create or update an applicationGroup. + * List applicationGroups. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. - * @param applicationGroup Object containing ApplicationGroup 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 ApplicationGroup definition on successful completion of {@link Mono}. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String resourceGroupName, String applicationGroupName, - ApplicationGroupInner applicationGroup); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName); /** - * Create or update an applicationGroup. + * List applicationGroups. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. - * @param applicationGroup Object containing ApplicationGroup 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 ApplicationGroup definition along with {@link Response}. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String applicationGroupName, - ApplicationGroupInner applicationGroup, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Create or update an applicationGroup. + * List applicationGroups. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. - * @param applicationGroup Object containing ApplicationGroup definitions. + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 ApplicationGroup definition. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationGroupInner createOrUpdate(String resourceGroupName, String applicationGroupName, - ApplicationGroupInner applicationGroup); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String filter, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** - * Remove an applicationGroup. + * Get an application group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application 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 Response} on successful completion of {@link Mono}. + * @return an application group along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName); + Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String applicationGroupName); /** - * Remove an applicationGroup. + * Get an application group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application 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. + * @return an application group on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String applicationGroupName); + Mono getByResourceGroupAsync(String resourceGroupName, String applicationGroupName); /** - * Remove an applicationGroup. + * Get an application group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -170,25 +158,27 @@ ApplicationGroupInner createOrUpdate(String resourceGroupName, String applicatio * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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}. + * @return an application group along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String applicationGroupName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, + String applicationGroupName, Context context); /** - * Remove an applicationGroup. + * Get an application group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application 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 an application group. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String applicationGroupName); + ApplicationGroupInner getByResourceGroup(String resourceGroupName, String applicationGroupName); /** - * Update an applicationGroup. + * Create or update an applicationGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -200,24 +190,26 @@ ApplicationGroupInner createOrUpdate(String resourceGroupName, String applicatio * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync(String resourceGroupName, String applicationGroupName, - ApplicationGroupPatch applicationGroup); + Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String applicationGroupName, ApplicationGroupInner applicationGroup); /** - * Update an applicationGroup. + * Create or update an applicationGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. + * @param applicationGroup Object containing ApplicationGroup 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 ApplicationGroup definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String applicationGroupName); + Mono createOrUpdateAsync(String resourceGroupName, String applicationGroupName, + ApplicationGroupInner applicationGroup); /** - * Update an applicationGroup. + * Create or update an applicationGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -229,123 +221,131 @@ Mono> updateWithResponseAsync(String resourceGro * @return represents a ApplicationGroup definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String applicationGroupName, - ApplicationGroupPatch applicationGroup, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String applicationGroupName, + ApplicationGroupInner applicationGroup, Context context); /** - * Update an applicationGroup. + * Create or update an applicationGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. + * @param applicationGroup Object containing ApplicationGroup 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 ApplicationGroup definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationGroupInner update(String resourceGroupName, String applicationGroupName); + ApplicationGroupInner createOrUpdate(String resourceGroupName, String applicationGroupName, + ApplicationGroupInner applicationGroup); /** - * List applicationGroups. + * Update an applicationGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param applicationGroupName The name of the application group. + * @param applicationGroup The AppGroup properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return applicationGroupList as paginated response with {@link PagedFlux}. + * @return represents a ApplicationGroup definition along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, Integer pageSize, - Boolean isDescending, Integer initialSkip); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> updateWithResponseAsync(String resourceGroupName, String applicationGroupName, + ApplicationGroupPatch applicationGroup); /** - * List applicationGroups. + * Update an applicationGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 applicationGroupList as paginated response with {@link PagedFlux}. + * @return represents a ApplicationGroup definition on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String applicationGroupName); /** - * List applicationGroups. + * Update an applicationGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group. + * @param applicationGroup The AppGroup properties to be updated. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return applicationGroupList as paginated response with {@link PagedIterable}. + * @return represents a ApplicationGroup definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String applicationGroupName, + ApplicationGroupPatch applicationGroup, Context context); /** - * List applicationGroups. + * Update an applicationGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param applicationGroupName The name of the application 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 applicationGroupList as paginated response with {@link PagedIterable}. + * @return represents a ApplicationGroup definition. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, String filter, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGroupInner update(String resourceGroupName, String applicationGroupName); /** - * List applicationGroups in subscription. + * Remove an applicationGroup. * - * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 applicationGroupList as paginated response with {@link PagedFlux}. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String filter); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName); /** - * List applicationGroups in subscription. + * Remove an applicationGroup. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 applicationGroupList as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String applicationGroupName); /** - * List applicationGroups in subscription. + * Remove an applicationGroup. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 applicationGroupList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String applicationGroupName, Context context); /** - * List applicationGroups in subscription. + * Remove an applicationGroup. * - * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 applicationGroupList as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String applicationGroupName); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ApplicationsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ApplicationsClient.java index 328b4c594e83..bf9ef699d50d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ApplicationsClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ApplicationsClient.java @@ -19,186 +19,189 @@ */ public interface ApplicationsClient { /** - * Get an application. + * List applications. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param applicationName The name of the application within the specified application group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application along with {@link Response} on successful completion of {@link Mono}. + * @return list of Application definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceGroupName, String applicationGroupName, - String applicationName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip); /** - * Get an application. + * List applications. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param applicationName The name of the application within the specified application 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 an application on successful completion of {@link Mono}. + * @return list of Application definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String applicationGroupName, String applicationName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String applicationGroupName); /** - * Get an application. + * List applications. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param applicationName The name of the application within the specified application 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 an application along with {@link Response}. + * @return list of Application definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String applicationGroupName, - String applicationName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String applicationGroupName); /** - * Get an application. + * List applications. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param applicationName The name of the application within the specified application group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application. + * @return list of Application definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationInner get(String resourceGroupName, String applicationGroupName, String applicationName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** - * Create or update an application. + * Get an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. - * @param application Object containing Application 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 schema for Application properties along with {@link Response} on successful completion of {@link Mono}. + * @return an application along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String applicationGroupName, String applicationName, ApplicationInner application); + Mono> getWithResponseAsync(String resourceGroupName, String applicationGroupName, + String applicationName); /** - * Create or update an application. + * Get an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. - * @param application Object containing Application 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 schema for Application properties on successful completion of {@link Mono}. + * @return an application on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String resourceGroupName, String applicationGroupName, - String applicationName, ApplicationInner application); + Mono getAsync(String resourceGroupName, String applicationGroupName, String applicationName); /** - * Create or update an application. + * Get an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. - * @param application Object containing Application 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 schema for Application properties along with {@link Response}. + * @return an application along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String applicationGroupName, - String applicationName, ApplicationInner application, Context context); + Response getWithResponse(String resourceGroupName, String applicationGroupName, + String applicationName, Context context); /** - * Create or update an application. + * Get an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. - * @param application Object containing Application 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 schema for Application properties. + * @return an application. */ @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationInner createOrUpdate(String resourceGroupName, String applicationGroupName, String applicationName, - ApplicationInner application); + ApplicationInner get(String resourceGroupName, String applicationGroupName, String applicationName); /** - * Remove an application. + * Create or update an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. + * @param application Object containing Application 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 Response} on successful completion of {@link Mono}. + * @return schema for Application properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName, - String applicationName); + Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String applicationGroupName, String applicationName, ApplicationInner application); /** - * Remove an application. + * Create or update an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. + * @param application Object containing Application 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 A {@link Mono} that completes when a successful response is received. + * @return schema for Application properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String applicationGroupName, String applicationName); + Mono createOrUpdateAsync(String resourceGroupName, String applicationGroupName, + String applicationName, ApplicationInner application); /** - * Remove an application. + * Create or update an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. + * @param application Object containing Application 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 Response}. + * @return schema for Application properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String applicationGroupName, String applicationName, - Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String applicationGroupName, + String applicationName, ApplicationInner application, Context context); /** - * Remove an application. + * Create or update an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. + * @param application Object containing Application 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 schema for Application properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String applicationGroupName, String applicationName); + ApplicationInner createOrUpdate(String resourceGroupName, String applicationGroupName, String applicationName, + ApplicationInner application); /** * Update an application. @@ -206,7 +209,7 @@ Response deleteWithResponse(String resourceGroupName, String applicationGr * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. - * @param application Object containing Application definitions. + * @param application The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -236,7 +239,7 @@ Mono> updateWithResponseAsync(String resourceGroupNam * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. - * @param application Object containing Application definitions. + * @param application The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -262,63 +265,60 @@ Response updateWithResponse(String resourceGroupName, String a ApplicationInner update(String resourceGroupName, String applicationGroupName, String applicationName); /** - * List applications. + * Remove an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param applicationName The name of the application within the specified application 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 applicationList as paginated response with {@link PagedFlux}. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String applicationGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName, + String applicationName); /** - * List applications. + * Remove an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. + * @param applicationName The name of the application within the specified application 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 applicationList as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String applicationGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String applicationGroupName, String applicationName); /** - * List applications. + * Remove an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. + * @param applicationName The name of the application within the specified application 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 applicationList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String applicationGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String applicationGroupName, String applicationName, + Context context); /** - * List applications. + * Remove an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param applicationName The name of the application within the specified application 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 applicationList as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String applicationGroupName, String applicationName); } 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..9895fa4719cd --- /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 actions on a session host update. + * + * @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 The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 actions on a session host update. + * + * @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 The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 actions on a session host update. + * + * @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 The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 actions on a session host update. + * + * @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 The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 actions on a session host update. + * + * @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 The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 actions on a session host update. + * + * @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 The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 actions on a session host update. + * + * @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 The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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..476c5c29d57a 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 @@ -54,25 +54,25 @@ public interface DesktopVirtualizationApiClient { OperationsClient getOperations(); /** - * Gets the WorkspacesClient object to access its operations. + * Gets the AppAttachPackagesClient object to access its operations. * - * @return the WorkspacesClient object. + * @return the AppAttachPackagesClient object. */ - WorkspacesClient getWorkspaces(); + AppAttachPackagesClient getAppAttachPackages(); /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. + * Gets the ApplicationGroupsClient object to access its operations. * - * @return the PrivateEndpointConnectionsClient object. + * @return the ApplicationGroupsClient object. */ - PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + ApplicationGroupsClient getApplicationGroups(); /** - * Gets the PrivateLinkResourcesClient object to access its operations. + * Gets the HostPoolsClient object to access its operations. * - * @return the PrivateLinkResourcesClient object. + * @return the HostPoolsClient object. */ - PrivateLinkResourcesClient getPrivateLinkResources(); + HostPoolsClient getHostPools(); /** * Gets the ScalingPlansClient object to access its operations. @@ -82,25 +82,25 @@ public interface DesktopVirtualizationApiClient { ScalingPlansClient getScalingPlans(); /** - * Gets the ScalingPlanPooledSchedulesClient object to access its operations. + * Gets the WorkspacesClient object to access its operations. * - * @return the ScalingPlanPooledSchedulesClient object. + * @return the WorkspacesClient object. */ - ScalingPlanPooledSchedulesClient getScalingPlanPooledSchedules(); + WorkspacesClient getWorkspaces(); /** - * Gets the ScalingPlanPersonalSchedulesClient object to access its operations. + * Gets the ApplicationsClient object to access its operations. * - * @return the ScalingPlanPersonalSchedulesClient object. + * @return the ApplicationsClient object. */ - ScalingPlanPersonalSchedulesClient getScalingPlanPersonalSchedules(); + ApplicationsClient getApplications(); /** - * Gets the ApplicationGroupsClient object to access its operations. + * Gets the DesktopsClient object to access its operations. * - * @return the ApplicationGroupsClient object. + * @return the DesktopsClient object. */ - ApplicationGroupsClient getApplicationGroups(); + DesktopsClient getDesktops(); /** * Gets the StartMenuItemsClient object to access its operations. @@ -110,65 +110,107 @@ public interface DesktopVirtualizationApiClient { StartMenuItemsClient getStartMenuItems(); /** - * Gets the ApplicationsClient object to access its operations. + * Gets the ActiveSessionHostConfigurationsClient object to access its operations. * - * @return the ApplicationsClient object. + * @return the ActiveSessionHostConfigurationsClient object. */ - ApplicationsClient getApplications(); + ActiveSessionHostConfigurationsClient getActiveSessionHostConfigurations(); /** - * Gets the DesktopsClient object to access its operations. + * Gets the MsixImagesClient object to access its operations. * - * @return the DesktopsClient object. + * @return the MsixImagesClient object. */ - DesktopsClient getDesktops(); + MsixImagesClient getMsixImages(); /** - * Gets the HostPoolsClient object to access its operations. + * Gets the AppAttachPackageInfoesClient object to access its operations. * - * @return the HostPoolsClient object. + * @return the AppAttachPackageInfoesClient object. */ - HostPoolsClient getHostPools(); + AppAttachPackageInfoesClient getAppAttachPackageInfoes(); /** - * Gets the UserSessionsClient object to access its operations. + * Gets the MsixPackagesClient object to access its operations. * - * @return the UserSessionsClient object. + * @return the MsixPackagesClient object. */ - UserSessionsClient getUserSessions(); + MsixPackagesClient getMsixPackages(); /** - * Gets the SessionHostsClient object to access its operations. + * Gets the PrivateEndpointConnectionsClient object to access its operations. * - * @return the SessionHostsClient object. + * @return the PrivateEndpointConnectionsClient object. */ - SessionHostsClient getSessionHosts(); + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); /** - * Gets the MsixPackagesClient object to access its operations. + * Gets the PrivateLinkResourcesClient object to access its operations. * - * @return the MsixPackagesClient object. + * @return the PrivateLinkResourcesClient object. */ - MsixPackagesClient getMsixPackages(); + PrivateLinkResourcesClient getPrivateLinkResources(); /** - * Gets the AppAttachPackageInfoesClient object to access its operations. + * Gets the SessionHostConfigurationsClient object to access its operations. * - * @return the AppAttachPackageInfoesClient object. + * @return the SessionHostConfigurationsClient object. */ - AppAttachPackageInfoesClient getAppAttachPackageInfoes(); + SessionHostConfigurationsClient getSessionHostConfigurations(); /** - * Gets the MsixImagesClient object to access its operations. + * Gets the SessionHostManagementsClient object to access its operations. * - * @return the MsixImagesClient object. + * @return the SessionHostManagementsClient object. */ - MsixImagesClient getMsixImages(); + SessionHostManagementsClient getSessionHostManagements(); /** - * Gets the AppAttachPackagesClient object to access its operations. + * Gets the ControlSessionHostUpdatesClient object to access its operations. * - * @return the AppAttachPackagesClient object. + * @return the ControlSessionHostUpdatesClient object. */ - AppAttachPackagesClient getAppAttachPackages(); + ControlSessionHostUpdatesClient getControlSessionHostUpdates(); + + /** + * Gets the InitiateSessionHostUpdatesClient object to access its operations. + * + * @return the InitiateSessionHostUpdatesClient object. + */ + InitiateSessionHostUpdatesClient getInitiateSessionHostUpdates(); + + /** + * Gets the SessionHostManagementsUpdateStatusClient object to access its operations. + * + * @return the SessionHostManagementsUpdateStatusClient object. + */ + SessionHostManagementsUpdateStatusClient getSessionHostManagementsUpdateStatus(); + + /** + * Gets the SessionHostsClient object to access its operations. + * + * @return the SessionHostsClient object. + */ + SessionHostsClient getSessionHosts(); + + /** + * Gets the UserSessionsClient object to access its operations. + * + * @return the UserSessionsClient object. + */ + UserSessionsClient getUserSessions(); + + /** + * Gets the ScalingPlanPersonalSchedulesClient object to access its operations. + * + * @return the ScalingPlanPersonalSchedulesClient object. + */ + ScalingPlanPersonalSchedulesClient getScalingPlanPersonalSchedules(); + + /** + * Gets the ScalingPlanPooledSchedulesClient object to access its operations. + * + * @return the ScalingPlanPooledSchedulesClient object. + */ + ScalingPlanPooledSchedulesClient getScalingPlanPooledSchedules(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopsClient.java index 2e5075ecf914..061f912f8c0a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopsClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopsClient.java @@ -18,6 +18,67 @@ * An instance of this class provides access to all the operations defined in DesktopsClient. */ public interface DesktopsClient { + /** + * List desktops. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Desktop definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip); + + /** + * List desktops. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 list of Desktop definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String applicationGroupName); + + /** + * List desktops. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 list of Desktop definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String applicationGroupName); + + /** + * List desktops. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Desktop definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); + /** * Get a desktop. * @@ -83,7 +144,7 @@ Response getWithResponse(String resourceGroupName, String applicat * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param desktopName The name of the desktop within the specified desktop group. - * @param desktop Object containing Desktop definitions. + * @param desktop The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -113,7 +174,7 @@ Mono> updateWithResponseAsync(String resourceGroupName, S * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param desktopName The name of the desktop within the specified desktop group. - * @param desktop Object containing Desktop definitions. + * @param desktop The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -137,65 +198,4 @@ Response updateWithResponse(String resourceGroupName, String appli */ @ServiceMethod(returns = ReturnType.SINGLE) DesktopInner update(String resourceGroupName, String applicationGroupName, String desktopName); - - /** - * List desktops. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return desktopList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String applicationGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip); - - /** - * List desktops. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application 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 desktopList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String applicationGroupName); - - /** - * List desktops. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application 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 desktopList as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String applicationGroupName); - - /** - * List desktops. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return desktopList as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/HostPoolsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/HostPoolsClient.java index b8f2b9c69a58..b18bae118bc0 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/HostPoolsClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/HostPoolsClient.java @@ -21,174 +21,167 @@ */ public interface HostPoolsClient { /** - * Get a host pool. + * List hostPools in subscription. * - * @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 pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a host pool along with {@link Response} on successful completion of {@link Mono}. + * @return list of HostPool definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String hostPoolName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip); /** - * Get a host pool. + * List hostPools in subscription. * - * @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 host pool on successful completion of {@link Mono}. + * @return list of HostPool definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String hostPoolName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); /** - * Get a host pool. + * List hostPools in subscription. * - * @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 host pool along with {@link Response}. + * @return list of HostPool definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String hostPoolName, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Get a host pool. + * List hostPools in subscription. * - * @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 pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a host pool. + * @return list of HostPool definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - HostPoolInner getByResourceGroup(String resourceGroupName, String hostPoolName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** - * Create or update a host pool. + * List hostPools. * * @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 hostPool Object containing HostPool definitions. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 HostPool definition along with {@link Response} on successful completion of {@link Mono}. + * @return list of HostPool definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String hostPoolName, - HostPoolInner hostPool); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, Boolean isDescending, + Integer initialSkip); /** - * Create or update a host pool. + * List hostPools. * * @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 hostPool Object containing HostPool 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 HostPool definition on successful completion of {@link Mono}. + * @return list of HostPool definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String resourceGroupName, String hostPoolName, HostPoolInner hostPool); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName); /** - * Create or update a host pool. + * List hostPools. * * @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 hostPool Object containing HostPool 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 HostPool definition along with {@link Response}. + * @return list of HostPool definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String hostPoolName, - HostPoolInner hostPool, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Create or update a host pool. + * List hostPools. * * @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 hostPool Object containing HostPool definitions. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 HostPool definition. + * @return list of HostPool definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - HostPoolInner createOrUpdate(String resourceGroupName, String hostPoolName, HostPoolInner hostPool); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, + Integer initialSkip, Context context); /** - * Remove a host pool. + * Get a host pool. * * @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 force Force flag to delete sessionHost. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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}. + * @return a host pool along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, Boolean force); + Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String hostPoolName); /** - * Remove a host pool. + * Get a host pool. * * @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. + * @return a host pool on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String hostPoolName); + Mono getByResourceGroupAsync(String resourceGroupName, String hostPoolName); /** - * Remove a host pool. + * Get a host pool. * * @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 force Force flag to delete sessionHost. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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}. + * @return a host pool along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String hostPoolName, Boolean force, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String hostPoolName, + Context context); /** - * Remove a host pool. + * Get a host pool. * * @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 host pool. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String hostPoolName); + HostPoolInner getByResourceGroup(String resourceGroupName, String hostPoolName); /** - * Update a host pool. + * Create or update a host pool. * * @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. @@ -199,24 +192,25 @@ Response createOrUpdateWithResponse(String resourceGroupName, Str * @return represents a HostPool definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, - HostPoolPatch hostPool); + Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String hostPoolName, + HostPoolInner hostPool); /** - * Update a host pool. + * Create or update a host pool. * * @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 hostPool Object containing HostPool 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 HostPool definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String hostPoolName); + Mono createOrUpdateAsync(String resourceGroupName, String hostPoolName, HostPoolInner hostPool); /** - * Update a host pool. + * Create or update a host pool. * * @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. @@ -228,158 +222,164 @@ Mono> updateWithResponseAsync(String resourceGroupName, * @return represents a HostPool definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String hostPoolName, HostPoolPatch hostPool, - Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String hostPoolName, + HostPoolInner hostPool, Context context); /** - * Update a host pool. + * Create or update a host pool. * * @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 hostPool Object containing HostPool 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 HostPool definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - HostPoolInner update(String resourceGroupName, String hostPoolName); + HostPoolInner createOrUpdate(String resourceGroupName, String hostPoolName, HostPoolInner hostPool); /** - * List hostPools. + * Update a host pool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPool The properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostPoolList as paginated response with {@link PagedFlux}. + * @return represents a HostPool definition along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, Boolean isDescending, - Integer initialSkip); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + HostPoolPatch hostPool); /** - * List hostPools. + * Update a host pool. * * @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 hostPoolList as paginated response with {@link PagedFlux}. + * @return represents a HostPool definition on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String hostPoolName); /** - * List hostPools. + * Update a host pool. * * @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 hostPool The properties to be updated. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostPoolList as paginated response with {@link PagedIterable}. + * @return represents a HostPool definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String hostPoolName, HostPoolPatch hostPool, + Context context); /** - * List hostPools. + * Update a host pool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @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 hostPoolList as paginated response with {@link PagedIterable}. + * @return represents a HostPool definition. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, - Integer initialSkip, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + HostPoolInner update(String resourceGroupName, String hostPoolName); /** - * List hostPools in subscription. + * Remove a host pool. * - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @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 force Force flag to delete sessionHost. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostPoolList as paginated response with {@link PagedFlux}. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, Boolean force); /** - * List hostPools in subscription. + * Remove a host pool. * + * @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 hostPoolList as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String hostPoolName); /** - * List hostPools in subscription. + * Remove a host pool. * + * @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 force Force flag to delete sessionHost. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostPoolList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String hostPoolName, Boolean force, Context context); /** - * List hostPools in subscription. + * Remove a host pool. * - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @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 hostPoolList as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String hostPoolName); /** - * Registration token of the host pool. + * Operation to list the RegistrationTokens associated with the 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 represents a RegistrationInfo definition along with {@link Response} on successful completion of + * @return list of RegistrationToken definitions along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> retrieveRegistrationTokenWithResponseAsync(String resourceGroupName, + Mono> listRegistrationTokensWithResponseAsync(String resourceGroupName, String hostPoolName); /** - * Registration token of the host pool. + * Operation to list the RegistrationTokens associated with the 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 represents a RegistrationInfo definition on successful completion of {@link Mono}. + * @return list of RegistrationToken definitions on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono retrieveRegistrationTokenAsync(String resourceGroupName, String hostPoolName); + Mono listRegistrationTokensAsync(String resourceGroupName, String hostPoolName); /** - * Registration token of the host pool. + * Operation to list the RegistrationTokens associated with the 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. @@ -387,54 +387,55 @@ Mono> retrieveRegistrationTokenWithResponseAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 RegistrationInfo definition along with {@link Response}. + * @return list of RegistrationToken definitions along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response retrieveRegistrationTokenWithResponse(String resourceGroupName, String hostPoolName, - Context context); + Response listRegistrationTokensWithResponse(String resourceGroupName, + String hostPoolName, Context context); /** - * Registration token of the host pool. + * Operation to list the RegistrationTokens associated with the 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 represents a RegistrationInfo definition. + * @return list of RegistrationToken definitions. */ @ServiceMethod(returns = ReturnType.SINGLE) - RegistrationInfoInner retrieveRegistrationToken(String resourceGroupName, String hostPoolName); + RegistrationTokenListInner listRegistrationTokens(String resourceGroupName, String hostPoolName); /** - * Operation to list the RegistrationTokens associated with the HostPool. + * Registration token of the host pool. * * @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 registrationTokenList along with {@link Response} on successful completion of {@link Mono}. + * @return represents a RegistrationInfo definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listRegistrationTokensWithResponseAsync(String resourceGroupName, + Mono> retrieveRegistrationTokenWithResponseAsync(String resourceGroupName, String hostPoolName); /** - * Operation to list the RegistrationTokens associated with the HostPool. + * Registration token of the host pool. * * @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 registrationTokenList on successful completion of {@link Mono}. + * @return represents a RegistrationInfo definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono listRegistrationTokensAsync(String resourceGroupName, String hostPoolName); + Mono retrieveRegistrationTokenAsync(String resourceGroupName, String hostPoolName); /** - * Operation to list the RegistrationTokens associated with the HostPool. + * Registration token of the host pool. * * @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. @@ -442,22 +443,22 @@ Mono> listRegistrationTokensWithResponseAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return registrationTokenList along with {@link Response}. + * @return represents a RegistrationInfo definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listRegistrationTokensWithResponse(String resourceGroupName, - String hostPoolName, Context context); + Response retrieveRegistrationTokenWithResponse(String resourceGroupName, String hostPoolName, + Context context); /** - * Operation to list the RegistrationTokens associated with the HostPool. + * Registration token of the host pool. * * @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 registrationTokenList. + * @return represents a RegistrationInfo definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - RegistrationTokenListInner listRegistrationTokens(String resourceGroupName, String hostPoolName); + RegistrationInfoInner retrieveRegistrationToken(String resourceGroupName, String hostPoolName); } 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..f5a0dd9cc62d --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/InitiateSessionHostUpdatesClient.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.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 The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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/MsixImagesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/MsixImagesClient.java index c79b9c09856a..56f935277139 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/MsixImagesClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/MsixImagesClient.java @@ -18,14 +18,16 @@ public interface MsixImagesClient { /** * Expands and Lists MSIX packages in an Image, given the Image Path. + * This action uses incorrect Msix casing intentionally to match the previous APIs. * * @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 msixImageUri Object containing URI to MSIX Image. + * @param msixImageUri The msixImageUri parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expandMsixImageList as paginated response with {@link PagedFlux}. + * @return list of MSIX package properties retrieved from MSIX Image expansion as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux expandAsync(String resourceGroupName, String hostPoolName, @@ -33,14 +35,16 @@ PagedFlux expandAsync(String resourceGroupName, String hos /** * Expands and Lists MSIX packages in an Image, given the Image Path. + * This action uses incorrect Msix casing intentionally to match the previous APIs. * * @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 msixImageUri Object containing URI to MSIX Image. + * @param msixImageUri The msixImageUri parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expandMsixImageList as paginated response with {@link PagedIterable}. + * @return list of MSIX package properties retrieved from MSIX Image expansion as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable expand(String resourceGroupName, String hostPoolName, @@ -48,15 +52,17 @@ PagedIterable expand(String resourceGroupName, String host /** * Expands and Lists MSIX packages in an Image, given the Image Path. + * This action uses incorrect Msix casing intentionally to match the previous APIs. * * @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 msixImageUri Object containing URI to MSIX Image. + * @param msixImageUri The msixImageUri parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expandMsixImageList as paginated response with {@link PagedIterable}. + * @return list of MSIX package properties retrieved from MSIX Image expansion as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable expand(String resourceGroupName, String hostPoolName, MsixImageUri msixImageUri, diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/MsixPackagesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/MsixPackagesClient.java index 5a00acdae0e4..2089b52be152 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/MsixPackagesClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/MsixPackagesClient.java @@ -19,186 +19,189 @@ */ public interface MsixPackagesClient { /** - * Get a msixpackage. + * List MSIX packages in 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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a msixpackage along with {@link Response} on successful completion of {@link Mono}. + * @return list of MSIX Package definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName, - String msixPackageFullName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip); /** - * Get a msixpackage. + * List MSIX packages in 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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a msixpackage on successful completion of {@link Mono}. + * @return list of MSIX Package definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String hostPoolName); /** - * Get a msixpackage. + * List MSIX packages in 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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a msixpackage along with {@link Response}. + * @return list of MSIX Package definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String hostPoolName, - String msixPackageFullName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String hostPoolName); /** - * Get a msixpackage. + * List MSIX packages in 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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a msixpackage. + * @return list of MSIX Package definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - MsixPackageInner get(String resourceGroupName, String hostPoolName, String msixPackageFullName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** - * Create or update a MSIX package. + * Get a msixpackage. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. - * @param msixPackage Object containing MSIX 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema for MSIX Package properties along with {@link Response} on successful completion of {@link Mono}. + * @return a msixpackage along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String hostPoolName, - String msixPackageFullName, MsixPackageInner msixPackage); + Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName); /** - * Create or update a MSIX package. + * Get a msixpackage. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. - * @param msixPackage Object containing MSIX 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema for MSIX Package properties on successful completion of {@link Mono}. + * @return a msixpackage on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String resourceGroupName, String hostPoolName, - String msixPackageFullName, MsixPackageInner msixPackage); + Mono getAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName); /** - * Create or update a MSIX package. + * Get a msixpackage. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. - * @param msixPackage Object containing MSIX Package 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 schema for MSIX Package properties along with {@link Response}. + * @return a msixpackage along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String hostPoolName, - String msixPackageFullName, MsixPackageInner msixPackage, Context context); + Response getWithResponse(String resourceGroupName, String hostPoolName, + String msixPackageFullName, Context context); /** - * Create or update a MSIX package. + * Get a msixpackage. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. - * @param msixPackage Object containing MSIX 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema for MSIX Package properties. + * @return a msixpackage. */ @ServiceMethod(returns = ReturnType.SINGLE) - MsixPackageInner createOrUpdate(String resourceGroupName, String hostPoolName, String msixPackageFullName, - MsixPackageInner msixPackage); + MsixPackageInner get(String resourceGroupName, String hostPoolName, String msixPackageFullName); /** - * Remove an MSIX Package. + * Create or update a MSIX package. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param msixPackage Object containing MSIX 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return schema for MSIX Package properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, - String msixPackageFullName); + Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName, MsixPackageInner msixPackage); /** - * Remove an MSIX Package. + * Create or update a MSIX package. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param msixPackage Object containing MSIX 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. * @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. + * @return schema for MSIX Package properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName); + Mono createOrUpdateAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName, MsixPackageInner msixPackage); /** - * Remove an MSIX Package. + * Create or update a MSIX package. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param msixPackage Object containing MSIX Package 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 Response}. + * @return schema for MSIX Package properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String hostPoolName, String msixPackageFullName, - Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String hostPoolName, + String msixPackageFullName, MsixPackageInner msixPackage, Context context); /** - * Remove an MSIX Package. + * Create or update a MSIX package. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param msixPackage Object containing MSIX 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for MSIX Package properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String hostPoolName, String msixPackageFullName); + MsixPackageInner createOrUpdate(String resourceGroupName, String hostPoolName, String msixPackageFullName, + MsixPackageInner msixPackage); /** * Update an MSIX Package. @@ -206,7 +209,7 @@ Response deleteWithResponse(String resourceGroupName, String hostPoolName, * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. - * @param msixPackage Object containing MSIX Package definitions. + * @param msixPackage The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -222,13 +225,15 @@ Mono> updateWithResponseAsync(String resourceGroupNam * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param msixPackage The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return schema for MSIX Package properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName); + Mono updateAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName, + MsixPackagePatch msixPackage); /** * Update an MSIX Package. @@ -236,7 +241,7 @@ Mono> updateWithResponseAsync(String resourceGroupNam * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. - * @param msixPackage Object containing MSIX Package definitions. + * @param msixPackage The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -253,72 +258,71 @@ Response updateWithResponse(String resourceGroupName, String h * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param msixPackage The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return schema for MSIX Package properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - MsixPackageInner update(String resourceGroupName, String hostPoolName, String msixPackageFullName); + MsixPackageInner update(String resourceGroupName, String hostPoolName, String msixPackageFullName, + MsixPackagePatch msixPackage); /** - * List MSIX packages in hostpool. + * Remove an MSIX Package. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return msixPackageList as paginated response with {@link PagedFlux}. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName); /** - * List MSIX packages in hostpool. + * Remove an MSIX Package. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return msixPackageList as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String hostPoolName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName); /** - * List MSIX packages in hostpool. + * Remove an MSIX Package. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return msixPackageList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String hostPoolName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String hostPoolName, String msixPackageFullName, + Context context); /** - * List MSIX packages in hostpool. + * Remove an MSIX Package. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return msixPackageList as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String hostPoolName, String msixPackageFullName); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/OperationsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/OperationsClient.java index 4e4e5c418518..db8ba0797add 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/OperationsClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/OperationsClient.java @@ -16,33 +16,36 @@ */ public interface OperationsClient { /** - * List all of the available operations the Desktop Virtualization resource provider supports. + * List the operations for the provider. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations as paginated response with {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(); /** - * List all of the available operations the Desktop Virtualization resource provider supports. + * List the operations for the provider. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** - * List all of the available operations the Desktop Virtualization resource provider supports. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/PrivateEndpointConnectionsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/PrivateEndpointConnectionsClient.java index 77454f1695e5..b6a6106a6166 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/PrivateEndpointConnectionsClient.java @@ -11,7 +11,6 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionWithSystemDataInner; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; import reactor.core.publisher.Mono; /** @@ -19,515 +18,488 @@ */ public interface PrivateEndpointConnectionsClient { /** - * List private endpoint connections. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedFlux}. + * @return a PrivateEndpointConnectionWithSystemData as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByWorkspaceAsync(String resourceGroupName, - String workspaceName); + PagedFlux listByHostPoolAsync(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip); /** - * List private endpoint connections. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @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 list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * @return a PrivateEndpointConnectionWithSystemData as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByWorkspace(String resourceGroupName, - String workspaceName); + PagedFlux listByHostPoolAsync(String resourceGroupName, + String hostPoolName); /** - * List private endpoint connections. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. + * @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 list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * @return a PrivateEndpointConnectionWithSystemData as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByWorkspace(String resourceGroupName, - String workspaceName, Context context); + PagedIterable listByHostPool(String resourceGroupName, + String hostPoolName); /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + * @return a PrivateEndpointConnectionWithSystemData as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByWorkspaceWithResponseAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHostPool(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection on successful completion of {@link Mono}. + * @return a PrivateEndpointConnectionWithSystemData along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByWorkspaceAsync(String resourceGroupName, - String workspaceName, String privateEndpointConnectionName); + Mono> getByHostPoolWithResponseAsync( + String resourceGroupName, String hostPoolName, String privateEndpointConnectionName); /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param context The context to associate with this operation. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection along with {@link Response}. + * @return a PrivateEndpointConnectionWithSystemData on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByWorkspaceWithResponse(String resourceGroupName, - String workspaceName, String privateEndpointConnectionName, Context context); + Mono getByHostPoolAsync(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName); /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return a PrivateEndpointConnectionWithSystemData along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionWithSystemDataInner getByWorkspace(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName); + Response getByHostPoolWithResponse(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, Context context); /** - * Remove a connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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}. + * @return a PrivateEndpointConnectionWithSystemData. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteByWorkspaceWithResponseAsync(String resourceGroupName, String workspaceName, + PrivateEndpointConnectionWithSystemDataInner getByHostPool(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName); /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteByWorkspaceAsync(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName); + Mono> updateByHostPoolWithResponseAsync( + String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection); /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param context The context to associate with this operation. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteByWorkspaceWithResponse(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName, Context context); + Mono updateByHostPoolAsync(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection); /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteByWorkspace(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + Response updateByHostPoolWithResponse(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection, Context context); /** - * Approve or reject a private endpoint connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return the Private Endpoint Connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateByWorkspaceWithResponseAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, - PrivateEndpointConnection connection); + PrivateEndpointConnectionWithSystemDataInner updateByHostPool(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName, PrivateEndpointConnectionWithSystemDataInner connection); /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateByWorkspaceAsync(String resourceGroupName, - String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnection connection); + Mono> deleteByHostPoolWithResponseAsync(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName); /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. - * @param context The context to associate with this operation. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateByWorkspaceWithResponse(String resourceGroupName, - String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnection connection, - Context context); + Mono deleteByHostPoolAsync(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName); /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionWithSystemDataInner updateByWorkspace(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName, PrivateEndpointConnection connection); + Response deleteByHostPoolWithResponse(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName, Context context); /** - * List private endpoint connections associated with hostpool. + * Delete a PrivateEndpointConnectionWithSystemData. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByHostPoolAsync(String resourceGroupName, - String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip); + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteByHostPool(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName); /** - * List private endpoint connections associated with hostpool. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedFlux}. + * @return a PrivateEndpointConnectionWithSystemData as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByHostPoolAsync(String resourceGroupName, - String hostPoolName); + PagedFlux listByWorkspaceAsync(String resourceGroupName, + String workspaceName); /** - * List private endpoint connections associated with hostpool. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * @return a PrivateEndpointConnectionWithSystemData as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHostPool(String resourceGroupName, - String hostPoolName); + PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName); /** - * List private endpoint connections associated with hostpool. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * @return a PrivateEndpointConnectionWithSystemData as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHostPool(String resourceGroupName, - String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName, Context context); /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + * @return a PrivateEndpointConnectionWithSystemData along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByHostPoolWithResponseAsync( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName); + Mono> getByWorkspaceWithResponseAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName); /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection on successful completion of {@link Mono}. + * @return a PrivateEndpointConnectionWithSystemData on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByHostPoolAsync(String resourceGroupName, String hostPoolName, - String privateEndpointConnectionName); + Mono getByWorkspaceAsync(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName); /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection along with {@link Response}. + * @return a PrivateEndpointConnectionWithSystemData along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByHostPoolWithResponse(String resourceGroupName, - String hostPoolName, String privateEndpointConnectionName, Context context); + Response getByWorkspaceWithResponse(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, Context context); /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return a PrivateEndpointConnectionWithSystemData. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionWithSystemDataInner getByHostPool(String resourceGroupName, String hostPoolName, + PrivateEndpointConnectionWithSystemDataInner getByWorkspace(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteByHostPoolWithResponseAsync(String resourceGroupName, String hostPoolName, - String privateEndpointConnectionName); + Mono> updateByWorkspaceWithResponseAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection); /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteByHostPoolAsync(String resourceGroupName, String hostPoolName, - String privateEndpointConnectionName); + Mono updateByWorkspaceAsync(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection); /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the Private Endpoint Connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteByHostPoolWithResponse(String resourceGroupName, String hostPoolName, - String privateEndpointConnectionName, Context context); + Response updateByWorkspaceWithResponse(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection, Context context); /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteByHostPool(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName); + PrivateEndpointConnectionWithSystemDataInner updateByWorkspace(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionWithSystemDataInner connection); /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateByHostPoolWithResponseAsync( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, - PrivateEndpointConnection connection); + Mono> deleteByWorkspaceWithResponseAsync(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName); /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateByHostPoolAsync(String resourceGroupName, - String hostPoolName, String privateEndpointConnectionName, PrivateEndpointConnection connection); + Mono deleteByWorkspaceAsync(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName); /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateByHostPoolWithResponse(String resourceGroupName, - String hostPoolName, String privateEndpointConnectionName, PrivateEndpointConnection connection, - Context context); + Response deleteByWorkspaceWithResponse(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, Context context); /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionWithSystemDataInner updateByHostPool(String resourceGroupName, String hostPoolName, - String privateEndpointConnectionName, PrivateEndpointConnection connection); + void deleteByWorkspace(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/PrivateLinkResourcesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/PrivateLinkResourcesClient.java index a88d8ebd9344..d60c06c065bb 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/PrivateLinkResourcesClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/PrivateLinkResourcesClient.java @@ -16,10 +16,10 @@ */ public interface PrivateLinkResourcesClient { /** - * List the private link resources available for this workspace. + * List the private link resources available for this hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -29,40 +29,40 @@ public interface PrivateLinkResourcesClient { * @return a list of private link resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, + PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip); /** - * List the private link resources available for this workspace. + * List the private link resources available for this hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @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 list of private link resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName); + PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName); /** - * List the private link resources available for this workspace. + * List the private link resources available for this hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @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 list of private link resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); /** - * List the private link resources available for this workspace. + * List the private link resources available for this hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -73,14 +73,14 @@ PagedFlux listByWorkspaceAsync(String resourceGroupNam * @return a list of private link resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** - * List the private link resources available for this hostpool. + * List the private link resources available for this workspace. * * @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 workspaceName The name of the workspace. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -90,40 +90,40 @@ PagedIterable listByWorkspace(String resourceGroupName * @return a list of private link resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, + PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip); /** - * List the private link resources available for this hostpool. + * List the private link resources available for this workspace. * * @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 workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of private link resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName); + PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName); /** - * List the private link resources available for this hostpool. + * List the private link resources available for this workspace. * * @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 workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of private link resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); /** - * List the private link resources available for this hostpool. + * List the private link resources available for this workspace. * * @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 workspaceName The name of the workspace. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -134,6 +134,6 @@ PagedFlux listByHostPoolAsync(String resourceGroupName * @return a list of private link resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlanPersonalSchedulesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlanPersonalSchedulesClient.java index c528c5d02e59..e0ffc539107a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlanPersonalSchedulesClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlanPersonalSchedulesClient.java @@ -18,6 +18,67 @@ * An instance of this class provides access to all the operations defined in ScalingPlanPersonalSchedulesClient. */ public interface ScalingPlanPersonalSchedulesClient { + /** + * List ScalingPlanPersonalSchedules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ScalingPlanPersonalSchedule definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip); + + /** + * List ScalingPlanPersonalSchedules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ScalingPlanPersonalSchedule definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String scalingPlanName); + + /** + * List ScalingPlanPersonalSchedules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ScalingPlanPersonalSchedule definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String scalingPlanName); + + /** + * List ScalingPlanPersonalSchedules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ScalingPlanPersonalSchedule definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + /** * Get a ScalingPlanPersonalSchedule. * @@ -145,71 +206,13 @@ Response createWithResponse(String resourceGro ScalingPlanPersonalScheduleInner create(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule); - /** - * Remove a ScalingPlanPersonalSchedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 scalingPlanName, - String scalingPlanScheduleName); - - /** - * Remove a ScalingPlanPersonalSchedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 deleteAsync(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); - - /** - * Remove a ScalingPlanPersonalSchedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, - Context context); - - /** - * Remove a ScalingPlanPersonalSchedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); - /** * Update a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule definitions. + * @param scalingPlanSchedule The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -241,7 +244,7 @@ Mono updateAsync(String resourceGroupName, Str * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule definitions. + * @param scalingPlanSchedule The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -268,63 +271,60 @@ ScalingPlanPersonalScheduleInner update(String resourceGroupName, String scaling String scalingPlanScheduleName); /** - * List ScalingPlanPersonalSchedules. + * Remove a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPersonalScheduleList as paginated response with {@link PagedFlux}. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String scalingPlanName, - Integer pageSize, Boolean isDescending, Integer initialSkip); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName); /** - * List ScalingPlanPersonalSchedules. + * Remove a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPersonalScheduleList as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String scalingPlanName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); /** - * List ScalingPlanPersonalSchedules. + * Remove a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPersonalScheduleList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String scalingPlanName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, + Context context); /** - * List ScalingPlanPersonalSchedules. + * Remove a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPersonalScheduleList as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String scalingPlanName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlanPooledSchedulesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlanPooledSchedulesClient.java index f84ced4c32ed..105c17ef932b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlanPooledSchedulesClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlanPooledSchedulesClient.java @@ -18,6 +18,67 @@ * An instance of this class provides access to all the operations defined in ScalingPlanPooledSchedulesClient. */ public interface ScalingPlanPooledSchedulesClient { + /** + * List ScalingPlanPooledSchedules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ScalingPlanPooledSchedule definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip); + + /** + * List ScalingPlanPooledSchedules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ScalingPlanPooledSchedule definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String scalingPlanName); + + /** + * List ScalingPlanPooledSchedules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ScalingPlanPooledSchedule definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String scalingPlanName); + + /** + * List ScalingPlanPooledSchedules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ScalingPlanPooledSchedule definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + /** * Get a ScalingPlanPooledSchedule. * @@ -145,71 +206,13 @@ Response createWithResponse(String resourceGroup ScalingPlanPooledScheduleInner create(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule); - /** - * Remove a ScalingPlanPooledSchedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 scalingPlanName, - String scalingPlanScheduleName); - - /** - * Remove a ScalingPlanPooledSchedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 deleteAsync(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); - - /** - * Remove a ScalingPlanPooledSchedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, - Context context); - - /** - * Remove a ScalingPlanPooledSchedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); - /** * Update a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param scalingPlanSchedule Object containing ScalingPlanPooledSchedule definitions. + * @param scalingPlanSchedule The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -241,7 +244,7 @@ Mono updateAsync(String resourceGroupName, Strin * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param scalingPlanSchedule Object containing ScalingPlanPooledSchedule definitions. + * @param scalingPlanSchedule The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -268,63 +271,60 @@ ScalingPlanPooledScheduleInner update(String resourceGroupName, String scalingPl String scalingPlanScheduleName); /** - * List ScalingPlanPooledSchedules. + * Remove a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPooledScheduleList as paginated response with {@link PagedFlux}. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String scalingPlanName, - Integer pageSize, Boolean isDescending, Integer initialSkip); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName); /** - * List ScalingPlanPooledSchedules. + * Remove a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPooledScheduleList as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String scalingPlanName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); /** - * List ScalingPlanPooledSchedules. + * Remove a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPooledScheduleList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String scalingPlanName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, + Context context); /** - * List ScalingPlanPooledSchedules. + * Remove a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPooledScheduleList as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String scalingPlanName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlansClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlansClient.java index dfc4abf4e6aa..53f1ff4aa03a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlansClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlansClient.java @@ -19,392 +19,394 @@ */ public interface ScalingPlansClient { /** - * Get a scaling plan. + * List scaling plans in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a scaling plan along with {@link Response} on successful completion of {@link Mono}. + * @return list of scaling plan definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String scalingPlanName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip); /** - * Get a scaling plan. + * List scaling plans in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a scaling plan on successful completion of {@link Mono}. + * @return list of scaling plan definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String scalingPlanName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); /** - * Get a scaling plan. + * List scaling plans in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a scaling plan along with {@link Response}. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String scalingPlanName, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Get a scaling plan. + * List scaling plans in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a scaling plan. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScalingPlanInner getByResourceGroup(String resourceGroupName, String scalingPlanName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** - * Create or update a scaling plan. + * List scaling plan associated with hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param scalingPlan Object containing scaling plan definitions. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlan along with {@link Response} on successful completion of {@link Mono}. + * @return list of scaling plan definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync(String resourceGroupName, String scalingPlanName, - ScalingPlanInner scalingPlan); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip); /** - * Create or update a scaling plan. + * List scaling plan associated with hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param scalingPlan Object containing scaling plan definitions. + * @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 scalingPlan on successful completion of {@link Mono}. + * @return list of scaling plan definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync(String resourceGroupName, String scalingPlanName, ScalingPlanInner scalingPlan); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName); /** - * Create or update a scaling plan. + * List scaling plan associated with hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param scalingPlan Object containing scaling plan definitions. - * @param context The context to associate with this operation. + * @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 scalingPlan along with {@link Response}. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String resourceGroupName, String scalingPlanName, - ScalingPlanInner scalingPlan, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); /** - * Create or update a scaling plan. + * List scaling plan associated with hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param scalingPlan Object containing scaling plan definitions. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlan. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScalingPlanInner create(String resourceGroupName, String scalingPlanName, ScalingPlanInner scalingPlan); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** - * Remove a scaling plan. + * List scaling plans. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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}. + * @return list of scaling plan definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip); /** - * Remove a scaling plan. + * List scaling plans. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. + * @return list of scaling plan definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String scalingPlanName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName); /** - * Remove a scaling plan. + * List scaling plans. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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}. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String scalingPlanName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Remove a scaling plan. + * List scaling plans. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String scalingPlanName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** - * Update a scaling plan. + * Get a scaling plan. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param scalingPlan Object containing scaling plan 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 scalingPlan along with {@link Response} on successful completion of {@link Mono}. + * @return a scaling plan along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync(String resourceGroupName, String scalingPlanName, - ScalingPlanPatch scalingPlan); + Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String scalingPlanName); /** - * Update a scaling plan. + * Get a scaling plan. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlan on successful completion of {@link Mono}. + * @return a scaling plan on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String scalingPlanName); + Mono getByResourceGroupAsync(String resourceGroupName, String scalingPlanName); /** - * Update a scaling plan. + * Get a scaling plan. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param scalingPlan Object containing scaling plan 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 scalingPlan along with {@link Response}. + * @return a scaling plan along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String scalingPlanName, - ScalingPlanPatch scalingPlan, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String scalingPlanName, + Context context); /** - * Update a scaling plan. + * Get a scaling plan. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlan. + * @return a scaling plan. */ @ServiceMethod(returns = ReturnType.SINGLE) - ScalingPlanInner update(String resourceGroupName, String scalingPlanName); + ScalingPlanInner getByResourceGroup(String resourceGroupName, String scalingPlanName); /** - * List scaling plans. + * Create or update a scaling plan. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param scalingPlanName The name of the scaling plan. + * @param scalingPlan Object containing scaling plan 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 scalingPlanList as paginated response with {@link PagedFlux}. + * @return represents a scaling plan definition along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createWithResponseAsync(String resourceGroupName, String scalingPlanName, + ScalingPlanInner scalingPlan); /** - * List scaling plans. + * Create or update a scaling plan. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @param scalingPlan Object containing scaling plan 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 scalingPlanList as paginated response with {@link PagedFlux}. + * @return represents a scaling plan definition on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAsync(String resourceGroupName, String scalingPlanName, ScalingPlanInner scalingPlan); /** - * List scaling plans. + * Create or update a scaling plan. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @param scalingPlan Object containing scaling plan 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 scalingPlanList as paginated response with {@link PagedIterable}. + * @return represents a scaling plan definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String scalingPlanName, + ScalingPlanInner scalingPlan, Context context); /** - * List scaling plans. + * Create or update a scaling plan. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param scalingPlanName The name of the scaling plan. + * @param scalingPlan Object containing scaling plan 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 scalingPlanList as paginated response with {@link PagedIterable}. + * @return represents a scaling plan definition. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ScalingPlanInner create(String resourceGroupName, String scalingPlanName, ScalingPlanInner scalingPlan); /** - * List scaling plans in subscription. + * Update a scaling plan. * - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @param scalingPlan The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedFlux}. + * @return represents a scaling plan definition along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> updateWithResponseAsync(String resourceGroupName, String scalingPlanName, + ScalingPlanPatch scalingPlan); /** - * List scaling plans in subscription. + * Update a scaling plan. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedFlux}. + * @return represents a scaling plan definition on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String scalingPlanName); /** - * List scaling plans in subscription. + * Update a scaling plan. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @param scalingPlan The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedIterable}. + * @return represents a scaling plan definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String scalingPlanName, + ScalingPlanPatch scalingPlan, Context context); /** - * List scaling plans in subscription. + * Update a scaling plan. * - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedIterable}. + * @return represents a scaling plan definition. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ScalingPlanInner update(String resourceGroupName, String scalingPlanName); /** - * List scaling plan associated with hostpool. + * Remove a scaling plan. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedFlux}. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName); /** - * List scaling plan associated with hostpool. + * Remove a scaling plan. * * @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 scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String scalingPlanName); /** - * List scaling plan associated with hostpool. + * Remove a scaling plan. * * @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 scalingPlanName The name of the scaling plan. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String scalingPlanName, Context context); /** - * List scaling plan associated with hostpool. + * Remove a scaling plan. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String scalingPlanName); } 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..b94e4c62811f --- /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 { + /** + * 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 list of SessionHostConfiguration definitions 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 list of SessionHostConfiguration definitions 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 list of SessionHostConfiguration definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHostPool(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 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); + + /** + * 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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties 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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of schema for SessionHostConfiguration properties. + */ + @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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of schema for SessionHostConfiguration properties. + */ + @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 Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of schema for SessionHostConfiguration properties. + */ + @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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties 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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties. + */ + @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 Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties. + */ + @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 The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties 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 The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of schema for SessionHostConfiguration properties. + */ + @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 schema for SessionHostConfiguration properties. + */ + @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 schema for SessionHostConfiguration properties. + */ + @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 The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of schema for SessionHostConfiguration properties. + */ + @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 The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties 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 schema for SessionHostConfiguration properties 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 schema for SessionHostConfiguration properties. + */ + @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 The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionHostConfigurationInner update(String resourceGroupName, String hostPoolName, + SessionHostConfigurationPatch sessionHostConfiguration, 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..c1390ab9d5f4 --- /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 { + /** + * List SessionHostManagements. + * + * @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 list of SessionHostManagement definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName); + + /** + * List SessionHostManagements. + * + * @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 list of SessionHostManagement definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); + + /** + * List SessionHostManagements. + * + * @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 list of SessionHostManagement definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHostPool(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 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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostManagement properties 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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostManagement properties 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 Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostManagement properties 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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostManagement properties. + */ + @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 The properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostManagement properties 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 schema for SessionHostManagement properties 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 The properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostManagement properties 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 schema for SessionHostManagement properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionHostManagementInner update(String resourceGroupName, String hostPoolName); +} 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..291e81551dc6 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostManagementsUpdateStatusClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 a SessionHostManagementUpdateStatus. + * + * @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 SessionHostManagementUpdateStatus along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, + String hostPoolName); + + /** + * Get a SessionHostManagementUpdateStatus. + * + * @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 SessionHostManagementUpdateStatus on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String hostPoolName); + + /** + * Get a SessionHostManagementUpdateStatus. + * + * @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 SessionHostManagementUpdateStatus along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context); + + /** + * Get a SessionHostManagementUpdateStatus. + * + * @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 SessionHostManagementUpdateStatus. + */ + @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/SessionHostsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostsClient.java index f4ef87604a59..a0e7ef5c9dca 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 @@ -18,6 +18,69 @@ * An instance of this class provides access to all the operations defined in SessionHostsClient. */ public interface SessionHostsClient { + /** + * List sessionHosts. + * + * @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 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. + * @return list of SessionHost definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, String vmPath); + + /** + * List sessionHosts. + * + * @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 list of SessionHost definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String hostPoolName); + + /** + * List sessionHosts. + * + * @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 list of SessionHost definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String hostPoolName); + + /** + * List sessionHosts. + * + * @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 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SessionHost definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, String vmPath, Context context); + /** * Get a session host. * @@ -78,23 +141,24 @@ Response getWithResponse(String resourceGroupName, String host SessionHostInner get(String resourceGroupName, String hostPoolName, String sessionHostname); /** - * Remove a SessionHost. + * Update a session host. * * @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 force Force flag to force sessionHost deletion even when userSession exists. + * @param force Force flag to update assign, unassign or reassign personal desktop. + * @param sessionHost The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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}. + * @return represents a SessionHost definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, String sessionHostname, - Boolean force); + Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, Boolean force, SessionHostPatch sessionHost); /** - * Remove a SessionHost. + * Update a session host. * * @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. @@ -102,30 +166,31 @@ Mono> deleteWithResponseAsync(String resourceGroupName, String ho * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. + * @return represents a SessionHost definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String hostPoolName, String sessionHostname); + Mono updateAsync(String resourceGroupName, String hostPoolName, String sessionHostname); /** - * Remove a SessionHost. + * Update a session host. * * @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 force Force flag to force sessionHost deletion even when userSession exists. + * @param force Force flag to update assign, unassign or reassign personal desktop. + * @param sessionHost The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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}. + * @return represents a SessionHost definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, - Boolean force, Context context); + Response updateWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Boolean force, SessionHostPatch sessionHost, Context context); /** - * Remove a SessionHost. + * Update a session host. * * @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. @@ -133,29 +198,29 @@ Response deleteWithResponse(String resourceGroupName, String hostPoolName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 SessionHost definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String hostPoolName, String sessionHostname); + SessionHostInner update(String resourceGroupName, String hostPoolName, String sessionHostname); /** - * Update a session host. + * Remove 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 force Force flag to update assign, unassign or reassign personal desktop. - * @param sessionHost Object containing SessionHost definitions. + * @param force Force flag to force sessionHost deletion even when userSession exists. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 SessionHost definition along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, - String sessionHostname, Boolean force, SessionHostPatch sessionHost); + Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, String sessionHostname, + Boolean force); /** - * Update a session host. + * Remove 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. @@ -163,31 +228,30 @@ Mono> updateWithResponseAsync(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 SessionHost definition on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String hostPoolName, String sessionHostname); + Mono deleteAsync(String resourceGroupName, String hostPoolName, String sessionHostname); /** - * Update a session host. + * Remove 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 force Force flag to update assign, unassign or reassign personal desktop. - * @param sessionHost Object containing SessionHost definitions. + * @param force Force flag to force sessionHost deletion even when userSession exists. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 SessionHost definition along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, - Boolean force, SessionHostPatch sessionHost, Context context); + Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Boolean force, Context context); /** - * Update a session host. + * Remove 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. @@ -195,69 +259,65 @@ Response updateWithResponse(String resourceGroupName, String h * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 SessionHost definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - SessionHostInner update(String resourceGroupName, String hostPoolName, String sessionHostname); + void delete(String resourceGroupName, String hostPoolName, String sessionHostname); /** - * List sessionHosts. + * A synchronous resource action that returns no content. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @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 sessionHostList as paginated response with {@link PagedFlux}. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> retryProvisioningWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname); /** - * List sessionHosts. + * A synchronous resource action that returns no content. * * @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 sessionHostList as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String hostPoolName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono retryProvisioningAsync(String resourceGroupName, String hostPoolName, String sessionHostname); /** - * List sessionHosts. + * A synchronous resource action that returns no content. * * @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 sessionHostList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String hostPoolName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response retryProvisioningWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Context context); /** - * List sessionHosts. + * A synchronous resource action that returns no content. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @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 sessionHostList as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context); + @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/StartMenuItemsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/StartMenuItemsClient.java index fe8b1c358d8f..b6015c9c3918 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/StartMenuItemsClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/StartMenuItemsClient.java @@ -26,7 +26,7 @@ public interface StartMenuItemsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return startMenuItemList as paginated response with {@link PagedFlux}. + * @return list of StartMenuItem definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(String resourceGroupName, String applicationGroupName, Integer pageSize, @@ -40,7 +40,7 @@ PagedFlux listAsync(String resourceGroupName, String applica * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return startMenuItemList as paginated response with {@link PagedFlux}. + * @return list of StartMenuItem definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(String resourceGroupName, String applicationGroupName); @@ -53,7 +53,7 @@ PagedFlux listAsync(String resourceGroupName, String applica * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return startMenuItemList as paginated response with {@link PagedIterable}. + * @return list of StartMenuItem definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String applicationGroupName); @@ -70,7 +70,7 @@ PagedFlux listAsync(String resourceGroupName, String applica * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return startMenuItemList as paginated response with {@link PagedIterable}. + * @return list of StartMenuItem definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/UserSessionsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/UserSessionsClient.java index 2af8408086a6..c0bcac58811d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/UserSessionsClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/UserSessionsClient.java @@ -23,17 +23,17 @@ public interface UserSessionsClient { * * @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 filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @param sessionHostname The name of the session host within the specified host pool. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList as paginated response with {@link PagedFlux}. + * @return list of UserSession definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, String filter, + PagedFlux listAsync(String resourceGroupName, String hostPoolName, String sessionHostname, Integer pageSize, Boolean isDescending, Integer initialSkip); /** @@ -41,33 +41,35 @@ PagedFlux listByHostPoolAsync(String resourceGroupName, String * * @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 userSessionList as paginated response with {@link PagedFlux}. + * @return list of UserSession definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName); + PagedFlux listAsync(String resourceGroupName, String hostPoolName, String sessionHostname); /** * List userSessions. * * @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 userSessionList as paginated response with {@link PagedIterable}. + * @return list of UserSession definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); + PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname); /** * List userSessions. * * @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 filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @param sessionHostname The name of the session host within the specified host pool. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -75,10 +77,10 @@ PagedFlux listByHostPoolAsync(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList as paginated response with {@link PagedIterable}. + * @return list of UserSession definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, String filter, + PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** @@ -210,88 +212,87 @@ Response deleteWithResponse(String resourceGroupName, String hostPoolName, void delete(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); /** - * List userSessions. + * Disconnect a userSession. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param userSessionId The name of the user session within the specified session host. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList as paginated response with {@link PagedFlux}. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String hostPoolName, String sessionHostname, - Integer pageSize, Boolean isDescending, Integer initialSkip); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> disconnectWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, String userSessionId); /** - * List userSessions. + * Disconnect a userSession. * * @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 userSessionId The name of the user session within the specified session host. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String hostPoolName, String sessionHostname); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono disconnectAsync(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId); /** - * List userSessions. + * Disconnect a userSession. * * @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 userSessionId The name of the user session within the specified session host. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname); + @ServiceMethod(returns = ReturnType.SINGLE) + Response disconnectWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, Context context); /** - * List userSessions. + * Disconnect a userSession. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param userSessionId The name of the user session within the specified session host. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void disconnect(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); /** - * Disconnect a userSession. + * Send a message to a user. * * @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 userSessionId The name of the user session within the specified session host. + * @param sendMessage The sendMessage parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> disconnectWithResponseAsync(String resourceGroupName, String hostPoolName, - String sessionHostname, String userSessionId); + Mono> sendMessageWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, String userSessionId, SendMessage sendMessage); /** - * Disconnect a userSession. + * Send a message to a user. * * @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. @@ -303,16 +304,17 @@ Mono> disconnectWithResponseAsync(String resourceGroupName, Strin * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono disconnectAsync(String resourceGroupName, String hostPoolName, String sessionHostname, + Mono sendMessageAsync(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); /** - * Disconnect a userSession. + * Send a message to a user. * * @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 userSessionId The name of the user session within the specified session host. + * @param sendMessage The sendMessage parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -320,11 +322,11 @@ Mono disconnectAsync(String resourceGroupName, String hostPoolName, String * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response disconnectWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, - String userSessionId, Context context); + Response sendMessageWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, SendMessage sendMessage, Context context); /** - * Disconnect a userSession. + * Send a message to a user. * * @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. @@ -335,70 +337,68 @@ Response disconnectWithResponse(String resourceGroupName, String hostPoolN * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void disconnect(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); + void sendMessage(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); /** - * Send a message to a user. + * A synchronous resource action. * * @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 userSessionId The name of the user session within the specified session host. - * @param sendMessage Object containing message includes title and message body. + * @param filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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}. + * @return list of UserSession definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> sendMessageWithResponseAsync(String resourceGroupName, String hostPoolName, - String sessionHostname, String userSessionId, SendMessage sendMessage); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip); /** - * Send a message to a user. + * A synchronous resource action. * * @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 userSessionId The name of the user session within the specified session host. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return list of UserSession definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono sendMessageAsync(String resourceGroupName, String hostPoolName, String sessionHostname, - String userSessionId); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName); /** - * Send a message to a user. + * A synchronous resource action. * * @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 userSessionId The name of the user session within the specified session host. - * @param sendMessage Object containing message includes title and message body. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return list of UserSession definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response sendMessageWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, - String userSessionId, SendMessage sendMessage, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); /** - * Send a message to a user. + * A synchronous resource action. * * @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 userSessionId The name of the user session within the specified session host. + * @param filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of UserSession definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void sendMessage(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/WorkspacesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/WorkspacesClient.java index 681d79eab9eb..6a44bf911d7e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/WorkspacesClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/WorkspacesClient.java @@ -19,176 +19,213 @@ */ public interface WorkspacesClient { /** - * Get a workspace. + * List workspaces in subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Workspace definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); + + /** + * List workspaces in subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Workspace definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List workspaces in subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Workspace definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List workspaces. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a workspace along with {@link Response} on successful completion of {@link Mono}. + * @return list of Workspace definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String workspaceName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, Boolean isDescending, + Integer initialSkip); /** - * Get a workspace. + * List workspaces. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a workspace on successful completion of {@link Mono}. + * @return list of Workspace definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String workspaceName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName); /** - * Get a workspace. + * List workspaces. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a workspace along with {@link Response}. + * @return list of Workspace definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Get a workspace. + * List workspaces. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a workspace. + * @return list of Workspace definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceInner getByResourceGroup(String resourceGroupName, String workspaceName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, + Integer initialSkip, Context context); /** - * Create or update a workspace. + * Get a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param workspace Object containing Workspace 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 Workspace definition along with {@link Response} on successful completion of {@link Mono}. + * @return a workspace along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String workspaceName, - WorkspaceInner workspace); + Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String workspaceName); /** - * Create or update a workspace. + * Get a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param workspace Object containing Workspace 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 Workspace definition on successful completion of {@link Mono}. + * @return a workspace on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, WorkspaceInner workspace); + Mono getByResourceGroupAsync(String resourceGroupName, String workspaceName); /** - * Create or update a workspace. + * Get a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param workspace Object containing Workspace 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 Workspace definition along with {@link Response}. + * @return a workspace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, - WorkspaceInner workspace, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, + Context context); /** - * Create or update a workspace. + * Get a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param workspace Object containing Workspace 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 Workspace definition. + * @return a workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner workspace); + WorkspaceInner getByResourceGroup(String resourceGroupName, String workspaceName); /** - * Remove a workspace. + * Create or update a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. + * @param workspace Object containing Workspace 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 Response} on successful completion of {@link Mono}. + * @return represents a Workspace definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName); + Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String workspaceName, + WorkspaceInner workspace); /** - * Remove a workspace. + * Create or update a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. + * @param workspace Object containing Workspace 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 A {@link Mono} that completes when a successful response is received. + * @return represents a Workspace definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String workspaceName); + Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, WorkspaceInner workspace); /** - * Remove a workspace. + * Create or update a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. + * @param workspace Object containing Workspace 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 Response}. + * @return represents a Workspace definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String workspaceName, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + WorkspaceInner workspace, Context context); /** - * Remove a workspace. + * Create or update a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. + * @param workspace Object containing Workspace 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 Workspace definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String workspaceName); + WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner workspace); /** * Update a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param workspace Object containing Workspace definitions. + * @param workspace The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -216,7 +253,7 @@ Mono> updateWithResponseAsync(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param workspace Object containing Workspace definitions. + * @param workspace The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -241,91 +278,54 @@ Response updateWithResponse(String resourceGroupName, String wor WorkspaceInner update(String resourceGroupName, String workspaceName); /** - * List workspaces. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, Boolean isDescending, - Integer initialSkip); - - /** - * List workspaces. + * Remove a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList as paginated response with {@link PagedFlux}. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName); /** - * List workspaces. + * Remove a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList as paginated response with {@link PagedIterable}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String workspaceName); /** - * List workspaces. + * Remove a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, - Integer initialSkip, Context context); - - /** - * List workspaces in subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * List workspaces in subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String workspaceName, Context context); /** - * List workspaces in subscription. + * Remove a workspace. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName); } 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..42bc893feb91 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ActiveSessionHostConfigurationInner.java @@ -0,0 +1,539 @@ +// 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; + +/** + * Schema for ActiveSessionHostConfiguration properties. + */ +@Fluent +public final class ActiveSessionHostConfigurationInner extends ProxyResource { + /* + * Detailed properties for ActiveSessionHostConfiguration + */ + 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 ActiveSessionHostConfiguration. + * + * @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 the HostPool. + * + * @return the imageInfo value. + */ + public ImageInfoProperties imageInfo() { + return this.innerProperties() == null ? null : this.innerProperties().imageInfo(); + } + + /** + * Set the imageInfo property: Image configurations of the 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..7019bd02301d --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ActiveSessionHostConfigurationProperties.java @@ -0,0 +1,596 @@ +// 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; + +/** + * Represents a ActiveSessionHostConfiguration definition. This has all of the sessionHostConfiguration properties + * except provisioningState. + */ +@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 the 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 the HostPool. + * + * @return the imageInfo value. + */ + public ImageInfoProperties imageInfo() { + return this.imageInfo; + } + + /** + * Set the imageInfo property: Image configurations of the 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/AppAttachPackageInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/AppAttachPackageInner.java index 62533c697736..c3355b7d9f7a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/AppAttachPackageInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/AppAttachPackageInner.java @@ -11,8 +11,11 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageProperties; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.FailHealthCheckOnStagingFailure; +import com.azure.resourcemanager.desktopvirtualization.models.ProvisioningState; import java.io.IOException; +import java.util.List; import java.util.Map; /** @@ -23,7 +26,7 @@ public final class AppAttachPackageInner extends Resource { /* * Detailed properties for App Attach Package */ - private AppAttachPackageProperties properties; + private AppAttachPackageProperties innerProperties = new AppAttachPackageProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -52,23 +55,12 @@ public AppAttachPackageInner() { } /** - * Get the properties property: Detailed properties for App Attach Package. + * Get the innerProperties property: Detailed properties for App Attach Package. * - * @return the properties value. + * @return the innerProperties value. */ - public AppAttachPackageProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Detailed properties for App Attach Package. - * - * @param properties the properties value to set. - * @return the AppAttachPackageInner object itself. - */ - public AppAttachPackageInner withProperties(AppAttachPackageProperties properties) { - this.properties = properties; - return this; + private AppAttachPackageProperties innerProperties() { + return this.innerProperties; } /** @@ -128,18 +120,193 @@ public AppAttachPackageInner withTags(Map tags) { return this; } + /** + * Get the provisioningState property: The provisioning state of the App Attach Package. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the image property: Detailed properties for App Attach Package. + * + * @return the image value. + */ + public AppAttachPackageInfoProperties image() { + return this.innerProperties() == null ? null : this.innerProperties().image(); + } + + /** + * Set the image property: Detailed properties for App Attach Package. + * + * @param image the image value to set. + * @return the AppAttachPackageInner object itself. + */ + public AppAttachPackageInner withImage(AppAttachPackageInfoProperties image) { + if (this.innerProperties() == null) { + this.innerProperties = new AppAttachPackageProperties(); + } + this.innerProperties().withImage(image); + return this; + } + + /** + * Get the hostPoolReferences property: List of Hostpool resource Ids. + * + * @return the hostPoolReferences value. + */ + public List hostPoolReferences() { + return this.innerProperties() == null ? null : this.innerProperties().hostPoolReferences(); + } + + /** + * Set the hostPoolReferences property: List of Hostpool resource Ids. + * + * @param hostPoolReferences the hostPoolReferences value to set. + * @return the AppAttachPackageInner object itself. + */ + public AppAttachPackageInner withHostPoolReferences(List hostPoolReferences) { + if (this.innerProperties() == null) { + this.innerProperties = new AppAttachPackageProperties(); + } + this.innerProperties().withHostPoolReferences(hostPoolReferences); + return this; + } + + /** + * Get the keyVaultUrl property: URL path to certificate name located in keyVault. + * + * @return the keyVaultUrl value. + */ + public String keyVaultUrl() { + return this.innerProperties() == null ? null : this.innerProperties().keyVaultUrl(); + } + + /** + * Set the keyVaultUrl property: URL path to certificate name located in keyVault. + * + * @param keyVaultUrl the keyVaultUrl value to set. + * @return the AppAttachPackageInner object itself. + */ + public AppAttachPackageInner withKeyVaultUrl(String keyVaultUrl) { + if (this.innerProperties() == null) { + this.innerProperties = new AppAttachPackageProperties(); + } + this.innerProperties().withKeyVaultUrl(keyVaultUrl); + return this; + } + + /** + * Get the failHealthCheckOnStagingFailure property: Parameter indicating how the health check should behave if this + * package fails staging. + * + * @return the failHealthCheckOnStagingFailure value. + */ + public FailHealthCheckOnStagingFailure failHealthCheckOnStagingFailure() { + return this.innerProperties() == null ? null : this.innerProperties().failHealthCheckOnStagingFailure(); + } + + /** + * Set the failHealthCheckOnStagingFailure property: Parameter indicating how the health check should behave if this + * package fails staging. + * + * @param failHealthCheckOnStagingFailure the failHealthCheckOnStagingFailure value to set. + * @return the AppAttachPackageInner object itself. + */ + public AppAttachPackageInner + withFailHealthCheckOnStagingFailure(FailHealthCheckOnStagingFailure failHealthCheckOnStagingFailure) { + if (this.innerProperties() == null) { + this.innerProperties = new AppAttachPackageProperties(); + } + this.innerProperties().withFailHealthCheckOnStagingFailure(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.innerProperties() == null ? null : this.innerProperties().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 AppAttachPackageInner object itself. + */ + public AppAttachPackageInner withPackageOwnerName(String packageOwnerName) { + if (this.innerProperties() == null) { + this.innerProperties = new AppAttachPackageProperties(); + } + this.innerProperties().withPackageOwnerName(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.innerProperties() == null ? null : this.innerProperties().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 AppAttachPackageInner object itself. + */ + public AppAttachPackageInner withPackageLookbackUrl(String packageLookbackUrl) { + if (this.innerProperties() == null) { + this.innerProperties = new AppAttachPackageProperties(); + } + this.innerProperties().withPackageLookbackUrl(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.innerProperties() == null ? null : this.innerProperties().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 AppAttachPackageInner object itself. + */ + public AppAttachPackageInner withCustomData(String customData) { + if (this.innerProperties() == null) { + this.innerProperties = new AppAttachPackageProperties(); + } + this.innerProperties().withCustomData(customData); + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (properties() == null) { + if (innerProperties() == null) { throw LOGGER.atError() .log(new IllegalArgumentException( - "Missing required property properties in model AppAttachPackageInner")); + "Missing required property innerProperties in model AppAttachPackageInner")); } else { - properties().validate(); + innerProperties().validate(); } } @@ -153,7 +320,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -185,7 +352,7 @@ public static AppAttachPackageInner fromJson(JsonReader jsonReader) throws IOExc Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedAppAttachPackageInner.withTags(tags); } else if ("properties".equals(fieldName)) { - deserializedAppAttachPackageInner.properties = AppAttachPackageProperties.fromJson(reader); + deserializedAppAttachPackageInner.innerProperties = AppAttachPackageProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedAppAttachPackageInner.systemData = SystemData.fromJson(reader); } else { 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/fluent/models/AppAttachPackageProperties.java similarity index 67% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/AppAttachPackageProperties.java index 9cfcd7110011..3422d986cf6b 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/fluent/models/AppAttachPackageProperties.java @@ -2,13 +2,16 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.desktopvirtualization.models; +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.AppAttachPackageInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.FailHealthCheckOnStagingFailure; +import com.azure.resourcemanager.desktopvirtualization.models.ProvisioningState; import java.io.IOException; import java.util.List; @@ -42,6 +45,21 @@ public final class AppAttachPackageProperties implements JsonSerializable writer.writeString(element)); - jsonWriter.writeStringField("managedBy", managedBy()); - jsonWriter.writeStringField("kind", kind()); - jsonWriter.writeJsonField("identity", identity()); - jsonWriter.writeJsonField("sku", sku()); - jsonWriter.writeJsonField("plan", plan()); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("managedBy", this.managedBy); + jsonWriter.writeJsonField("plan", this.plan); + jsonWriter.writeJsonField("sku", this.sku); return jsonWriter.writeEndObject(); } @@ -400,24 +489,22 @@ public static ApplicationGroupInner fromJson(JsonReader jsonReader) throws IOExc } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedApplicationGroupInner.withTags(tags); - } else if ("managedBy".equals(fieldName)) { - deserializedApplicationGroupInner.withManagedBy(reader.getString()); - } else if ("kind".equals(fieldName)) { - deserializedApplicationGroupInner.withKind(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGroupInner.innerProperties = ApplicationGroupProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedApplicationGroupInner.identity = ManagedServiceIdentity.fromJson(reader); } else if ("etag".equals(fieldName)) { deserializedApplicationGroupInner.etag = reader.getString(); - } else if ("identity".equals(fieldName)) { - deserializedApplicationGroupInner - .withIdentity(ResourceModelWithAllowedPropertySetIdentity.fromJson(reader)); - } else if ("sku".equals(fieldName)) { - deserializedApplicationGroupInner.withSku(ResourceModelWithAllowedPropertySetSku.fromJson(reader)); + } else if ("kind".equals(fieldName)) { + deserializedApplicationGroupInner.kind = reader.getString(); + } else if ("managedBy".equals(fieldName)) { + deserializedApplicationGroupInner.managedBy = reader.getString(); } else if ("plan".equals(fieldName)) { - deserializedApplicationGroupInner - .withPlan(ResourceModelWithAllowedPropertySetPlan.fromJson(reader)); + deserializedApplicationGroupInner.plan = Plan.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedApplicationGroupInner.sku = Sku.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedApplicationGroupInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedApplicationGroupInner.innerProperties = ApplicationGroupProperties.fromJson(reader); } else { reader.skipChildren(); } 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..742338050f6b 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 @@ -10,11 +10,8 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; +import com.azure.resourcemanager.desktopvirtualization.models.ExpandMsixImageProperties; import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; /** * Represents the definition of contents retrieved after expanding the MSIX Image. @@ -24,7 +21,7 @@ public final class ExpandMsixImageInner extends ProxyResource { /* * Detailed properties for ExpandMsixImage */ - private ExpandMsixImageProperties innerProperties; + private ExpandMsixImageProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -53,12 +50,23 @@ public ExpandMsixImageInner() { } /** - * Get the innerProperties property: Detailed properties for ExpandMsixImage. + * Get the properties property: Detailed properties for ExpandMsixImage. * - * @return the innerProperties value. + * @return the properties value. */ - private ExpandMsixImageProperties innerProperties() { - return this.innerProperties; + public ExpandMsixImageProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Detailed properties for ExpandMsixImage. + * + * @param properties the properties value to set. + * @return the ExpandMsixImageInner object itself. + */ + public ExpandMsixImageInner withProperties(ExpandMsixImageProperties properties) { + this.properties = properties; + return this; } /** @@ -100,361 +108,14 @@ public String id() { return this.id; } - /** - * Get the packageAlias property: Alias of MSIX Package. - * - * @return the packageAlias value. - */ - public String packageAlias() { - return this.innerProperties() == null ? null : this.innerProperties().packageAlias(); - } - - /** - * Set the packageAlias property: Alias of MSIX Package. - * - * @param packageAlias the packageAlias value to set. - * @return the ExpandMsixImageInner object itself. - */ - public ExpandMsixImageInner withPackageAlias(String packageAlias) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpandMsixImageProperties(); - } - this.innerProperties().withPackageAlias(packageAlias); - return this; - } - - /** - * Get the imagePath property: VHD/CIM image path on Network Share. - * - * @return the imagePath value. - */ - public String imagePath() { - return this.innerProperties() == null ? null : this.innerProperties().imagePath(); - } - - /** - * Set the imagePath property: VHD/CIM image path on Network Share. - * - * @param imagePath the imagePath value to set. - * @return the ExpandMsixImageInner object itself. - */ - public ExpandMsixImageInner withImagePath(String imagePath) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpandMsixImageProperties(); - } - this.innerProperties().withImagePath(imagePath); - return this; - } - - /** - * Get the packageName property: Package Name from appxmanifest.xml. - * - * @return the packageName value. - */ - public String packageName() { - return this.innerProperties() == null ? null : this.innerProperties().packageName(); - } - - /** - * Set the packageName property: Package Name from appxmanifest.xml. - * - * @param packageName the packageName value to set. - * @return the ExpandMsixImageInner object itself. - */ - public ExpandMsixImageInner withPackageName(String packageName) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpandMsixImageProperties(); - } - this.innerProperties().withPackageName(packageName); - return this; - } - - /** - * Get the packageFamilyName property: Package Family Name from appxmanifest.xml. Contains Package Name and - * Publisher name. - * - * @return the packageFamilyName value. - */ - public String packageFamilyName() { - return this.innerProperties() == null ? null : this.innerProperties().packageFamilyName(); - } - - /** - * Set the packageFamilyName property: Package Family Name from appxmanifest.xml. Contains Package Name and - * Publisher name. - * - * @param packageFamilyName the packageFamilyName value to set. - * @return the ExpandMsixImageInner object itself. - */ - public ExpandMsixImageInner withPackageFamilyName(String packageFamilyName) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpandMsixImageProperties(); - } - this.innerProperties().withPackageFamilyName(packageFamilyName); - return this; - } - - /** - * Get the packageFullName property: Package Full Name from appxmanifest.xml. - * - * @return the packageFullName value. - */ - public String packageFullName() { - return this.innerProperties() == null ? null : this.innerProperties().packageFullName(); - } - - /** - * Set the packageFullName property: Package Full Name from appxmanifest.xml. - * - * @param packageFullName the packageFullName value to set. - * @return the ExpandMsixImageInner object itself. - */ - public ExpandMsixImageInner withPackageFullName(String packageFullName) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpandMsixImageProperties(); - } - this.innerProperties().withPackageFullName(packageFullName); - return this; - } - - /** - * Get the displayName property: User friendly Name to be displayed in the portal. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: User friendly Name to be displayed in the portal. - * - * @param displayName the displayName value to set. - * @return the ExpandMsixImageInner object itself. - */ - public ExpandMsixImageInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpandMsixImageProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the packageRelativePath property: Relative Path to the package inside the image. - * - * @return the packageRelativePath value. - */ - public String packageRelativePath() { - return this.innerProperties() == null ? null : this.innerProperties().packageRelativePath(); - } - - /** - * Set the packageRelativePath property: Relative Path to the package inside the image. - * - * @param packageRelativePath the packageRelativePath value to set. - * @return the ExpandMsixImageInner object itself. - */ - public ExpandMsixImageInner withPackageRelativePath(String packageRelativePath) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpandMsixImageProperties(); - } - this.innerProperties().withPackageRelativePath(packageRelativePath); - return this; - } - - /** - * Get the isRegularRegistration property: Specifies how to register Package in feed. - * - * @return the isRegularRegistration value. - */ - public Boolean isRegularRegistration() { - return this.innerProperties() == null ? null : this.innerProperties().isRegularRegistration(); - } - - /** - * Set the isRegularRegistration property: Specifies how to register Package in feed. - * - * @param isRegularRegistration the isRegularRegistration value to set. - * @return the ExpandMsixImageInner object itself. - */ - public ExpandMsixImageInner withIsRegularRegistration(Boolean isRegularRegistration) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpandMsixImageProperties(); - } - this.innerProperties().withIsRegularRegistration(isRegularRegistration); - return this; - } - - /** - * Get the isActive property: Make this version of the package the active one across the hostpool. - * - * @return the isActive value. - */ - public Boolean isActive() { - return this.innerProperties() == null ? null : this.innerProperties().isActive(); - } - - /** - * Set the isActive property: Make this version of the package the active one across the hostpool. - * - * @param isActive the isActive value to set. - * @return the ExpandMsixImageInner object itself. - */ - public ExpandMsixImageInner withIsActive(Boolean isActive) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpandMsixImageProperties(); - } - this.innerProperties().withIsActive(isActive); - return this; - } - - /** - * Get the packageDependencies property: List of package dependencies. - * - * @return the packageDependencies value. - */ - public List packageDependencies() { - return this.innerProperties() == null ? null : this.innerProperties().packageDependencies(); - } - - /** - * Set the packageDependencies property: List of package dependencies. - * - * @param packageDependencies the packageDependencies value to set. - * @return the ExpandMsixImageInner object itself. - */ - public ExpandMsixImageInner withPackageDependencies(List packageDependencies) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpandMsixImageProperties(); - } - this.innerProperties().withPackageDependencies(packageDependencies); - return this; - } - - /** - * Get the version property: Package version found in the appxmanifest.xml. - * - * @return the version value. - */ - public String version() { - return this.innerProperties() == null ? null : this.innerProperties().version(); - } - - /** - * Set the version property: Package version found in the appxmanifest.xml. - * - * @param version the version value to set. - * @return the ExpandMsixImageInner object itself. - */ - public ExpandMsixImageInner withVersion(String version) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpandMsixImageProperties(); - } - this.innerProperties().withVersion(version); - return this; - } - - /** - * Get the lastUpdated property: Date Package was last updated, found in the appxmanifest.xml. - * - * @return the lastUpdated value. - */ - public OffsetDateTime lastUpdated() { - return this.innerProperties() == null ? null : this.innerProperties().lastUpdated(); - } - - /** - * Set the lastUpdated property: Date Package was last updated, found in the appxmanifest.xml. - * - * @param lastUpdated the lastUpdated value to set. - * @return the ExpandMsixImageInner object itself. - */ - public ExpandMsixImageInner withLastUpdated(OffsetDateTime lastUpdated) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpandMsixImageProperties(); - } - this.innerProperties().withLastUpdated(lastUpdated); - return this; - } - - /** - * Get the packageApplications property: List of package applications. - * - * @return the packageApplications value. - */ - public List packageApplications() { - return this.innerProperties() == null ? null : this.innerProperties().packageApplications(); - } - - /** - * Set the packageApplications property: List of package applications. - * - * @param packageApplications the packageApplications value to set. - * @return the ExpandMsixImageInner object itself. - */ - public ExpandMsixImageInner withPackageApplications(List packageApplications) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpandMsixImageProperties(); - } - this.innerProperties().withPackageApplications(packageApplications); - return this; - } - - /** - * Get the certificateName property: Certificate name found in the appxmanifest.xml. - * - * @return the certificateName value. - */ - public String certificateName() { - return this.innerProperties() == null ? null : this.innerProperties().certificateName(); - } - - /** - * Set the certificateName property: Certificate name found in the appxmanifest.xml. - * - * @param certificateName the certificateName value to set. - * @return the ExpandMsixImageInner object itself. - */ - public ExpandMsixImageInner withCertificateName(String certificateName) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpandMsixImageProperties(); - } - this.innerProperties().withCertificateName(certificateName); - return this; - } - - /** - * Get the certificateExpiry property: Date certificate expires, found in the appxmanifest.xml. - * - * @return the certificateExpiry value. - */ - public OffsetDateTime certificateExpiry() { - return this.innerProperties() == null ? null : this.innerProperties().certificateExpiry(); - } - - /** - * Set the certificateExpiry property: Date certificate expires, found in the appxmanifest.xml. - * - * @param certificateExpiry the certificateExpiry value to set. - * @return the ExpandMsixImageInner object itself. - */ - public ExpandMsixImageInner withCertificateExpiry(OffsetDateTime certificateExpiry) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpandMsixImageProperties(); - } - this.innerProperties().withCertificateExpiry(certificateExpiry); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -464,7 +125,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -491,7 +152,7 @@ public static ExpandMsixImageInner fromJson(JsonReader jsonReader) throws IOExce } else if ("type".equals(fieldName)) { deserializedExpandMsixImageInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedExpandMsixImageInner.innerProperties = ExpandMsixImageProperties.fromJson(reader); + deserializedExpandMsixImageInner.properties = ExpandMsixImageProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedExpandMsixImageInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolInner.java index 9c4860fd3e2e..571c1cc5a0cd 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolInner.java @@ -5,22 +5,27 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; 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.AgentUpdateProperties; -import com.azure.resourcemanager.desktopvirtualization.models.HostpoolPublicNetworkAccess; +import com.azure.resourcemanager.desktopvirtualization.models.DirectUdp; 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.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.PublicUdp; +import com.azure.resourcemanager.desktopvirtualization.models.RelayUdp; +import com.azure.resourcemanager.desktopvirtualization.models.Sku; import com.azure.resourcemanager.desktopvirtualization.models.SsoSecretType; import java.io.IOException; import java.util.List; @@ -30,25 +35,54 @@ * Represents a HostPool definition. */ @Fluent -public final class HostPoolInner extends ResourceModelWithAllowedPropertySet { +public final class HostPoolInner extends Resource { /* * Detailed properties for HostPool */ private HostPoolPropertiesInner innerProperties = new HostPoolPropertiesInner(); /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * The managed service identities assigned to this resource. */ - private SystemData systemData; + private ManagedServiceIdentity identity; /* - * The etag field is *not* required. If it is provided in the response body, it must also be provided as a header - * per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested - * resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section - * 14.26), and If-Range (section 14.27) header fields. + * If etag is provided in the response body, it may also be provided as a header per the normal etag convention. + * Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity + * tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section + * 14.27) header fields. */ private String etag; + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private String kind; + + /* + * The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed + * by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is + * removed from the template since it is managed by another resource. + */ + private String managedBy; + + /* + * Details of the resource plan. + */ + private Plan plan; + + /* + * The SKU (Stock Keeping Unit) assigned to this resource. + */ + private Sku sku; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -80,101 +114,162 @@ private HostPoolPropertiesInner innerProperties() { } /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Get the identity property: The managed service identities assigned to this resource. * - * @return the systemData value. + * @return the identity value. */ - @Override - public SystemData systemData() { - return this.systemData; + public ManagedServiceIdentity identity() { + return this.identity; } /** - * Get the etag property: The etag field is *not* required. If it is provided in the response body, it must also be - * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from - * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), - * If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the HostPoolInner object itself. + */ + public HostPoolInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the etag property: If etag is provided in the response body, it may also be provided as a header per the + * normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. + * HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), + * and If-Range (section 14.27) header fields. * * @return the etag value. */ - @Override public String etag() { return this.etag; } /** - * Get the type property: The type of the resource. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * - * @return the type value. + * @return the kind value. */ - @Override - public String type() { - return this.type; + public String kind() { + return this.kind; } /** - * Get the name property: The name of the resource. + * Set the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * - * @return the name value. + * @param kind the kind value to set. + * @return the HostPoolInner object itself. */ - @Override - public String name() { - return this.name; + public HostPoolInner withKind(String kind) { + this.kind = kind; + return this; } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the managedBy property: The fully qualified resource ID of the resource that manages this resource. Indicates + * if this resource is managed by another Azure resource. If this is present, complete mode deployment will not + * delete the resource if it is removed from the template since it is managed by another resource. * - * @return the id value. + * @return the managedBy value. */ - @Override - public String id() { - return this.id; + public String managedBy() { + return this.managedBy; } /** - * {@inheritDoc} + * Set the managedBy property: The fully qualified resource ID of the resource that manages this resource. Indicates + * if this resource is managed by another Azure resource. If this is present, complete mode deployment will not + * delete the resource if it is removed from the template since it is managed by another resource. + * + * @param managedBy the managedBy value to set. + * @return the HostPoolInner object itself. */ - @Override public HostPoolInner withManagedBy(String managedBy) { - super.withManagedBy(managedBy); + this.managedBy = managedBy; return this; } /** - * {@inheritDoc} + * Get the plan property: Details of the resource plan. + * + * @return the plan value. */ - @Override - public HostPoolInner withKind(String kind) { - super.withKind(kind); + public Plan plan() { + return this.plan; + } + + /** + * Set the plan property: Details of the resource plan. + * + * @param plan the plan value to set. + * @return the HostPoolInner object itself. + */ + public HostPoolInner withPlan(Plan plan) { + this.plan = plan; return this; } /** - * {@inheritDoc} + * Get the sku property: The SKU (Stock Keeping Unit) assigned to this resource. + * + * @return the sku value. */ - @Override - public HostPoolInner withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { - super.withIdentity(identity); + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU (Stock Keeping Unit) assigned to this resource. + * + * @param sku the sku value to set. + * @return the HostPoolInner object itself. + */ + public HostPoolInner withSku(Sku sku) { + this.sku = sku; return this; } /** - * {@inheritDoc} + * 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 HostPoolInner withSku(ResourceModelWithAllowedPropertySetSku sku) { - super.withSku(sku); - return this; + public String type() { + return this.type; } /** - * {@inheritDoc} + * Get the name property: The name of the resource. + * + * @return the name value. */ @Override - public HostPoolInner withPlan(ResourceModelWithAllowedPropertySetPlan plan) { - super.withPlan(plan); - return this; + 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; } /** @@ -687,12 +782,152 @@ public 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; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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 HostPoolInner object itself. + */ + public HostPoolInner withManagementType(ManagementType managementType) { + if (this.innerProperties() == null) { + this.innerProperties = new HostPoolPropertiesInner(); + } + this.innerProperties().withManagementType(managementType); + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() == null) { throw LOGGER.atError() @@ -703,12 +938,12 @@ public void validate() { if (identity() != null) { identity().validate(); } - if (sku() != null) { - sku().validate(); - } if (plan() != null) { plan().validate(); } + if (sku() != null) { + sku().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(HostPoolInner.class); @@ -721,12 +956,12 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("managedBy", managedBy()); - jsonWriter.writeStringField("kind", kind()); - jsonWriter.writeJsonField("identity", identity()); - jsonWriter.writeJsonField("sku", sku()); - jsonWriter.writeJsonField("plan", plan()); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("managedBy", this.managedBy); + jsonWriter.writeJsonField("plan", this.plan); + jsonWriter.writeJsonField("sku", this.sku); return jsonWriter.writeEndObject(); } @@ -757,23 +992,22 @@ public static HostPoolInner fromJson(JsonReader jsonReader) throws IOException { } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedHostPoolInner.withTags(tags); - } else if ("managedBy".equals(fieldName)) { - deserializedHostPoolInner.withManagedBy(reader.getString()); - } else if ("kind".equals(fieldName)) { - deserializedHostPoolInner.withKind(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedHostPoolInner.innerProperties = HostPoolPropertiesInner.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedHostPoolInner.identity = ManagedServiceIdentity.fromJson(reader); } else if ("etag".equals(fieldName)) { deserializedHostPoolInner.etag = reader.getString(); - } else if ("identity".equals(fieldName)) { - deserializedHostPoolInner - .withIdentity(ResourceModelWithAllowedPropertySetIdentity.fromJson(reader)); - } else if ("sku".equals(fieldName)) { - deserializedHostPoolInner.withSku(ResourceModelWithAllowedPropertySetSku.fromJson(reader)); + } else if ("kind".equals(fieldName)) { + deserializedHostPoolInner.kind = reader.getString(); + } else if ("managedBy".equals(fieldName)) { + deserializedHostPoolInner.managedBy = reader.getString(); } else if ("plan".equals(fieldName)) { - deserializedHostPoolInner.withPlan(ResourceModelWithAllowedPropertySetPlan.fromJson(reader)); + deserializedHostPoolInner.plan = Plan.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedHostPoolInner.sku = Sku.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedHostPoolInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedHostPoolInner.innerProperties = HostPoolPropertiesInner.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolPropertiesInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolPropertiesInner.java index da47368dadee..f00775fa7367 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolPropertiesInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolPropertiesInner.java @@ -11,12 +11,17 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.AgentUpdateProperties; -import com.azure.resourcemanager.desktopvirtualization.models.HostpoolPublicNetworkAccess; +import com.azure.resourcemanager.desktopvirtualization.models.DirectUdp; 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.RelayUdp; import com.azure.resourcemanager.desktopvirtualization.models.SsoSecretType; import java.io.IOException; import java.util.List; @@ -147,6 +152,43 @@ public final class HostPoolPropertiesInner 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; + + /* + * The type of management for this hostpool, Automated or Standard. The default value is Automated. + */ + private ManagementType managementType; + /** * Creates an instance of HostPoolPropertiesInner class. */ @@ -588,6 +630,132 @@ 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; + } + + /** + * 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; + } + /** * Validates the instance. * @@ -651,6 +819,13 @@ 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()); + jsonWriter.writeStringField("managementType", + this.managementType == null ? null : this.managementType.toString()); return jsonWriter.writeEndObject(); } @@ -727,6 +902,17 @@ 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 if ("managementType".equals(fieldName)) { + deserializedHostPoolPropertiesInner.managementType = ManagementType.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateEndpointConnectionWithSystemDataInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateEndpointConnectionWithSystemDataInner.java index 4843880c9de8..dba8289c7449 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateEndpointConnectionWithSystemDataInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateEndpointConnectionWithSystemDataInner.java @@ -5,12 +5,12 @@ 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.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpoint; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; import java.io.IOException; @@ -20,16 +20,16 @@ * The Private Endpoint Connection resource. */ @Fluent -public final class PrivateEndpointConnectionWithSystemDataInner extends PrivateEndpointConnection { +public final class PrivateEndpointConnectionWithSystemDataInner extends ProxyResource { /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * The resource-specific properties for this resource. */ - private SystemData systemData; + private PrivateEndpointConnectionProperties innerProperties; /* - * Resource properties. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private PrivateEndpointConnectionProperties innerProperties; + private SystemData systemData; /* * The type of the resource. @@ -53,22 +53,21 @@ public PrivateEndpointConnectionWithSystemDataInner() { } /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Get the innerProperties property: The resource-specific properties for this resource. * - * @return the systemData value. + * @return the innerProperties value. */ - @Override - public SystemData systemData() { - return this.systemData; + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; } /** - * Get the innerProperties property: Resource properties. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the innerProperties value. + * @return the systemData value. */ - private PrivateEndpointConnectionProperties innerProperties() { - return this.innerProperties; + public SystemData systemData() { + return this.systemData; } /** @@ -173,7 +172,6 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); @@ -186,7 +184,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", innerProperties()); + jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateLinkResourceInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateLinkResourceInner.java index 10863e24af40..e57b93c0fd71 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateLinkResourceInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateLinkResourceInner.java @@ -10,8 +10,8 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResourceProperties; import java.io.IOException; -import java.util.List; /** * A private link resource. @@ -21,7 +21,7 @@ public final class PrivateLinkResourceInner extends ProxyResource { /* * Resource properties. */ - private PrivateLinkResourceProperties innerProperties; + private PrivateLinkResourceProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -50,12 +50,23 @@ public PrivateLinkResourceInner() { } /** - * Get the innerProperties property: Resource properties. + * Get the properties property: Resource properties. * - * @return the innerProperties value. + * @return the properties value. */ - private PrivateLinkResourceProperties innerProperties() { - return this.innerProperties; + public PrivateLinkResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Resource properties. + * + * @param properties the properties value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withProperties(PrivateLinkResourceProperties properties) { + this.properties = properties; + return this; } /** @@ -97,55 +108,14 @@ public String id() { return this.id; } - /** - * Get the groupId property: The private link resource group id. - * - * @return the groupId value. - */ - public String groupId() { - return this.innerProperties() == null ? null : this.innerProperties().groupId(); - } - - /** - * Get the requiredMembers property: The private link resource required member names. - * - * @return the requiredMembers value. - */ - public List requiredMembers() { - return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); - } - - /** - * Get the requiredZoneNames property: The private link resource Private link DNS zone name. - * - * @return the requiredZoneNames value. - */ - public List requiredZoneNames() { - return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); - } - - /** - * Set the requiredZoneNames property: The private link resource Private link DNS zone name. - * - * @param requiredZoneNames the requiredZoneNames value to set. - * @return the PrivateLinkResourceInner object itself. - */ - public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateLinkResourceProperties(); - } - this.innerProperties().withRequiredZoneNames(requiredZoneNames); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -155,7 +125,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -182,8 +152,7 @@ public static PrivateLinkResourceInner fromJson(JsonReader jsonReader) throws IO } else if ("type".equals(fieldName)) { deserializedPrivateLinkResourceInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedPrivateLinkResourceInner.innerProperties - = PrivateLinkResourceProperties.fromJson(reader); + deserializedPrivateLinkResourceInner.properties = PrivateLinkResourceProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedPrivateLinkResourceInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/RegistrationTokenListInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/RegistrationTokenListInner.java index f33c65e10d74..a4cbcf6cbed8 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/RegistrationTokenListInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/RegistrationTokenListInner.java @@ -14,8 +14,6 @@ import java.util.List; /** - * RegistrationTokenList - * * List of RegistrationToken definitions. */ @Fluent 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..7e0044336753 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 @@ -5,47 +5,74 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; 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.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.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.ScalingSchedule; +import com.azure.resourcemanager.desktopvirtualization.models.Sku; import java.io.IOException; import java.util.List; import java.util.Map; /** - * ScalingPlan - * * Represents a scaling plan definition. */ @Fluent -public final class ScalingPlanInner extends ResourceModelWithAllowedPropertySet { +public final class ScalingPlanInner extends Resource { /* * Detailed properties for scaling plan. */ private ScalingPlanProperties innerProperties = new ScalingPlanProperties(); /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * The managed service identities assigned to this resource. */ - private SystemData systemData; + private ManagedServiceIdentity identity; /* - * The etag field is *not* required. If it is provided in the response body, it must also be provided as a header - * per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested - * resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section - * 14.26), and If-Range (section 14.27) header fields. + * If etag is provided in the response body, it may also be provided as a header per the normal etag convention. + * Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity + * tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section + * 14.27) header fields. */ private String etag; + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private String kind; + + /* + * The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed + * by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is + * removed from the template since it is managed by another resource. + */ + private String managedBy; + + /* + * Details of the resource plan. + */ + private Plan plan; + + /* + * The SKU (Stock Keeping Unit) assigned to this resource. + */ + private Sku sku; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -77,101 +104,162 @@ private ScalingPlanProperties innerProperties() { } /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Get the identity property: The managed service identities assigned to this resource. * - * @return the systemData value. + * @return the identity value. */ - @Override - public SystemData systemData() { - return this.systemData; + public ManagedServiceIdentity identity() { + return this.identity; } /** - * Get the etag property: The etag field is *not* required. If it is provided in the response body, it must also be - * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from - * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), - * If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the ScalingPlanInner object itself. + */ + public ScalingPlanInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the etag property: If etag is provided in the response body, it may also be provided as a header per the + * normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. + * HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), + * and If-Range (section 14.27) header fields. * * @return the etag value. */ - @Override public String etag() { return this.etag; } /** - * Get the type property: The type of the resource. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * - * @return the type value. + * @return the kind value. */ - @Override - public String type() { - return this.type; + public String kind() { + return this.kind; } /** - * Get the name property: The name of the resource. + * Set the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * - * @return the name value. + * @param kind the kind value to set. + * @return the ScalingPlanInner object itself. */ - @Override - public String name() { - return this.name; + public ScalingPlanInner withKind(String kind) { + this.kind = kind; + return this; } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the managedBy property: The fully qualified resource ID of the resource that manages this resource. Indicates + * if this resource is managed by another Azure resource. If this is present, complete mode deployment will not + * delete the resource if it is removed from the template since it is managed by another resource. * - * @return the id value. + * @return the managedBy value. */ - @Override - public String id() { - return this.id; + public String managedBy() { + return this.managedBy; } /** - * {@inheritDoc} + * Set the managedBy property: The fully qualified resource ID of the resource that manages this resource. Indicates + * if this resource is managed by another Azure resource. If this is present, complete mode deployment will not + * delete the resource if it is removed from the template since it is managed by another resource. + * + * @param managedBy the managedBy value to set. + * @return the ScalingPlanInner object itself. */ - @Override public ScalingPlanInner withManagedBy(String managedBy) { - super.withManagedBy(managedBy); + this.managedBy = managedBy; return this; } /** - * {@inheritDoc} + * Get the plan property: Details of the resource plan. + * + * @return the plan value. */ - @Override - public ScalingPlanInner withKind(String kind) { - super.withKind(kind); + public Plan plan() { + return this.plan; + } + + /** + * Set the plan property: Details of the resource plan. + * + * @param plan the plan value to set. + * @return the ScalingPlanInner object itself. + */ + public ScalingPlanInner withPlan(Plan plan) { + this.plan = plan; return this; } /** - * {@inheritDoc} + * Get the sku property: The SKU (Stock Keeping Unit) assigned to this resource. + * + * @return the sku value. */ - @Override - public ScalingPlanInner withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { - super.withIdentity(identity); + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU (Stock Keeping Unit) assigned to this resource. + * + * @param sku the sku value to set. + * @return the ScalingPlanInner object itself. + */ + public ScalingPlanInner withSku(Sku sku) { + this.sku = sku; return this; } /** - * {@inheritDoc} + * 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 ScalingPlanInner withSku(ResourceModelWithAllowedPropertySetSku sku) { - super.withSku(sku); - return this; + public String type() { + return this.type; } /** - * {@inheritDoc} + * Get the name property: The name of the resource. + * + * @return the name value. */ @Override - public ScalingPlanInner withPlan(ResourceModelWithAllowedPropertySetPlan plan) { - super.withPlan(plan); - return this; + 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; } /** @@ -367,7 +455,6 @@ public ScalingPlanInner withHostPoolReferences(List ho * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() == null) { throw LOGGER.atError() @@ -379,12 +466,12 @@ public void validate() { if (identity() != null) { identity().validate(); } - if (sku() != null) { - sku().validate(); - } if (plan() != null) { plan().validate(); } + if (sku() != null) { + sku().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(ScalingPlanInner.class); @@ -397,12 +484,12 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("managedBy", managedBy()); - jsonWriter.writeStringField("kind", kind()); - jsonWriter.writeJsonField("identity", identity()); - jsonWriter.writeJsonField("sku", sku()); - jsonWriter.writeJsonField("plan", plan()); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("managedBy", this.managedBy); + jsonWriter.writeJsonField("plan", this.plan); + jsonWriter.writeJsonField("sku", this.sku); return jsonWriter.writeEndObject(); } @@ -433,23 +520,22 @@ public static ScalingPlanInner fromJson(JsonReader jsonReader) throws IOExceptio } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedScalingPlanInner.withTags(tags); - } else if ("managedBy".equals(fieldName)) { - deserializedScalingPlanInner.withManagedBy(reader.getString()); - } else if ("kind".equals(fieldName)) { - deserializedScalingPlanInner.withKind(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedScalingPlanInner.innerProperties = ScalingPlanProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedScalingPlanInner.identity = ManagedServiceIdentity.fromJson(reader); } else if ("etag".equals(fieldName)) { deserializedScalingPlanInner.etag = reader.getString(); - } else if ("identity".equals(fieldName)) { - deserializedScalingPlanInner - .withIdentity(ResourceModelWithAllowedPropertySetIdentity.fromJson(reader)); - } else if ("sku".equals(fieldName)) { - deserializedScalingPlanInner.withSku(ResourceModelWithAllowedPropertySetSku.fromJson(reader)); + } else if ("kind".equals(fieldName)) { + deserializedScalingPlanInner.kind = reader.getString(); + } else if ("managedBy".equals(fieldName)) { + deserializedScalingPlanInner.managedBy = reader.getString(); } else if ("plan".equals(fieldName)) { - deserializedScalingPlanInner.withPlan(ResourceModelWithAllowedPropertySetPlan.fromJson(reader)); + deserializedScalingPlanInner.plan = Plan.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedScalingPlanInner.sku = Sku.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedScalingPlanInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedScalingPlanInner.innerProperties = ScalingPlanProperties.fromJson(reader); } else { reader.skipChildren(); } 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..aed63fad7579 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 @@ -102,6 +102,29 @@ 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(); + } + + /** + * Set the name property: Name of the ScalingPlanPooledSchedule. + * + * @param name the name value to set. + * @return the ScalingPlanPooledScheduleInner object itself. + */ + public ScalingPlanPooledScheduleInner withNamePropertiesName(String name) { + if (this.innerProperties() == null) { + this.innerProperties = new ScalingPlanPooledScheduleProperties(); + } + this.innerProperties().withName(name); + return this; + } + /** * Get the daysOfWeek property: Set of days of the week on which this schedule is active. * @@ -200,8 +223,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 +233,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 +363,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 +373,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/ScalingPlanPooledScheduleProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledScheduleProperties.java index 9c4a8262bcc5..88517ed7c27c 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,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; @@ -22,6 +23,11 @@ @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. */ @@ -45,7 +51,7 @@ public final class ScalingPlanPooledScheduleProperties /* * Capacity threshold for ramp up period. */ - private Integer rampUpCapacityThresholdPct; + private int rampUpCapacityThresholdPct; /* * Starting time for peak period. @@ -75,7 +81,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 +119,26 @@ public final class ScalingPlanPooledScheduleProperties public ScalingPlanPooledScheduleProperties() { } + /** + * Get the name property: Name of the ScalingPlanPooledSchedule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the ScalingPlanPooledSchedule. + * + * @param name the name value to set. + * @return the ScalingPlanPooledScheduleProperties object itself. + */ + public ScalingPlanPooledScheduleProperties withName(String name) { + this.name = name; + return this; + } + /** * Get the daysOfWeek property: Set of days of the week on which this schedule is active. * @@ -199,7 +225,7 @@ public ScalingPlanPooledScheduleProperties withRampUpMinimumHostsPct(Integer ram * * @return the rampUpCapacityThresholdPct value. */ - public Integer rampUpCapacityThresholdPct() { + public int rampUpCapacityThresholdPct() { return this.rampUpCapacityThresholdPct; } @@ -209,7 +235,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 +347,7 @@ public ScalingPlanPooledScheduleProperties withRampDownMinimumHostsPct(Integer r * * @return the rampDownCapacityThresholdPct value. */ - public Integer rampDownCapacityThresholdPct() { + public int rampDownCapacityThresholdPct() { return this.rampDownCapacityThresholdPct; } @@ -331,7 +357,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 +489,43 @@ 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 (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 +535,25 @@ 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("name", this.name); 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 +565,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 +581,33 @@ 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 ("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 +619,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/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..ca437a064ffc --- /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; + +/** + * Schema for SessionHostConfiguration properties. + */ +@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/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..7a7ce8090071 --- /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..7725b11b77d2 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 @@ -353,20 +353,6 @@ public UpdateState updateState() { return this.innerProperties() == null ? null : this.innerProperties().updateState(); } - /** - * Set the updateState property: Update state of a SessionHost. - * - * @param updateState the updateState value to set. - * @return the SessionHostInner object itself. - */ - public SessionHostInner withUpdateState(UpdateState updateState) { - if (this.innerProperties() == null) { - this.innerProperties = new SessionHostProperties(); - } - this.innerProperties().withUpdateState(updateState); - return this; - } - /** * Get the lastUpdateTime property: The timestamp of the last update. * @@ -399,6 +385,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..b5a2c1a972bc --- /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; + +/** + * Schema for SessionHostManagement properties. + */ +@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/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..9298acf80dd6 --- /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..2f994b6642f7 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementUpdateStatusInner.java @@ -0,0 +1,301 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementUpdateOperationStatus; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Schema for SessionHostManagementUpdateStatus properties. + */ +@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; + + /* + * Percent of the operation that is complete. + */ + private Double percentComplete; + + /* + * The start time of the operation. + */ + private OffsetDateTime startTime; + + /* + * The end time of the operation. + */ + private OffsetDateTime endTime; + + /* + * If present, details of the operation error. + */ + private ManagementError error; + + /* + * Operation status. Current defined values are < Error | Scheduled | UpdatingSessionHosts | + * ValidatingSessionHostUpdate | Paused | Pausing | Cancelling > | Succeeded | Failed | Canceled + */ + private SessionHostManagementUpdateOperationStatus status; + + /* + * Properties bag to hold custom RP properties for sessionHostManagement Update Statuses. + */ + private SessionHostManagementUpdateStatusPropertiesInner properties; + + /** + * 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 percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + public Double 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(Double 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 status property: Operation status. Current defined values are < Error | Scheduled | + * UpdatingSessionHosts | ValidatingSessionHostUpdate | Paused | Pausing | Cancelling > | Succeeded | Failed | + * Canceled. + * + * @return the status value. + */ + public SessionHostManagementUpdateOperationStatus status() { + return this.status; + } + + /** + * Get the properties property: Properties bag to hold custom RP properties for sessionHostManagement Update + * Statuses. + * + * @return the properties value. + */ + public SessionHostManagementUpdateStatusPropertiesInner properties() { + return this.properties; + } + + /** + * Set the properties property: Properties bag to hold custom RP properties for sessionHostManagement Update + * Statuses. + * + * @param properties the properties value to set. + * @return the SessionHostManagementUpdateStatusInner object itself. + */ + public SessionHostManagementUpdateStatusInner + withProperties(SessionHostManagementUpdateStatusPropertiesInner properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + 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.properties); + 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 + = SessionHostManagementUpdateOperationStatus.fromString(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::getDouble); + } 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.properties + = 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..fe1f990cf44d --- /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; + +/** + * The current status of the session host update async operation. + */ +@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..76832d1cbb35 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 @@ -103,6 +103,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/StartMenuItemInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/StartMenuItemInner.java index ea4281357070..6690188c55ac 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/StartMenuItemInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/StartMenuItemInner.java @@ -10,6 +10,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.models.StartMenuItemProperties; import java.io.IOException; /** @@ -20,7 +21,7 @@ public final class StartMenuItemInner extends ProxyResource { /* * Detailed properties for StartMenuItem */ - private StartMenuItemProperties innerProperties; + private StartMenuItemProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -49,12 +50,23 @@ public StartMenuItemInner() { } /** - * Get the innerProperties property: Detailed properties for StartMenuItem. + * Get the properties property: Detailed properties for StartMenuItem. * - * @return the innerProperties value. + * @return the properties value. */ - private StartMenuItemProperties innerProperties() { - return this.innerProperties; + public StartMenuItemProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Detailed properties for StartMenuItem. + * + * @param properties the properties value to set. + * @return the StartMenuItemInner object itself. + */ + public StartMenuItemInner withProperties(StartMenuItemProperties properties) { + this.properties = properties; + return this; } /** @@ -96,129 +108,14 @@ public String id() { return this.id; } - /** - * Get the appAlias property: Alias of StartMenuItem. - * - * @return the appAlias value. - */ - public String appAlias() { - return this.innerProperties() == null ? null : this.innerProperties().appAlias(); - } - - /** - * Set the appAlias property: Alias of StartMenuItem. - * - * @param appAlias the appAlias value to set. - * @return the StartMenuItemInner object itself. - */ - public StartMenuItemInner withAppAlias(String appAlias) { - if (this.innerProperties() == null) { - this.innerProperties = new StartMenuItemProperties(); - } - this.innerProperties().withAppAlias(appAlias); - return this; - } - - /** - * Get the filePath property: Path to the file of StartMenuItem. - * - * @return the filePath value. - */ - public String filePath() { - return this.innerProperties() == null ? null : this.innerProperties().filePath(); - } - - /** - * Set the filePath property: Path to the file of StartMenuItem. - * - * @param filePath the filePath value to set. - * @return the StartMenuItemInner object itself. - */ - public StartMenuItemInner withFilePath(String filePath) { - if (this.innerProperties() == null) { - this.innerProperties = new StartMenuItemProperties(); - } - this.innerProperties().withFilePath(filePath); - return this; - } - - /** - * Get the commandLineArguments property: Command line arguments for StartMenuItem. - * - * @return the commandLineArguments value. - */ - public String commandLineArguments() { - return this.innerProperties() == null ? null : this.innerProperties().commandLineArguments(); - } - - /** - * Set the commandLineArguments property: Command line arguments for StartMenuItem. - * - * @param commandLineArguments the commandLineArguments value to set. - * @return the StartMenuItemInner object itself. - */ - public StartMenuItemInner withCommandLineArguments(String commandLineArguments) { - if (this.innerProperties() == null) { - this.innerProperties = new StartMenuItemProperties(); - } - this.innerProperties().withCommandLineArguments(commandLineArguments); - return this; - } - - /** - * Get the iconPath property: Path to the icon. - * - * @return the iconPath value. - */ - public String iconPath() { - return this.innerProperties() == null ? null : this.innerProperties().iconPath(); - } - - /** - * Set the iconPath property: Path to the icon. - * - * @param iconPath the iconPath value to set. - * @return the StartMenuItemInner object itself. - */ - public StartMenuItemInner withIconPath(String iconPath) { - if (this.innerProperties() == null) { - this.innerProperties = new StartMenuItemProperties(); - } - this.innerProperties().withIconPath(iconPath); - return this; - } - - /** - * Get the iconIndex property: Index of the icon. - * - * @return the iconIndex value. - */ - public Integer iconIndex() { - return this.innerProperties() == null ? null : this.innerProperties().iconIndex(); - } - - /** - * Set the iconIndex property: Index of the icon. - * - * @param iconIndex the iconIndex value to set. - * @return the StartMenuItemInner object itself. - */ - public StartMenuItemInner withIconIndex(Integer iconIndex) { - if (this.innerProperties() == null) { - this.innerProperties = new StartMenuItemProperties(); - } - this.innerProperties().withIconIndex(iconIndex); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -228,7 +125,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -255,7 +152,7 @@ public static StartMenuItemInner fromJson(JsonReader jsonReader) throws IOExcept } else if ("type".equals(fieldName)) { deserializedStartMenuItemInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedStartMenuItemInner.innerProperties = StartMenuItemProperties.fromJson(reader); + deserializedStartMenuItemInner.properties = StartMenuItemProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedStartMenuItemInner.systemData = SystemData.fromJson(reader); } else { 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..275a50ca1b6f 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 @@ -5,16 +5,16 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.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; @@ -23,25 +23,54 @@ * Represents a Workspace definition. */ @Fluent -public final class WorkspaceInner extends ResourceModelWithAllowedPropertySet { +public final class WorkspaceInner extends Resource { /* * Detailed properties for Workspace */ private WorkspaceProperties innerProperties; /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * The managed service identities assigned to this resource. */ - private SystemData systemData; + private ManagedServiceIdentity identity; /* - * The etag field is *not* required. If it is provided in the response body, it must also be provided as a header - * per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested - * resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section - * 14.26), and If-Range (section 14.27) header fields. + * If etag is provided in the response body, it may also be provided as a header per the normal etag convention. + * Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity + * tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section + * 14.27) header fields. */ private String etag; + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private String kind; + + /* + * The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed + * by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is + * removed from the template since it is managed by another resource. + */ + private String managedBy; + + /* + * Details of the resource plan. + */ + private Plan plan; + + /* + * The SKU (Stock Keeping Unit) assigned to this resource. + */ + private Sku sku; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -73,101 +102,162 @@ private WorkspaceProperties innerProperties() { } /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Get the identity property: The managed service identities assigned to this resource. * - * @return the systemData value. + * @return the identity value. */ - @Override - public SystemData systemData() { - return this.systemData; + public ManagedServiceIdentity identity() { + return this.identity; } /** - * Get the etag property: The etag field is *not* required. If it is provided in the response body, it must also be - * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from - * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), - * If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the etag property: If etag is provided in the response body, it may also be provided as a header per the + * normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. + * HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), + * and If-Range (section 14.27) header fields. * * @return the etag value. */ - @Override public String etag() { return this.etag; } /** - * Get the type property: The type of the resource. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * - * @return the type value. + * @return the kind value. */ - @Override - public String type() { - return this.type; + public String kind() { + return this.kind; } /** - * Get the name property: The name of the resource. + * Set the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * - * @return the name value. + * @param kind the kind value to set. + * @return the WorkspaceInner object itself. */ - @Override - public String name() { - return this.name; + public WorkspaceInner withKind(String kind) { + this.kind = kind; + return this; } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the managedBy property: The fully qualified resource ID of the resource that manages this resource. Indicates + * if this resource is managed by another Azure resource. If this is present, complete mode deployment will not + * delete the resource if it is removed from the template since it is managed by another resource. * - * @return the id value. + * @return the managedBy value. */ - @Override - public String id() { - return this.id; + public String managedBy() { + return this.managedBy; } /** - * {@inheritDoc} + * Set the managedBy property: The fully qualified resource ID of the resource that manages this resource. Indicates + * if this resource is managed by another Azure resource. If this is present, complete mode deployment will not + * delete the resource if it is removed from the template since it is managed by another resource. + * + * @param managedBy the managedBy value to set. + * @return the WorkspaceInner object itself. */ - @Override public WorkspaceInner withManagedBy(String managedBy) { - super.withManagedBy(managedBy); + this.managedBy = managedBy; return this; } /** - * {@inheritDoc} + * Get the plan property: Details of the resource plan. + * + * @return the plan value. */ - @Override - public WorkspaceInner withKind(String kind) { - super.withKind(kind); + public Plan plan() { + return this.plan; + } + + /** + * Set the plan property: Details of the resource plan. + * + * @param plan the plan value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withPlan(Plan plan) { + this.plan = plan; return this; } /** - * {@inheritDoc} + * Get the sku property: The SKU (Stock Keeping Unit) assigned to this resource. + * + * @return the sku value. */ - @Override - public WorkspaceInner withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { - super.withIdentity(identity); + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU (Stock Keeping Unit) assigned to this resource. + * + * @param sku the sku value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withSku(Sku sku) { + this.sku = sku; return this; } /** - * {@inheritDoc} + * 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 WorkspaceInner withSku(ResourceModelWithAllowedPropertySetSku sku) { - super.withSku(sku); - return this; + public String type() { + return this.type; } /** - * {@inheritDoc} + * Get the name property: The name of the resource. + * + * @return the name value. */ @Override - public WorkspaceInner withPlan(ResourceModelWithAllowedPropertySetPlan plan) { - super.withPlan(plan); - return this; + 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; } /** @@ -315,7 +405,6 @@ public List privateEndpointConnections() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); @@ -323,12 +412,12 @@ public void validate() { if (identity() != null) { identity().validate(); } - if (sku() != null) { - sku().validate(); - } if (plan() != null) { plan().validate(); } + if (sku() != null) { + sku().validate(); + } } /** @@ -339,12 +428,12 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("managedBy", managedBy()); - jsonWriter.writeStringField("kind", kind()); - jsonWriter.writeJsonField("identity", identity()); - jsonWriter.writeJsonField("sku", sku()); - jsonWriter.writeJsonField("plan", plan()); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("managedBy", this.managedBy); + jsonWriter.writeJsonField("plan", this.plan); + jsonWriter.writeJsonField("sku", this.sku); return jsonWriter.writeEndObject(); } @@ -375,23 +464,22 @@ public static WorkspaceInner fromJson(JsonReader jsonReader) throws IOException } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedWorkspaceInner.withTags(tags); - } else if ("managedBy".equals(fieldName)) { - deserializedWorkspaceInner.withManagedBy(reader.getString()); - } else if ("kind".equals(fieldName)) { - deserializedWorkspaceInner.withKind(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedWorkspaceInner.innerProperties = WorkspaceProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedWorkspaceInner.identity = ManagedServiceIdentity.fromJson(reader); } else if ("etag".equals(fieldName)) { deserializedWorkspaceInner.etag = reader.getString(); - } else if ("identity".equals(fieldName)) { - deserializedWorkspaceInner - .withIdentity(ResourceModelWithAllowedPropertySetIdentity.fromJson(reader)); - } else if ("sku".equals(fieldName)) { - deserializedWorkspaceInner.withSku(ResourceModelWithAllowedPropertySetSku.fromJson(reader)); + } else if ("kind".equals(fieldName)) { + deserializedWorkspaceInner.kind = reader.getString(); + } else if ("managedBy".equals(fieldName)) { + deserializedWorkspaceInner.managedBy = reader.getString(); } else if ("plan".equals(fieldName)) { - deserializedWorkspaceInner.withPlan(ResourceModelWithAllowedPropertySetPlan.fromJson(reader)); + deserializedWorkspaceInner.plan = Plan.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedWorkspaceInner.sku = Sku.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedWorkspaceInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedWorkspaceInner.innerProperties = WorkspaceProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/package-info.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/package-info.java index ee25116a1bbf..c5ec0ddcc76e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/package-info.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/package-info.java @@ -4,6 +4,6 @@ /** * Package containing the inner data models for DesktopVirtualizationApiClient. - * null. + * This Typespec represents the Desktop Virtualization API interfaces. */ package com.azure.resourcemanager.desktopvirtualization.fluent.models; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/package-info.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/package-info.java index 5637a294910c..136c628dca01 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/package-info.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/package-info.java @@ -4,6 +4,6 @@ /** * Package containing the service clients for DesktopVirtualizationApiClient. - * null. + * This Typespec represents the Desktop Virtualization API interfaces. */ package com.azure.resourcemanager.desktopvirtualization.fluent; 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..1fd77f21f15c --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ActiveSessionHostConfigurationsClientImpl.java @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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") + @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("/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("{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); + } + + /** + * Operation to list the ActiveSessionHostConfigurations associated with the 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 list of ActiveSessionHostConfiguration definitions 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())); + } + + /** + * Operation to list the ActiveSessionHostConfigurations associated with the 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 list of ActiveSessionHostConfiguration definitions 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)); + } + + /** + * Operation to list the ActiveSessionHostConfigurations associated with the 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 list of ActiveSessionHostConfiguration definitions 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)); + } + + /** + * Operation to list the ActiveSessionHostConfigurations associated with the 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 list of ActiveSessionHostConfiguration definitions 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)); + } + + /** + * Operation to list the ActiveSessionHostConfigurations associated with the 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 list of ActiveSessionHostConfiguration definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostPool(String resourceGroupName, + String hostPoolName) { + return new PagedIterable<>(listByHostPoolAsync(resourceGroupName, hostPoolName)); + } + + /** + * Operation to list the ActiveSessionHostConfigurations associated with the 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 list of ActiveSessionHostConfiguration definitions 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 a ActiveSessionHostConfiguration. + * + * @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 ActiveSessionHostConfiguration 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 ActiveSessionHostConfiguration. + * + * @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 ActiveSessionHostConfiguration 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 ActiveSessionHostConfiguration. + * + * @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 ActiveSessionHostConfiguration 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 ActiveSessionHostConfiguration. + * + * @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 ActiveSessionHostConfiguration 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 ActiveSessionHostConfiguration. + * + * @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 ActiveSessionHostConfiguration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ActiveSessionHostConfigurationInner get(String resourceGroupName, String hostPoolName) { + return getWithResponse(resourceGroupName, hostPoolName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ActiveSessionHostConfiguration definitions 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 list of ActiveSessionHostConfiguration definitions 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..1827ad0bfb31 --- /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 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())); + } + + 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; + } + } + + 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..029dee4b2abe 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 @@ -9,10 +9,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.AppAttachPackageInner; import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackage; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageInfoProperties; import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackagePatch; import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackagePatchProperties; -import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageProperties; +import com.azure.resourcemanager.desktopvirtualization.models.FailHealthCheckOnStagingFailure; +import com.azure.resourcemanager.desktopvirtualization.models.ProvisioningState; import java.util.Collections; +import java.util.List; import java.util.Map; public final class AppAttachPackageImpl @@ -46,14 +49,47 @@ public Map tags() { } } - public AppAttachPackageProperties properties() { - return this.innerModel().properties(); - } - public SystemData systemData() { return this.innerModel().systemData(); } + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public AppAttachPackageInfoProperties image() { + return this.innerModel().image(); + } + + public List hostPoolReferences() { + List inner = this.innerModel().hostPoolReferences(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String keyVaultUrl() { + return this.innerModel().keyVaultUrl(); + } + + public FailHealthCheckOnStagingFailure failHealthCheckOnStagingFailure() { + return this.innerModel().failHealthCheckOnStagingFailure(); + } + + public String packageOwnerName() { + return this.innerModel().packageOwnerName(); + } + + public String packageLookbackUrl() { + return this.innerModel().packageLookbackUrl(); + } + + public String customData() { + return this.innerModel().customData(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -163,13 +199,49 @@ public AppAttachPackageImpl withRegion(String location) { return this; } - public AppAttachPackageImpl withProperties(AppAttachPackageProperties properties) { - this.innerModel().withProperties(properties); + public AppAttachPackageImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateAppAttachPackagePatch.withTags(tags); + return this; + } + } + + public AppAttachPackageImpl withImage(AppAttachPackageInfoProperties image) { + this.innerModel().withImage(image); + return this; + } + + public AppAttachPackageImpl withHostPoolReferences(List hostPoolReferences) { + this.innerModel().withHostPoolReferences(hostPoolReferences); return this; } - public AppAttachPackageImpl withTags(Map tags) { - this.innerModel().withTags(tags); + public AppAttachPackageImpl withKeyVaultUrl(String keyVaultUrl) { + this.innerModel().withKeyVaultUrl(keyVaultUrl); + return this; + } + + public AppAttachPackageImpl + withFailHealthCheckOnStagingFailure(FailHealthCheckOnStagingFailure failHealthCheckOnStagingFailure) { + this.innerModel().withFailHealthCheckOnStagingFailure(failHealthCheckOnStagingFailure); + return this; + } + + public AppAttachPackageImpl withPackageOwnerName(String packageOwnerName) { + this.innerModel().withPackageOwnerName(packageOwnerName); + return this; + } + + public AppAttachPackageImpl withPackageLookbackUrl(String packageLookbackUrl) { + this.innerModel().withPackageLookbackUrl(packageLookbackUrl); + return this; + } + + public AppAttachPackageImpl withCustomData(String customData) { + this.innerModel().withCustomData(customData); return this; } @@ -177,4 +249,8 @@ public AppAttachPackageImpl withProperties(AppAttachPackagePatchProperties prope 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/AppAttachPackageInfoesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageInfoesClientImpl.java index cf2623b1ac02..8a759a9b7d36 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageInfoesClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageInfoesClientImpl.java @@ -89,7 +89,7 @@ Mono> importMethodNext( * * @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 importPackageInfoRequest Object containing URI to package image and other optional properties. + * @param importPackageInfoRequest The importPackageInfoRequest parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -135,7 +135,7 @@ private Mono> importMethodSinglePageAsync(S * * @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 importPackageInfoRequest Object containing URI to package image and other optional properties. + * @param importPackageInfoRequest The importPackageInfoRequest parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -181,7 +181,7 @@ private Mono> importMethodSinglePageAsync(S * * @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 importPackageInfoRequest Object containing URI to package image and other optional properties. + * @param importPackageInfoRequest The importPackageInfoRequest parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -200,7 +200,7 @@ public PagedFlux importMethodAsync(String resourceGroupNa * * @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 importPackageInfoRequest Object containing URI to package image and other optional properties. + * @param importPackageInfoRequest The importPackageInfoRequest parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -220,7 +220,7 @@ private PagedFlux importMethodAsync(String resourceGroupN * * @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 importPackageInfoRequest Object containing URI to package image and other optional properties. + * @param importPackageInfoRequest The importPackageInfoRequest parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -238,7 +238,7 @@ public PagedIterable importMethod(String resourceGroupNam * * @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 importPackageInfoRequest Object containing URI to package image and other optional properties. + * @param importPackageInfoRequest The importPackageInfoRequest parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -260,7 +260,8 @@ public PagedIterable importMethod(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of App Attach Package definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> importMethodNextSinglePageAsync(String nextLink) { @@ -287,7 +288,8 @@ private Mono> importMethodNextSinglePageAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of App Attach Package definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> importMethodNextSinglePageAsync(String nextLink, 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..b16c82a63e9c 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 @@ -67,6 +67,23 @@ public final class AppAttachPackagesClientImpl implements AppAttachPackagesClien @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface AppAttachPackagesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/appAttachPackages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}") @ExpectedResponses({ 200 }) @@ -88,16 +105,6 @@ Mono> createOrUpdate(@HostParam("$host") String @BodyParam("application/json") AppAttachPackageInner appAttachPackage, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}") @ExpectedResponses({ 200 }) @@ -110,27 +117,20 @@ Mono> update(@HostParam("$host") String endpoint @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages") - @ExpectedResponses({ 200 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("appAttachPackageName") String appAttachPackageName, @QueryParam("force") Boolean force, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/appAttachPackages") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( + Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); @@ -138,24 +138,162 @@ Mono> listByResourceGroupNext( @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( + Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Get an app attach package. + * List App Attach packages in subscription. + * + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and 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 list of App Attach Package definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, 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 App Attach packages in subscription. + * + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and 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 list of App Attach Package definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), filter, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List App Attach packages in subscription. + * + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and 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 list of App Attach Package definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(filter), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List App Attach packages in subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Attach Package definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List App Attach packages in subscription. + * + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and 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 list of App Attach Package definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(filter, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List App Attach packages in subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Attach Package definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + return new PagedIterable<>(listAsync(filter)); + } + + /** + * List App Attach packages in subscription. + * + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and 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 list of App Attach Package definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Context context) { + return new PagedIterable<>(listAsync(filter, context)); + } + + /** + * List App Attach packages in resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param filter OData filter expression. Valid properties for filtering are package name and 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 an app attach package along with {@link Response} on successful completion of {@link Mono}. + * @return list of App Attach Package definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String appAttachPackageName) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -168,31 +306,30 @@ public Mono> getByResourceGroupWithResponseAsync return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (appAttachPackageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter appAttachPackageName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, accept, context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, 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 an app attach package. + * List App Attach packages in resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param filter OData filter expression. Valid properties for filtering are package name and 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 an app attach package along with {@link Response} on successful completion of {@link Mono}. + * @return list of App Attach Package definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String appAttachPackageName, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -205,79 +342,110 @@ private Mono> getByResourceGroupWithResponseAsyn return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (appAttachPackageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter appAttachPackageName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, accept, context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Get an app attach package. + * List App Attach packages in resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param filter OData filter expression. Valid properties for filtering are package name and 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 an app attach package on successful completion of {@link Mono}. + * @return list of App Attach Package definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String appAttachPackageName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, appAttachPackageName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Get an app attach package. + * List App Attach packages in resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the 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 list of App Attach Package definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an app attach package along with {@link Response}. + * @return list of App Attach Package definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String appAttachPackageName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, appAttachPackageName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Get an app attach package. + * List App Attach packages in resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the 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 an app attach package. + * @return list of App Attach Package definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppAttachPackageInner getByResourceGroup(String resourceGroupName, String appAttachPackageName) { - return getByResourceGroupWithResponse(resourceGroupName, appAttachPackageName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String filter = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter)); } /** - * Create or update an App Attach package. + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Attach Package definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, context)); + } + + /** + * 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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema for App Attach Package properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return an app attach package along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String appAttachPackageName, AppAttachPackageInner appAttachPackage) { + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String appAttachPackageName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -294,36 +462,27 @@ public Mono> createOrUpdateWithResponseAsync(Str return Mono .error(new IllegalArgumentException("Parameter appAttachPackageName is required and cannot be null.")); } - if (appAttachPackage == null) { - return Mono - .error(new IllegalArgumentException("Parameter appAttachPackage is required and cannot be null.")); - } else { - appAttachPackage.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, appAttachPackage, accept, - context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update an App Attach package. + * 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 appAttachPackage Object containing App Attach Package 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 schema for App Attach Package properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return an app attach package along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String appAttachPackageName, AppAttachPackageInner appAttachPackage, Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String appAttachPackageName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -340,86 +499,75 @@ private Mono> createOrUpdateWithResponseAsync(St return Mono .error(new IllegalArgumentException("Parameter appAttachPackageName is required and cannot be null.")); } - if (appAttachPackage == null) { - return Mono - .error(new IllegalArgumentException("Parameter appAttachPackage is required and cannot be null.")); - } else { - appAttachPackage.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, appAttachPackage, accept, - context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, accept, context); } /** - * Create or update an App Attach package. + * 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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema for App Attach Package properties on successful completion of {@link Mono}. + * @return an app attach package on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String resourceGroupName, String appAttachPackageName, - AppAttachPackageInner appAttachPackage) { - return createOrUpdateWithResponseAsync(resourceGroupName, appAttachPackageName, appAttachPackage) + public Mono getByResourceGroupAsync(String resourceGroupName, String appAttachPackageName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, appAttachPackageName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Create or update an App Attach package. + * 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 appAttachPackage Object containing App Attach Package 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 schema for App Attach Package properties along with {@link Response}. + * @return an app attach package along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, - String appAttachPackageName, AppAttachPackageInner appAttachPackage, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, appAttachPackageName, appAttachPackage, context) - .block(); + public Response getByResourceGroupWithResponse(String resourceGroupName, + String appAttachPackageName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, appAttachPackageName, context).block(); } /** - * Create or update an App Attach package. + * 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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema for App Attach Package properties. + * @return an app attach package. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AppAttachPackageInner createOrUpdate(String resourceGroupName, String appAttachPackageName, - AppAttachPackageInner appAttachPackage) { - return createOrUpdateWithResponse(resourceGroupName, appAttachPackageName, appAttachPackage, Context.NONE) - .getValue(); + public AppAttachPackageInner getByResourceGroup(String resourceGroupName, String appAttachPackageName) { + return getByResourceGroupWithResponse(resourceGroupName, appAttachPackageName, Context.NONE).getValue(); } /** - * Remove an App Attach Package. + * 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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return schema for App Attach Package properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String appAttachPackageName) { + public Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String appAttachPackageName, AppAttachPackageInner appAttachPackage) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -436,27 +584,36 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St return Mono .error(new IllegalArgumentException("Parameter appAttachPackageName is required and cannot be null.")); } + if (appAttachPackage == null) { + return Mono + .error(new IllegalArgumentException("Parameter appAttachPackage is required and cannot be null.")); + } else { + appAttachPackage.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, appAttachPackage, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Remove an App Attach Package. + * 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 appAttachPackage Object containing App Attach Package 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 Response} on successful completion of {@link Mono}. + * @return schema for App Attach Package properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String appAttachPackageName, - Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String appAttachPackageName, AppAttachPackageInner appAttachPackage, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -473,55 +630,72 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono .error(new IllegalArgumentException("Parameter appAttachPackageName is required and cannot be null.")); } + if (appAttachPackage == null) { + return Mono + .error(new IllegalArgumentException("Parameter appAttachPackage is required and cannot be null.")); + } else { + appAttachPackage.validate(); + } 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); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, appAttachPackage, accept, + context); } /** - * Remove an App Attach Package. + * 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 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. * @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. + * @return schema for App Attach Package properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String appAttachPackageName) { - return deleteWithResponseAsync(resourceGroupName, appAttachPackageName).flatMap(ignored -> Mono.empty()); + public Mono createOrUpdateAsync(String resourceGroupName, String appAttachPackageName, + AppAttachPackageInner appAttachPackage) { + return createOrUpdateWithResponseAsync(resourceGroupName, appAttachPackageName, appAttachPackage) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove an App Attach Package. + * 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 appAttachPackage Object containing App Attach Package 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 Response}. + * @return schema for App Attach Package properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String appAttachPackageName, Context context) { - return deleteWithResponseAsync(resourceGroupName, appAttachPackageName, context).block(); + public Response createOrUpdateWithResponse(String resourceGroupName, + String appAttachPackageName, AppAttachPackageInner appAttachPackage, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, appAttachPackageName, appAttachPackage, context) + .block(); } /** - * Remove an App Attach Package. + * 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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for App Attach Package properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String appAttachPackageName) { - deleteWithResponse(resourceGroupName, appAttachPackageName, Context.NONE); + public AppAttachPackageInner createOrUpdate(String resourceGroupName, String appAttachPackageName, + AppAttachPackageInner appAttachPackage) { + return createOrUpdateWithResponse(resourceGroupName, appAttachPackageName, appAttachPackage, Context.NONE) + .getValue(); } /** @@ -529,7 +703,7 @@ public void delete(String resourceGroupName, String appAttachPackageName) { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appAttachPackageName The name of the App Attach package. - * @param appAttachPackagePatch Object containing App Attach Package definition. + * @param appAttachPackagePatch The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -571,7 +745,7 @@ public Mono> updateWithResponseAsync(String reso * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appAttachPackageName The name of the App Attach package. - * @param appAttachPackagePatch Object containing App Attach Package definition. + * @param appAttachPackagePatch The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -629,7 +803,7 @@ public Mono updateAsync(String resourceGroupName, String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appAttachPackageName The name of the App Attach package. - * @param appAttachPackagePatch Object containing App Attach Package definition. + * @param appAttachPackagePatch The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -660,18 +834,19 @@ public AppAttachPackageInner update(String resourceGroupName, String appAttachPa } /** - * List App Attach packages in resource group. + * Remove an App Attach Package. * * @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 appAttachPackageName The name of the App Attach package. + * @param force Allows force delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String filter) { + 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.")); @@ -684,29 +859,32 @@ private Mono> listByResourceGroupSinglePage return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (appAttachPackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter appAttachPackageName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, filter, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, force, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List App Attach packages in resource group. + * Remove an App Attach Package. * * @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 appAttachPackageName The name of the App Attach package. + * @param force Allows force delete. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String filter, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String appAttachPackageName, + Boolean force, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -719,230 +897,63 @@ private Mono> listByResourceGroupSinglePage return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (appAttachPackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter appAttachPackageName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, appAttachPackageName, force, accept, context); } /** - * List App Attach packages in resource group. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String filter = null; - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String appAttachPackageName) { + final Boolean force = null; + return deleteWithResponseAsync(resourceGroupName, appAttachPackageName, force).flatMap(ignored -> Mono.empty()); } /** - * List App Attach packages in resource group. + * Remove an App Attach Package. * * @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 appAttachPackageName The name of the App Attach package. + * @param force Allows force delete. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList as paginated response with {@link PagedFlux}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String appAttachPackageName, Boolean force, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * List App Attach packages in resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final String filter = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter)); + return deleteWithResponseAsync(resourceGroupName, appAttachPackageName, force, context).block(); } /** - * List App Attach packages in resource group. + * Remove an App Attach Package. * * @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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, String filter, - Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, context)); - } - - /** - * List App Attach packages in subscription. - * - * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and 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 appAttachPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), filter, 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 App Attach packages in subscription. - * - * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and resource - * group. - * @param context The context to associate with this operation. + * @param appAttachPackageName The name of the 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 appAttachPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), filter, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List App Attach packages in subscription. - * - * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and 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 appAttachPackageList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(filter), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * List App Attach packages in subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * List App Attach packages in subscription. - * - * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and 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 appAttachPackageList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * List App Attach packages in subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); - } - - /** - * List App Attach packages in subscription. - * - * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and 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 appAttachPackageList as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); + public void delete(String resourceGroupName, String appAttachPackageName) { + final Boolean force = null; + deleteWithResponse(resourceGroupName, appAttachPackageName, force, Context.NONE); } /** @@ -952,10 +963,11 @@ public PagedIterable list(String filter, Context context) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of App Attach Package definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -966,7 +978,7 @@ private Mono> listByResourceGroupNextSingle final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -980,10 +992,11 @@ private Mono> listByResourceGroupNextSingle * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of App Attach Package definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -994,7 +1007,7 @@ private Mono> listByResourceGroupNextSingle } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1006,10 +1019,11 @@ private Mono> listByResourceGroupNextSingle * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of App Attach Package definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1020,7 +1034,7 @@ private Mono> listBySubscriptionNextSingleP final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1034,10 +1048,11 @@ private Mono> listBySubscriptionNextSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of App Attach Package definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1048,7 +1063,7 @@ private Mono> listBySubscriptionNextSingleP } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/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..c745947f89b4 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 @@ -27,6 +27,28 @@ public AppAttachPackagesImpl(AppAttachPackagesClient innerClient, this.serviceManager = serviceManager; } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppAttachPackageImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Context context) { + PagedIterable inner = this.serviceClient().list(filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppAttachPackageImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppAttachPackageImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppAttachPackageImpl(inner1, this.manager())); + } + public Response getByResourceGroupWithResponse(String resourceGroupName, String appAttachPackageName, Context context) { Response inner @@ -48,37 +70,15 @@ 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); } - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AppAttachPackageImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, String filter, - Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AppAttachPackageImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AppAttachPackageImpl(inner1, this.manager())); - } - - public PagedIterable list(String filter, Context context) { - PagedIterable inner = this.serviceClient().list(filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AppAttachPackageImpl(inner1, this.manager())); - } - public AppAttachPackage getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { @@ -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..7327a7a863e5 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 @@ -10,10 +10,11 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationGroupInner; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroup; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupPatch; +import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupPatchProperties; 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; @@ -48,30 +49,30 @@ public Map tags() { } } - public String managedBy() { - return this.innerModel().managedBy(); - } - - public String kind() { - return this.innerModel().kind(); + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); } public String etag() { return this.innerModel().etag(); } - public ResourceModelWithAllowedPropertySetIdentity identity() { - return this.innerModel().identity(); + public String kind() { + return this.innerModel().kind(); } - public ResourceModelWithAllowedPropertySetSku sku() { - return this.innerModel().sku(); + public String managedBy() { + return this.innerModel().managedBy(); } - public ResourceModelWithAllowedPropertySetPlan plan() { + public Plan plan() { return this.innerModel().plan(); } + public Sku sku() { + return this.innerModel().sku(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -237,8 +238,8 @@ public ApplicationGroupImpl withTags(Map tags) { } } - public ApplicationGroupImpl withManagedBy(String managedBy) { - this.innerModel().withManagedBy(managedBy); + public ApplicationGroupImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); return this; } @@ -247,49 +248,39 @@ public ApplicationGroupImpl withKind(String kind) { return this; } - public ApplicationGroupImpl withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { - this.innerModel().withIdentity(identity); + public ApplicationGroupImpl withManagedBy(String managedBy) { + this.innerModel().withManagedBy(managedBy); return this; } - public ApplicationGroupImpl withSku(ResourceModelWithAllowedPropertySetSku sku) { - this.innerModel().withSku(sku); + public ApplicationGroupImpl withPlan(Plan plan) { + this.innerModel().withPlan(plan); return this; } - public ApplicationGroupImpl withPlan(ResourceModelWithAllowedPropertySetPlan plan) { - this.innerModel().withPlan(plan); + public ApplicationGroupImpl withSku(Sku sku) { + this.innerModel().withSku(sku); return this; } public ApplicationGroupImpl withDescription(String description) { - if (isInCreateMode()) { - this.innerModel().withDescription(description); - return this; - } else { - this.updateApplicationGroup.withDescription(description); - return this; - } + this.innerModel().withDescription(description); + return this; } public ApplicationGroupImpl withFriendlyName(String friendlyName) { - if (isInCreateMode()) { - this.innerModel().withFriendlyName(friendlyName); - return this; - } else { - this.updateApplicationGroup.withFriendlyName(friendlyName); - return this; - } + this.innerModel().withFriendlyName(friendlyName); + return this; } public ApplicationGroupImpl withShowInFeed(Boolean showInFeed) { - if (isInCreateMode()) { - this.innerModel().withShowInFeed(showInFeed); - return this; - } else { - this.updateApplicationGroup.withShowInFeed(showInFeed); - return this; - } + this.innerModel().withShowInFeed(showInFeed); + return this; + } + + public ApplicationGroupImpl withProperties(ApplicationGroupPatchProperties properties) { + this.updateApplicationGroup.withProperties(properties); + return this; } private boolean isInCreateMode() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupsClientImpl.java index 9f972e889f6a..e41ba233acba 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupsClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupsClientImpl.java @@ -67,6 +67,24 @@ public final class ApplicationGroupsClientImpl implements ApplicationGroupsClien @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface ApplicationGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/applicationGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, + @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") @ExpectedResponses({ 200 }) @@ -88,16 +106,6 @@ Mono> createOrUpdate(@HostParam("$host") String @BodyParam("application/json") ApplicationGroupInner applicationGroup, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationGroupName") String applicationGroupName, @HeaderParam("Accept") String accept, - Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") @ExpectedResponses({ 200 }) @@ -110,28 +118,20 @@ Mono> update(@HostParam("$host") String endpoint Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, - @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/applicationGroups") - @ExpectedResponses({ 200 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGroupName") String applicationGroupName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( + Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); @@ -139,24 +139,23 @@ Mono> listByResourceGroupNext( @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( + Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Get an application group. + * List applicationGroups in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application group along with {@link Response} on successful completion of {@link Mono}. + * @return list of ApplicationGroup definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String applicationGroupName) { + private Mono> listSinglePageAsync(String filter) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -165,35 +164,28 @@ public Mono> getByResourceGroupWithResponseAsync return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, 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 an application group. + * List applicationGroups in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application group along with {@link Response} on successful completion of {@link Mono}. + * @return list of ApplicationGroup definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String applicationGroupName, Context context) { + private Mono> listSinglePageAsync(String filter, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -202,83 +194,105 @@ private Mono> getByResourceGroupWithResponseAsyn return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (applicationGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, accept, context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), filter, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Get an application group. + * List applicationGroups in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application group on successful completion of {@link Mono}. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String applicationGroupName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, applicationGroupName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(filter), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Get an application group. + * List applicationGroups in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List applicationGroups in subscription. + * + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application group along with {@link Response}. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String applicationGroupName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, applicationGroupName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(filter, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** - * Get an application group. + * List applicationGroups in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + return new PagedIterable<>(listAsync(filter)); + } + + /** + * List applicationGroups in subscription. + * + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application group. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationGroupInner getByResourceGroup(String resourceGroupName, String applicationGroupName) { - return getByResourceGroupWithResponse(resourceGroupName, applicationGroupName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Context context) { + return new PagedIterable<>(listAsync(filter, context)); } /** - * Create or update an applicationGroup. + * List applicationGroups. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. - * @param applicationGroup Object containing ApplicationGroup definitions. + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 ApplicationGroup definition along with {@link Response} on successful completion of + * @return list of ApplicationGroup definitions along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String applicationGroupName, ApplicationGroupInner applicationGroup) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -291,40 +305,34 @@ public Mono> createOrUpdateWithResponseAsync(Str return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (applicationGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null.")); - } - if (applicationGroup == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationGroup is required and cannot be null.")); - } else { - applicationGroup.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationGroup, accept, + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, isDescending, initialSkip, 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())); } /** - * Create or update an applicationGroup. + * List applicationGroups. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. - * @param applicationGroup Object containing ApplicationGroup definitions. + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 ApplicationGroup definition along with {@link Response} on successful completion of + * @return list of ApplicationGroup definitions along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String applicationGroupName, ApplicationGroupInner applicationGroup, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -337,90 +345,131 @@ private Mono> createOrUpdateWithResponseAsync(St return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (applicationGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null.")); - } - if (applicationGroup == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationGroup is required and cannot be null.")); - } else { - applicationGroup.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationGroup, accept, - context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, isDescending, initialSkip, accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Create or update an applicationGroup. + * List applicationGroups. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. - * @param applicationGroup Object containing ApplicationGroup definitions. + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 ApplicationGroup definition on successful completion of {@link Mono}. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String resourceGroupName, String applicationGroupName, - ApplicationGroupInner applicationGroup) { - return createOrUpdateWithResponseAsync(resourceGroupName, applicationGroupName, applicationGroup) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, pageSize, isDescending, initialSkip), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Create or update an applicationGroup. + * List applicationGroups. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. - * @param applicationGroup Object containing ApplicationGroup 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 list of ApplicationGroup definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, pageSize, isDescending, initialSkip), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List applicationGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 ApplicationGroup definition along with {@link Response}. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, - String applicationGroupName, ApplicationGroupInner applicationGroup, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, applicationGroupName, applicationGroup, context) - .block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, pageSize, + isDescending, initialSkip, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Create or update an applicationGroup. + * List applicationGroups. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. - * @param applicationGroup Object containing ApplicationGroup 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 ApplicationGroup definition. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationGroupInner createOrUpdate(String resourceGroupName, String applicationGroupName, - ApplicationGroupInner applicationGroup) { - return createOrUpdateWithResponse(resourceGroupName, applicationGroupName, applicationGroup, Context.NONE) - .getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String filter = null; + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedIterable<>( + listByResourceGroupAsync(resourceGroupName, filter, pageSize, isDescending, initialSkip)); } /** - * Remove an applicationGroup. + * List applicationGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedIterable<>( + listByResourceGroupAsync(resourceGroupName, filter, pageSize, isDescending, initialSkip, context)); + } + + /** + * Get an application group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application 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 Response} on successful completion of {@link Mono}. + * @return an application group along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName) { + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String applicationGroupName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -439,13 +488,13 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Remove an applicationGroup. + * Get an application group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -453,11 +502,11 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return an application group along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName, - Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String applicationGroupName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -476,27 +525,28 @@ 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, applicationGroupName, accept, context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, accept, context); } /** - * Remove an applicationGroup. + * Get an application group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application 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. + * @return an application group on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String applicationGroupName) { - return deleteWithResponseAsync(resourceGroupName, applicationGroupName).flatMap(ignored -> Mono.empty()); + public Mono getByResourceGroupAsync(String resourceGroupName, String applicationGroupName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, applicationGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove an applicationGroup. + * Get an application group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -504,29 +554,31 @@ public Mono deleteAsync(String resourceGroupName, String applicationGroupN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return an application group along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String applicationGroupName, Context context) { - return deleteWithResponseAsync(resourceGroupName, applicationGroupName, context).block(); + public Response getByResourceGroupWithResponse(String resourceGroupName, + String applicationGroupName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, applicationGroupName, context).block(); } /** - * Remove an applicationGroup. + * Get an application group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application 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 an application group. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String applicationGroupName) { - deleteWithResponse(resourceGroupName, applicationGroupName, Context.NONE); + public ApplicationGroupInner getByResourceGroup(String resourceGroupName, String applicationGroupName) { + return getByResourceGroupWithResponse(resourceGroupName, applicationGroupName, Context.NONE).getValue(); } /** - * Update an applicationGroup. + * Create or update an applicationGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -538,8 +590,8 @@ public void delete(String resourceGroupName, String applicationGroupName) { * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync(String resourceGroupName, - String applicationGroupName, ApplicationGroupPatch applicationGroup) { + public Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String applicationGroupName, ApplicationGroupInner applicationGroup) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -556,19 +608,22 @@ public Mono> updateWithResponseAsync(String reso return Mono .error(new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null.")); } - if (applicationGroup != null) { + if (applicationGroup == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationGroup is required and cannot be null.")); + } else { applicationGroup.validate(); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationGroup, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update an applicationGroup. + * Create or update an applicationGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -581,8 +636,8 @@ public Mono> updateWithResponseAsync(String reso * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String applicationGroupName, ApplicationGroupPatch applicationGroup, Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String applicationGroupName, ApplicationGroupInner applicationGroup, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -599,34 +654,39 @@ private Mono> updateWithResponseAsync(String res return Mono .error(new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null.")); } - if (applicationGroup != null) { + if (applicationGroup == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationGroup is required and cannot be null.")); + } else { applicationGroup.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, applicationGroupName, applicationGroup, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationGroup, accept, + context); } /** - * Update an applicationGroup. + * Create or update an applicationGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. + * @param applicationGroup Object containing ApplicationGroup 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 ApplicationGroup definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String applicationGroupName) { - final ApplicationGroupPatch applicationGroup = null; - return updateWithResponseAsync(resourceGroupName, applicationGroupName, applicationGroup) + public Mono createOrUpdateAsync(String resourceGroupName, String applicationGroupName, + ApplicationGroupInner applicationGroup) { + return createOrUpdateWithResponseAsync(resourceGroupName, applicationGroupName, applicationGroup) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Update an applicationGroup. + * Create or update an applicationGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -638,43 +698,45 @@ public Mono updateAsync(String resourceGroupName, String * @return represents a ApplicationGroup definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String applicationGroupName, - ApplicationGroupPatch applicationGroup, Context context) { - return updateWithResponseAsync(resourceGroupName, applicationGroupName, applicationGroup, context).block(); + public Response createOrUpdateWithResponse(String resourceGroupName, + String applicationGroupName, ApplicationGroupInner applicationGroup, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, applicationGroupName, applicationGroup, context) + .block(); } /** - * Update an applicationGroup. + * Create or update an applicationGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. + * @param applicationGroup Object containing ApplicationGroup 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 ApplicationGroup definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationGroupInner update(String resourceGroupName, String applicationGroupName) { - final ApplicationGroupPatch applicationGroup = null; - return updateWithResponse(resourceGroupName, applicationGroupName, applicationGroup, Context.NONE).getValue(); + public ApplicationGroupInner createOrUpdate(String resourceGroupName, String applicationGroupName, + ApplicationGroupInner applicationGroup) { + return createOrUpdateWithResponse(resourceGroupName, applicationGroupName, applicationGroup, Context.NONE) + .getValue(); } /** - * List applicationGroups. + * Update an applicationGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param applicationGroupName The name of the application group. + * @param applicationGroup The AppGroup properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return applicationGroupList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return represents a ApplicationGroup definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String filter, Integer pageSize, Boolean isDescending, Integer initialSkip) { + public Mono> updateWithResponseAsync(String resourceGroupName, + String applicationGroupName, ApplicationGroupPatch applicationGroup) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -687,33 +749,37 @@ private Mono> listByResourceGroupSinglePage return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (applicationGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null.")); + } + if (applicationGroup != null) { + applicationGroup.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, isDescending, initialSkip, accept, + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationGroup, 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 applicationGroups. + * Update an applicationGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param applicationGroupName The name of the application group. + * @param applicationGroup The AppGroup properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return applicationGroupList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return represents a ApplicationGroup definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String filter, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, + String applicationGroupName, ApplicationGroupPatch applicationGroup, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -726,129 +792,82 @@ private Mono> listByResourceGroupSinglePage return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (applicationGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null.")); + } + if (applicationGroup != null) { + applicationGroup.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, isDescending, initialSkip, accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List applicationGroups. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return applicationGroupList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, - Integer pageSize, Boolean isDescending, Integer initialSkip) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, pageSize, isDescending, initialSkip), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, applicationGroup, accept, context); } /** - * List applicationGroups. + * Update an applicationGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 applicationGroupList as paginated response with {@link PagedFlux}. + * @return represents a ApplicationGroup definition on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String filter = null; - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, pageSize, isDescending, initialSkip), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String applicationGroupName) { + final ApplicationGroupPatch applicationGroup = null; + return updateWithResponseAsync(resourceGroupName, applicationGroupName, applicationGroup) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List applicationGroups. + * Update an applicationGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param applicationGroupName The name of the application group. + * @param applicationGroup The AppGroup properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return applicationGroupList as paginated response with {@link PagedFlux}. + * @return represents a ApplicationGroup definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, pageSize, - isDescending, initialSkip, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String applicationGroupName, + ApplicationGroupPatch applicationGroup, Context context) { + return updateWithResponseAsync(resourceGroupName, applicationGroupName, applicationGroup, context).block(); } /** - * List applicationGroups. + * Update an applicationGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 applicationGroupList as paginated response with {@link PagedIterable}. + * @return represents a ApplicationGroup definition. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final String filter = null; - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedIterable<>( - listByResourceGroupAsync(resourceGroupName, filter, pageSize, isDescending, initialSkip)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGroupInner update(String resourceGroupName, String applicationGroupName) { + final ApplicationGroupPatch applicationGroup = null; + return updateWithResponse(resourceGroupName, applicationGroupName, applicationGroup, Context.NONE).getValue(); } /** - * List applicationGroups. + * Remove an applicationGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return applicationGroupList as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, String filter, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedIterable<>( - listByResourceGroupAsync(resourceGroupName, filter, pageSize, isDescending, initialSkip, context)); - } - - /** - * List applicationGroups in subscription. - * - * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @param applicationGroupName The name of the application 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 applicationGroupList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter) { + public Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -857,27 +876,35 @@ private Mono> listSinglePageAsync(String fi return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), filter, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List applicationGroups in subscription. + * Remove an applicationGroup. * - * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 applicationGroupList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -886,86 +913,63 @@ private Mono> listSinglePageAsync(String fi return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), filter, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, accept, context); } /** - * List applicationGroups in subscription. + * Remove an applicationGroup. * - * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 applicationGroupList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(filter), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * List applicationGroups in subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return applicationGroupList as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String applicationGroupName) { + return deleteWithResponseAsync(resourceGroupName, applicationGroupName).flatMap(ignored -> Mono.empty()); } /** - * List applicationGroups in subscription. + * Remove an applicationGroup. * - * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 applicationGroupList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * List applicationGroups in subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return applicationGroupList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String applicationGroupName, Context context) { + return deleteWithResponseAsync(resourceGroupName, applicationGroupName, context).block(); } /** - * List applicationGroups in subscription. + * Remove an applicationGroup. * - * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 applicationGroupList as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String applicationGroupName) { + deleteWithResponse(resourceGroupName, applicationGroupName, Context.NONE); } /** @@ -975,10 +979,11 @@ public PagedIterable list(String filter, Context context) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return applicationGroupList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of ApplicationGroup definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -989,7 +994,7 @@ private Mono> listByResourceGroupNextSingle final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1003,10 +1008,11 @@ private Mono> listByResourceGroupNextSingle * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return applicationGroupList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of ApplicationGroup definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1017,7 +1023,7 @@ private Mono> listByResourceGroupNextSingle } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1029,10 +1035,11 @@ private Mono> listByResourceGroupNextSingle * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return applicationGroupList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of ApplicationGroup definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1043,7 +1050,7 @@ private Mono> listBySubscriptionNextSingleP final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1057,10 +1064,11 @@ private Mono> listBySubscriptionNextSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return applicationGroupList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of ApplicationGroup definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1071,7 +1079,7 @@ private Mono> listBySubscriptionNextSingleP } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupsImpl.java index d232201e4827..05f29fec1e54 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupsImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupsImpl.java @@ -27,6 +27,28 @@ public ApplicationGroupsImpl(ApplicationGroupsClient innerClient, this.serviceManager = serviceManager; } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Context context) { + PagedIterable inner = this.serviceClient().list(filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient() + .listByResourceGroup(resourceGroupName, filter, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationGroupImpl(inner1, this.manager())); + } + public Response getByResourceGroupWithResponse(String resourceGroupName, String applicationGroupName, Context context) { Response inner @@ -57,28 +79,6 @@ public void deleteByResourceGroup(String resourceGroupName, String applicationGr this.serviceClient().delete(resourceGroupName, applicationGroupName); } - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationGroupImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, String filter, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - PagedIterable inner = this.serviceClient() - .listByResourceGroup(resourceGroupName, filter, pageSize, isDescending, initialSkip, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationGroupImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationGroupImpl(inner1, this.manager())); - } - - public PagedIterable list(String filter, Context context) { - PagedIterable inner = this.serviceClient().list(filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationGroupImpl(inner1, this.manager())); - } - public ApplicationGroup getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationImpl.java index 32a5b21a85ad..af23b50a12c1 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationImpl.java @@ -9,9 +9,9 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationInner; import com.azure.resourcemanager.desktopvirtualization.models.Application; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationPatch; +import com.azure.resourcemanager.desktopvirtualization.models.ApplicationPatchProperties; import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; -import java.util.Map; public final class ApplicationImpl implements Application, Application.Definition, Application.Update { private ApplicationInner innerObject; @@ -189,121 +189,62 @@ public Application refresh(Context context) { } public ApplicationImpl withCommandLineSetting(CommandLineSetting commandLineSetting) { - if (isInCreateMode()) { - this.innerModel().withCommandLineSetting(commandLineSetting); - return this; - } else { - this.updateApplication.withCommandLineSetting(commandLineSetting); - return this; - } + this.innerModel().withCommandLineSetting(commandLineSetting); + return this; } public ApplicationImpl withDescription(String description) { - if (isInCreateMode()) { - this.innerModel().withDescription(description); - return this; - } else { - this.updateApplication.withDescription(description); - return this; - } + this.innerModel().withDescription(description); + return this; } public ApplicationImpl withFriendlyName(String friendlyName) { - if (isInCreateMode()) { - this.innerModel().withFriendlyName(friendlyName); - return this; - } else { - this.updateApplication.withFriendlyName(friendlyName); - return this; - } + this.innerModel().withFriendlyName(friendlyName); + return this; } public ApplicationImpl withFilePath(String filePath) { - if (isInCreateMode()) { - this.innerModel().withFilePath(filePath); - return this; - } else { - this.updateApplication.withFilePath(filePath); - return this; - } + this.innerModel().withFilePath(filePath); + return this; } public ApplicationImpl withMsixPackageFamilyName(String msixPackageFamilyName) { - if (isInCreateMode()) { - this.innerModel().withMsixPackageFamilyName(msixPackageFamilyName); - return this; - } else { - this.updateApplication.withMsixPackageFamilyName(msixPackageFamilyName); - return this; - } + this.innerModel().withMsixPackageFamilyName(msixPackageFamilyName); + return this; } public ApplicationImpl withMsixPackageApplicationId(String msixPackageApplicationId) { - if (isInCreateMode()) { - this.innerModel().withMsixPackageApplicationId(msixPackageApplicationId); - return this; - } else { - this.updateApplication.withMsixPackageApplicationId(msixPackageApplicationId); - return this; - } + this.innerModel().withMsixPackageApplicationId(msixPackageApplicationId); + return this; } public ApplicationImpl withApplicationType(RemoteApplicationType applicationType) { - if (isInCreateMode()) { - this.innerModel().withApplicationType(applicationType); - return this; - } else { - this.updateApplication.withApplicationType(applicationType); - return this; - } + this.innerModel().withApplicationType(applicationType); + return this; } public ApplicationImpl withCommandLineArguments(String commandLineArguments) { - if (isInCreateMode()) { - this.innerModel().withCommandLineArguments(commandLineArguments); - return this; - } else { - this.updateApplication.withCommandLineArguments(commandLineArguments); - return this; - } + this.innerModel().withCommandLineArguments(commandLineArguments); + return this; } public ApplicationImpl withShowInPortal(Boolean showInPortal) { - if (isInCreateMode()) { - this.innerModel().withShowInPortal(showInPortal); - return this; - } else { - this.updateApplication.withShowInPortal(showInPortal); - return this; - } + this.innerModel().withShowInPortal(showInPortal); + return this; } public ApplicationImpl withIconPath(String iconPath) { - if (isInCreateMode()) { - this.innerModel().withIconPath(iconPath); - return this; - } else { - this.updateApplication.withIconPath(iconPath); - return this; - } + this.innerModel().withIconPath(iconPath); + return this; } public ApplicationImpl withIconIndex(Integer iconIndex) { - if (isInCreateMode()) { - this.innerModel().withIconIndex(iconIndex); - return this; - } else { - this.updateApplication.withIconIndex(iconIndex); - return this; - } - } - - public ApplicationImpl withTags(Map tags) { - this.updateApplication.withTags(tags); + this.innerModel().withIconIndex(iconIndex); return this; } - private boolean isInCreateMode() { - return this.innerModel().id() == null; + public ApplicationImpl withProperties(ApplicationPatchProperties properties) { + this.updateApplication.withProperties(properties); + return this; } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationsClientImpl.java index 05564c5a80fc..aec05773571f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationsClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationsClientImpl.java @@ -67,6 +67,17 @@ public final class ApplicationsClientImpl implements ApplicationsClient { @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface ApplicationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGroupName") String applicationGroupName, @QueryParam("pageSize") Integer pageSize, + @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") @ExpectedResponses({ 200 }) @@ -90,17 +101,6 @@ Mono> createOrUpdate(@HostParam("$host") String endpo @BodyParam("application/json") ApplicationInner application, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationGroupName") String applicationGroupName, - @PathParam("applicationName") String applicationName, @HeaderParam("Accept") String accept, - Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") @ExpectedResponses({ 200 }) @@ -114,15 +114,15 @@ Mono> update(@HostParam("$host") String endpoint, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications") - @ExpectedResponses({ 200 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationGroupName") String applicationGroupName, @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, Context context); + @PathParam("applicationGroupName") String applicationGroupName, + @PathParam("applicationName") String applicationName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -133,19 +133,22 @@ Mono> listNext(@PathParam(value = "nextLink", encoded } /** - * Get an application. + * List applications. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param applicationName The name of the application within the specified application group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application along with {@link Response} on successful completion of {@link Mono}. + * @return list of Application definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String resourceGroupName, String applicationGroupName, - String applicationName) { + private Mono> listSinglePageAsync(String resourceGroupName, + String applicationGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -162,31 +165,34 @@ public Mono> getWithResponseAsync(String resourceGrou return Mono .error(new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null.")); } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName 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, applicationGroupName, applicationName, accept, context)) + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, pageSize, isDescending, + initialSkip, 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 an application. + * List applications. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param applicationName The name of the application within the specified application group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application along with {@link Response} on successful completion of {@link Mono}. + * @return list of Application definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String applicationGroupName, - String applicationName, Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, + String applicationGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -203,83 +209,131 @@ private Mono> getWithResponseAsync(String resourceGro return Mono .error(new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null.")); } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName 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, applicationGroupName, applicationName, accept, context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Get an application. + * List applications. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param applicationName The name of the application within the specified application group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application on successful completion of {@link Mono}. + * @return list of Application definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String applicationGroupName, - String applicationName) { - return getWithResponseAsync(resourceGroupName, applicationGroupName, applicationName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String applicationGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Get an application. + * List applications. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param applicationName The name of the application within the specified application 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 list of Application definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String applicationGroupName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List applications. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application along with {@link Response}. + * @return list of Application definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String applicationGroupName, - String applicationName, Context context) { - return getWithResponseAsync(resourceGroupName, applicationGroupName, applicationName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String applicationGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, applicationGroupName, pageSize, + isDescending, initialSkip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Get an application. + * List applications. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param applicationName The name of the application within the specified application 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 an application. + * @return list of Application definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationInner get(String resourceGroupName, String applicationGroupName, String applicationName) { - return getWithResponse(resourceGroupName, applicationGroupName, applicationName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String applicationGroupName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedIterable<>( + listAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip)); } /** - * Create or update an application. + * List applications. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Application definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context)); + } + + /** + * Get an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. - * @param application Object containing Application 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 schema for Application properties along with {@link Response} on successful completion of {@link Mono}. + * @return an application along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String applicationGroupName, String applicationName, ApplicationInner application) { + public Mono> getWithResponseAsync(String resourceGroupName, String applicationGroupName, + String applicationName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -300,35 +354,27 @@ public Mono> createOrUpdateWithResponseAsync(String r return Mono .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); } - if (application == null) { - return Mono.error(new IllegalArgumentException("Parameter application is required and cannot be null.")); - } else { - application.validate(); - } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationName, application, - accept, context)) + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update an application. + * Get an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. - * @param application Object containing Application 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 schema for Application properties along with {@link Response} on successful completion of {@link Mono}. + * @return an application along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String applicationGroupName, String applicationName, ApplicationInner application, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String applicationGroupName, + String applicationName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -349,90 +395,79 @@ private Mono> createOrUpdateWithResponseAsync(String return Mono .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); } - if (application == null) { - return Mono.error(new IllegalArgumentException("Parameter application is required and cannot be null.")); - } else { - application.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationName, application, - accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, applicationName, accept, context); } /** - * Create or update an application. + * Get an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. - * @param application Object containing Application 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 schema for Application properties on successful completion of {@link Mono}. + * @return an application on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String resourceGroupName, String applicationGroupName, - String applicationName, ApplicationInner application) { - return createOrUpdateWithResponseAsync(resourceGroupName, applicationGroupName, applicationName, application) + public Mono getAsync(String resourceGroupName, String applicationGroupName, + String applicationName) { + return getWithResponseAsync(resourceGroupName, applicationGroupName, applicationName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Create or update an application. + * Get an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. - * @param application Object containing Application 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 schema for Application properties along with {@link Response}. + * @return an application along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String applicationGroupName, - String applicationName, ApplicationInner application, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, applicationGroupName, applicationName, application, - context).block(); + public Response getWithResponse(String resourceGroupName, String applicationGroupName, + String applicationName, Context context) { + return getWithResponseAsync(resourceGroupName, applicationGroupName, applicationName, context).block(); } /** - * Create or update an application. + * Get an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. - * @param application Object containing Application 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 schema for Application properties. + * @return an application. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationInner createOrUpdate(String resourceGroupName, String applicationGroupName, - String applicationName, ApplicationInner application) { - return createOrUpdateWithResponse(resourceGroupName, applicationGroupName, applicationName, application, - Context.NONE).getValue(); + public ApplicationInner get(String resourceGroupName, String applicationGroupName, String applicationName) { + return getWithResponse(resourceGroupName, applicationGroupName, applicationName, Context.NONE).getValue(); } /** - * Remove an application. + * Create or update an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. + * @param application Object containing Application 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 Response} on successful completion of {@link Mono}. + * @return schema for Application properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName, - String applicationName) { + public Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String applicationGroupName, String applicationName, ApplicationInner application) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -453,27 +488,35 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St return Mono .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); } + if (application == null) { + return Mono.error(new IllegalArgumentException("Parameter application is required and cannot be null.")); + } else { + application.validate(); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationName, accept, context)) + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationName, application, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Remove an application. + * Create or update an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. + * @param application Object containing Application 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 Response} on successful completion of {@link Mono}. + * @return schema for Application properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName, - String applicationName, Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String applicationGroupName, String applicationName, ApplicationInner application, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -494,60 +537,74 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); } + if (application == null) { + return Mono.error(new IllegalArgumentException("Parameter application is required and cannot be null.")); + } else { + application.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, applicationGroupName, applicationName, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationName, application, + accept, context); } /** - * Remove an application. + * Create or update an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. + * @param application Object containing Application 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 A {@link Mono} that completes when a successful response is received. + * @return schema for Application properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String applicationGroupName, String applicationName) { - return deleteWithResponseAsync(resourceGroupName, applicationGroupName, applicationName) - .flatMap(ignored -> Mono.empty()); + public Mono createOrUpdateAsync(String resourceGroupName, String applicationGroupName, + String applicationName, ApplicationInner application) { + return createOrUpdateWithResponseAsync(resourceGroupName, applicationGroupName, applicationName, application) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove an application. + * Create or update an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. + * @param application Object containing Application 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 Response}. + * @return schema for Application properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String applicationGroupName, - String applicationName, Context context) { - return deleteWithResponseAsync(resourceGroupName, applicationGroupName, applicationName, context).block(); + public Response createOrUpdateWithResponse(String resourceGroupName, String applicationGroupName, + String applicationName, ApplicationInner application, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, applicationGroupName, applicationName, application, + context).block(); } /** - * Remove an application. + * Create or update an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. + * @param application Object containing Application 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 schema for Application properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String applicationGroupName, String applicationName) { - deleteWithResponse(resourceGroupName, applicationGroupName, applicationName, Context.NONE); + public ApplicationInner createOrUpdate(String resourceGroupName, String applicationGroupName, + String applicationName, ApplicationInner application) { + return createOrUpdateWithResponse(resourceGroupName, applicationGroupName, applicationName, application, + Context.NONE).getValue(); } /** @@ -556,7 +613,7 @@ public void delete(String resourceGroupName, String applicationGroupName, String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. - * @param application Object containing Application definitions. + * @param application The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -602,7 +659,7 @@ public Mono> updateWithResponseAsync(String resourceG * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. - * @param application Object containing Application definitions. + * @param application The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -666,7 +723,7 @@ public Mono updateAsync(String resourceGroupName, String appli * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param applicationName The name of the application within the specified application group. - * @param application Object containing Application definitions. + * @param application The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -699,21 +756,19 @@ public ApplicationInner update(String resourceGroupName, String applicationGroup } /** - * List applications. + * Remove an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param applicationName The name of the application within the specified application 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 applicationList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String applicationGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + public Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName, + String applicationName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -730,33 +785,31 @@ private Mono> listSinglePageAsync(String resourc return Mono .error(new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null.")); } + if (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, pageSize, isDescending, - initialSkip, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List applications. + * Remove an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param applicationName The name of the application within the specified application 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 applicationList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String applicationGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName, + String applicationName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -773,115 +826,64 @@ private Mono> listSinglePageAsync(String resourc return Mono .error(new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null.")); } + if (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List applications. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return applicationList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String applicationGroupName, - Integer pageSize, Boolean isDescending, Integer initialSkip) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip), - nextLink -> listNextSinglePageAsync(nextLink)); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, applicationName, accept, context); } /** - * List applications. + * Remove an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. + * @param applicationName The name of the application within the specified application 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 applicationList as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String applicationGroupName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String applicationGroupName, String applicationName) { + return deleteWithResponseAsync(resourceGroupName, applicationGroupName, applicationName) + .flatMap(ignored -> Mono.empty()); } /** - * List applications. + * Remove an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param applicationName The name of the application within the specified application 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 applicationList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String applicationGroupName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, applicationGroupName, pageSize, - isDescending, initialSkip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List applications. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application 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 applicationList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String applicationGroupName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedIterable<>( - listAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String applicationGroupName, + String applicationName, Context context) { + return deleteWithResponseAsync(resourceGroupName, applicationGroupName, applicationName, context).block(); } /** - * List applications. + * Remove an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param applicationName The name of the application within the specified application 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 applicationList as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String applicationGroupName, String applicationName) { + deleteWithResponse(resourceGroupName, applicationGroupName, applicationName, Context.NONE); } /** @@ -891,7 +893,8 @@ public PagedIterable list(String resourceGroupName, String app * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return applicationList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of Application definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -917,7 +920,8 @@ private Mono> listNextSinglePageAsync(String nex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return applicationList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of Application definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationsImpl.java index d45004c16ea5..7b2dc1feae04 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationsImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationsImpl.java @@ -27,6 +27,18 @@ public ApplicationsImpl(ApplicationsClient innerClient, this.serviceManager = serviceManager; } + public PagedIterable list(String resourceGroupName, String applicationGroupName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, applicationGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); + } + public Response getWithResponse(String resourceGroupName, String applicationGroupName, String applicationName, Context context) { Response inner @@ -58,18 +70,6 @@ public void delete(String resourceGroupName, String applicationGroupName, String this.serviceClient().delete(resourceGroupName, applicationGroupName, applicationName); } - public PagedIterable list(String resourceGroupName, String applicationGroupName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, applicationGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context) { - PagedIterable inner = this.serviceClient() - .list(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); - } - public Application getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { 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..26429079c595 --- /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 actions on a session host update. + * + * @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 The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 actions on a session host update. + * + * @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 The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 actions on a session host update. + * + * @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 The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 actions on a session host update. + * + * @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 The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 actions on a session host update. + * + * @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 The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 actions on a session host update. + * + * @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 The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 actions on a session host update. + * + * @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 The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 actions on a session host update. + * + * @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 The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 actions on a session host update. + * + * @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 The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 actions on a session host update. + * + * @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 The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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..d6b8fad96e09 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,9 @@ 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.SessionHostsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.StartMenuItemsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient; @@ -155,45 +161,45 @@ public OperationsClient getOperations() { } /** - * The WorkspacesClient object to access its operations. + * The AppAttachPackagesClient object to access its operations. */ - private final WorkspacesClient workspaces; + private final AppAttachPackagesClient appAttachPackages; /** - * Gets the WorkspacesClient object to access its operations. + * Gets the AppAttachPackagesClient object to access its operations. * - * @return the WorkspacesClient object. + * @return the AppAttachPackagesClient object. */ - public WorkspacesClient getWorkspaces() { - return this.workspaces; + public AppAttachPackagesClient getAppAttachPackages() { + return this.appAttachPackages; } /** - * The PrivateEndpointConnectionsClient object to access its operations. + * The ApplicationGroupsClient object to access its operations. */ - private final PrivateEndpointConnectionsClient privateEndpointConnections; + private final ApplicationGroupsClient applicationGroups; /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. + * Gets the ApplicationGroupsClient object to access its operations. * - * @return the PrivateEndpointConnectionsClient object. + * @return the ApplicationGroupsClient object. */ - public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { - return this.privateEndpointConnections; + public ApplicationGroupsClient getApplicationGroups() { + return this.applicationGroups; } /** - * The PrivateLinkResourcesClient object to access its operations. + * The HostPoolsClient object to access its operations. */ - private final PrivateLinkResourcesClient privateLinkResources; + private final HostPoolsClient hostPools; /** - * Gets the PrivateLinkResourcesClient object to access its operations. + * Gets the HostPoolsClient object to access its operations. * - * @return the PrivateLinkResourcesClient object. + * @return the HostPoolsClient object. */ - public PrivateLinkResourcesClient getPrivateLinkResources() { - return this.privateLinkResources; + public HostPoolsClient getHostPools() { + return this.hostPools; } /** @@ -211,45 +217,45 @@ public ScalingPlansClient getScalingPlans() { } /** - * The ScalingPlanPooledSchedulesClient object to access its operations. + * The WorkspacesClient object to access its operations. */ - private final ScalingPlanPooledSchedulesClient scalingPlanPooledSchedules; + private final WorkspacesClient workspaces; /** - * Gets the ScalingPlanPooledSchedulesClient object to access its operations. + * Gets the WorkspacesClient object to access its operations. * - * @return the ScalingPlanPooledSchedulesClient object. + * @return the WorkspacesClient object. */ - public ScalingPlanPooledSchedulesClient getScalingPlanPooledSchedules() { - return this.scalingPlanPooledSchedules; + public WorkspacesClient getWorkspaces() { + return this.workspaces; } /** - * The ScalingPlanPersonalSchedulesClient object to access its operations. + * The ApplicationsClient object to access its operations. */ - private final ScalingPlanPersonalSchedulesClient scalingPlanPersonalSchedules; + private final ApplicationsClient applications; /** - * Gets the ScalingPlanPersonalSchedulesClient object to access its operations. + * Gets the ApplicationsClient object to access its operations. * - * @return the ScalingPlanPersonalSchedulesClient object. + * @return the ApplicationsClient object. */ - public ScalingPlanPersonalSchedulesClient getScalingPlanPersonalSchedules() { - return this.scalingPlanPersonalSchedules; + public ApplicationsClient getApplications() { + return this.applications; } /** - * The ApplicationGroupsClient object to access its operations. + * The DesktopsClient object to access its operations. */ - private final ApplicationGroupsClient applicationGroups; + private final DesktopsClient desktops; /** - * Gets the ApplicationGroupsClient object to access its operations. + * Gets the DesktopsClient object to access its operations. * - * @return the ApplicationGroupsClient object. + * @return the DesktopsClient object. */ - public ApplicationGroupsClient getApplicationGroups() { - return this.applicationGroups; + public DesktopsClient getDesktops() { + return this.desktops; } /** @@ -267,129 +273,213 @@ public StartMenuItemsClient getStartMenuItems() { } /** - * The ApplicationsClient object to access its operations. + * The ActiveSessionHostConfigurationsClient object to access its operations. */ - private final ApplicationsClient applications; + private final ActiveSessionHostConfigurationsClient activeSessionHostConfigurations; /** - * Gets the ApplicationsClient object to access its operations. + * Gets the ActiveSessionHostConfigurationsClient object to access its operations. * - * @return the ApplicationsClient object. + * @return the ActiveSessionHostConfigurationsClient object. */ - public ApplicationsClient getApplications() { - return this.applications; + public ActiveSessionHostConfigurationsClient getActiveSessionHostConfigurations() { + return this.activeSessionHostConfigurations; } /** - * The DesktopsClient object to access its operations. + * The MsixImagesClient object to access its operations. */ - private final DesktopsClient desktops; + private final MsixImagesClient msixImages; /** - * Gets the DesktopsClient object to access its operations. + * Gets the MsixImagesClient object to access its operations. * - * @return the DesktopsClient object. + * @return the MsixImagesClient object. */ - public DesktopsClient getDesktops() { - return this.desktops; + public MsixImagesClient getMsixImages() { + return this.msixImages; } /** - * The HostPoolsClient object to access its operations. + * The AppAttachPackageInfoesClient object to access its operations. */ - private final HostPoolsClient hostPools; + private final AppAttachPackageInfoesClient appAttachPackageInfoes; /** - * Gets the HostPoolsClient object to access its operations. + * Gets the AppAttachPackageInfoesClient object to access its operations. * - * @return the HostPoolsClient object. + * @return the AppAttachPackageInfoesClient object. */ - public HostPoolsClient getHostPools() { - return this.hostPools; + public AppAttachPackageInfoesClient getAppAttachPackageInfoes() { + return this.appAttachPackageInfoes; } /** - * The UserSessionsClient object to access its operations. + * The MsixPackagesClient object to access its operations. */ - private final UserSessionsClient userSessions; + private final MsixPackagesClient msixPackages; /** - * Gets the UserSessionsClient object to access its operations. + * Gets the MsixPackagesClient object to access its operations. * - * @return the UserSessionsClient object. + * @return the MsixPackagesClient object. */ - public UserSessionsClient getUserSessions() { - return this.userSessions; + public MsixPackagesClient getMsixPackages() { + return this.msixPackages; } /** - * The SessionHostsClient object to access its operations. + * The PrivateEndpointConnectionsClient object to access its operations. */ - private final SessionHostsClient sessionHosts; + private final PrivateEndpointConnectionsClient privateEndpointConnections; /** - * Gets the SessionHostsClient object to access its operations. + * Gets the PrivateEndpointConnectionsClient object to access its operations. * - * @return the SessionHostsClient object. + * @return the PrivateEndpointConnectionsClient object. */ - public SessionHostsClient getSessionHosts() { - return this.sessionHosts; + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; } /** - * The MsixPackagesClient object to access its operations. + * The PrivateLinkResourcesClient object to access its operations. */ - private final MsixPackagesClient msixPackages; + private final PrivateLinkResourcesClient privateLinkResources; /** - * Gets the MsixPackagesClient object to access its operations. + * Gets the PrivateLinkResourcesClient object to access its operations. * - * @return the MsixPackagesClient object. + * @return the PrivateLinkResourcesClient object. */ - public MsixPackagesClient getMsixPackages() { - return this.msixPackages; + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; } /** - * The AppAttachPackageInfoesClient object to access its operations. + * The SessionHostConfigurationsClient object to access its operations. */ - private final AppAttachPackageInfoesClient appAttachPackageInfoes; + private final SessionHostConfigurationsClient sessionHostConfigurations; /** - * Gets the AppAttachPackageInfoesClient object to access its operations. + * Gets the SessionHostConfigurationsClient object to access its operations. * - * @return the AppAttachPackageInfoesClient object. + * @return the SessionHostConfigurationsClient object. */ - public AppAttachPackageInfoesClient getAppAttachPackageInfoes() { - return this.appAttachPackageInfoes; + public SessionHostConfigurationsClient getSessionHostConfigurations() { + return this.sessionHostConfigurations; } /** - * The MsixImagesClient object to access its operations. + * The SessionHostManagementsClient object to access its operations. */ - private final MsixImagesClient msixImages; + private final SessionHostManagementsClient sessionHostManagements; /** - * Gets the MsixImagesClient object to access its operations. + * Gets the SessionHostManagementsClient object to access its operations. * - * @return the MsixImagesClient object. + * @return the SessionHostManagementsClient object. */ - public MsixImagesClient getMsixImages() { - return this.msixImages; + public SessionHostManagementsClient getSessionHostManagements() { + return this.sessionHostManagements; } /** - * The AppAttachPackagesClient object to access its operations. + * The ControlSessionHostUpdatesClient object to access its operations. */ - private final AppAttachPackagesClient appAttachPackages; + private final ControlSessionHostUpdatesClient controlSessionHostUpdates; /** - * Gets the AppAttachPackagesClient object to access its operations. + * Gets the ControlSessionHostUpdatesClient object to access its operations. * - * @return the AppAttachPackagesClient object. + * @return the ControlSessionHostUpdatesClient object. */ - public AppAttachPackagesClient getAppAttachPackages() { - return this.appAttachPackages; + public ControlSessionHostUpdatesClient getControlSessionHostUpdates() { + return this.controlSessionHostUpdates; + } + + /** + * 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 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 SessionHostsClient object to access its operations. + */ + private final SessionHostsClient sessionHosts; + + /** + * Gets the SessionHostsClient object to access its operations. + * + * @return the SessionHostsClient object. + */ + public SessionHostsClient getSessionHosts() { + return this.sessionHosts; + } + + /** + * The UserSessionsClient object to access its operations. + */ + private final UserSessionsClient userSessions; + + /** + * Gets the UserSessionsClient object to access its operations. + * + * @return the UserSessionsClient object. + */ + public UserSessionsClient getUserSessions() { + return this.userSessions; + } + + /** + * The ScalingPlanPersonalSchedulesClient object to access its operations. + */ + private final ScalingPlanPersonalSchedulesClient scalingPlanPersonalSchedules; + + /** + * Gets the ScalingPlanPersonalSchedulesClient object to access its operations. + * + * @return the ScalingPlanPersonalSchedulesClient object. + */ + public ScalingPlanPersonalSchedulesClient getScalingPlanPersonalSchedules() { + return this.scalingPlanPersonalSchedules; + } + + /** + * The ScalingPlanPooledSchedulesClient object to access its operations. + */ + private final ScalingPlanPooledSchedulesClient scalingPlanPooledSchedules; + + /** + * Gets the ScalingPlanPooledSchedulesClient object to access its operations. + * + * @return the ScalingPlanPooledSchedulesClient object. + */ + public ScalingPlanPooledSchedulesClient getScalingPlanPooledSchedules() { + return this.scalingPlanPooledSchedules; } /** @@ -409,25 +499,31 @@ public AppAttachPackagesClient getAppAttachPackages() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2024-04-03"; + this.apiVersion = "2024-08-08-preview"; this.operations = new OperationsClientImpl(this); - this.workspaces = new WorkspacesClientImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); - this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); - this.scalingPlans = new ScalingPlansClientImpl(this); - this.scalingPlanPooledSchedules = new ScalingPlanPooledSchedulesClientImpl(this); - this.scalingPlanPersonalSchedules = new ScalingPlanPersonalSchedulesClientImpl(this); + this.appAttachPackages = new AppAttachPackagesClientImpl(this); this.applicationGroups = new ApplicationGroupsClientImpl(this); - this.startMenuItems = new StartMenuItemsClientImpl(this); + this.hostPools = new HostPoolsClientImpl(this); + this.scalingPlans = new ScalingPlansClientImpl(this); + this.workspaces = new WorkspacesClientImpl(this); this.applications = new ApplicationsClientImpl(this); this.desktops = new DesktopsClientImpl(this); - this.hostPools = new HostPoolsClientImpl(this); - this.userSessions = new UserSessionsClientImpl(this); - this.sessionHosts = new SessionHostsClientImpl(this); - this.msixPackages = new MsixPackagesClientImpl(this); - this.appAttachPackageInfoes = new AppAttachPackageInfoesClientImpl(this); + this.startMenuItems = new StartMenuItemsClientImpl(this); + this.activeSessionHostConfigurations = new ActiveSessionHostConfigurationsClientImpl(this); this.msixImages = new MsixImagesClientImpl(this); - this.appAttachPackages = new AppAttachPackagesClientImpl(this); + this.appAttachPackageInfoes = new AppAttachPackageInfoesClientImpl(this); + this.msixPackages = new MsixPackagesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.sessionHostConfigurations = new SessionHostConfigurationsClientImpl(this); + this.sessionHostManagements = new SessionHostManagementsClientImpl(this); + this.controlSessionHostUpdates = new ControlSessionHostUpdatesClientImpl(this); + this.initiateSessionHostUpdates = new InitiateSessionHostUpdatesClientImpl(this); + this.sessionHostManagementsUpdateStatus = new SessionHostManagementsUpdateStatusClientImpl(this); + this.sessionHosts = new SessionHostsClientImpl(this); + this.userSessions = new UserSessionsClientImpl(this); + this.scalingPlanPersonalSchedules = new ScalingPlanPersonalSchedulesClientImpl(this); + this.scalingPlanPooledSchedules = new ScalingPlanPooledSchedulesClientImpl(this); } /** diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopsClientImpl.java index 238ccde29813..dd689e3a842e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopsClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopsClientImpl.java @@ -64,6 +64,17 @@ public final class DesktopsClientImpl implements DesktopsClient { @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface DesktopsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGroupName") String applicationGroupName, @QueryParam("pageSize") Integer pageSize, + @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}") @ExpectedResponses({ 200 }) @@ -85,17 +96,6 @@ Mono> update(@HostParam("$host") String endpoint, @PathParam("desktopName") String desktopName, @BodyParam("application/json") DesktopPatch desktop, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationGroupName") String applicationGroupName, @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -105,19 +105,21 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = tr } /** - * Get a desktop. + * List desktops. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param desktopName The name of the desktop within the specified desktop group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a desktop along with {@link Response} on successful completion of {@link Mono}. + * @return list of Desktop definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String resourceGroupName, String applicationGroupName, - String desktopName) { + private Mono> listSinglePageAsync(String resourceGroupName, String applicationGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -134,31 +136,33 @@ public Mono> getWithResponseAsync(String resourceGroupNam return Mono .error(new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null.")); } - if (desktopName == null) { - return Mono.error(new IllegalArgumentException("Parameter desktopName 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, applicationGroupName, desktopName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, pageSize, isDescending, + initialSkip, 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 a desktop. + * List desktops. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param desktopName The name of the desktop within the specified desktop group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a desktop along with {@link Response} on successful completion of {@link Mono}. + * @return list of Desktop definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String applicationGroupName, - String desktopName, Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String applicationGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -175,81 +179,131 @@ private Mono> getWithResponseAsync(String resourceGroupNa return Mono .error(new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null.")); } - if (desktopName == null) { - return Mono.error(new IllegalArgumentException("Parameter desktopName 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, applicationGroupName, desktopName, accept, context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Get a desktop. + * List desktops. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param desktopName The name of the desktop within the specified desktop group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a desktop on successful completion of {@link Mono}. + * @return list of Desktop definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String applicationGroupName, String desktopName) { - return getWithResponseAsync(resourceGroupName, applicationGroupName, desktopName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Get a desktop. + * List desktops. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param desktopName The name of the desktop within the specified desktop 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 list of Desktop definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String applicationGroupName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List desktops. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a desktop along with {@link Response}. + * @return list of Desktop definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String applicationGroupName, - String desktopName, Context context) { - return getWithResponseAsync(resourceGroupName, applicationGroupName, desktopName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, applicationGroupName, pageSize, + isDescending, initialSkip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Get a desktop. + * List desktops. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param desktopName The name of the desktop within the specified desktop 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 desktop. + * @return list of Desktop definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DesktopInner get(String resourceGroupName, String applicationGroupName, String desktopName) { - return getWithResponse(resourceGroupName, applicationGroupName, desktopName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String applicationGroupName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedIterable<>( + listAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip)); } /** - * Update a desktop. + * List desktops. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Desktop definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context)); + } + + /** + * Get a desktop. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param desktopName The name of the desktop within the specified desktop group. - * @param desktop Object containing Desktop 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 schema for Desktop properties along with {@link Response} on successful completion of {@link Mono}. + * @return a desktop along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync(String resourceGroupName, String applicationGroupName, - String desktopName, DesktopPatch desktop) { + public Mono> getWithResponseAsync(String resourceGroupName, String applicationGroupName, + String desktopName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -269,33 +323,28 @@ public Mono> updateWithResponseAsync(String resourceGroup if (desktopName == null) { return Mono.error(new IllegalArgumentException("Parameter desktopName is required and cannot be null.")); } - if (desktop != null) { - desktop.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, desktopName, desktop, accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, desktopName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update a desktop. + * Get a desktop. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param desktopName The name of the desktop within the specified desktop group. - * @param desktop Object containing Desktop 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 schema for Desktop properties along with {@link Response} on successful completion of {@link Mono}. + * @return a desktop along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String applicationGroupName, - String desktopName, DesktopPatch desktop, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String applicationGroupName, + String desktopName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -315,17 +364,14 @@ private Mono> updateWithResponseAsync(String resourceGrou if (desktopName == null) { return Mono.error(new IllegalArgumentException("Parameter desktopName is required and cannot be null.")); } - if (desktop != null) { - desktop.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, applicationGroupName, desktopName, desktop, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, desktopName, accept, context); } /** - * Update a desktop. + * Get a desktop. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -333,36 +379,34 @@ private Mono> updateWithResponseAsync(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema for Desktop properties on successful completion of {@link Mono}. + * @return a desktop on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String applicationGroupName, String desktopName) { - final DesktopPatch desktop = null; - return updateWithResponseAsync(resourceGroupName, applicationGroupName, desktopName, desktop) + public Mono getAsync(String resourceGroupName, String applicationGroupName, String desktopName) { + return getWithResponseAsync(resourceGroupName, applicationGroupName, desktopName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Update a desktop. + * Get a desktop. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param desktopName The name of the desktop within the specified desktop group. - * @param desktop Object containing Desktop 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 schema for Desktop properties along with {@link Response}. + * @return a desktop along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String applicationGroupName, - String desktopName, DesktopPatch desktop, Context context) { - return updateWithResponseAsync(resourceGroupName, applicationGroupName, desktopName, desktop, context).block(); + public Response getWithResponse(String resourceGroupName, String applicationGroupName, + String desktopName, Context context) { + return getWithResponseAsync(resourceGroupName, applicationGroupName, desktopName, context).block(); } /** - * Update a desktop. + * Get a desktop. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -370,31 +414,28 @@ public Response updateWithResponse(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema for Desktop properties. + * @return a desktop. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DesktopInner update(String resourceGroupName, String applicationGroupName, String desktopName) { - final DesktopPatch desktop = null; - return updateWithResponse(resourceGroupName, applicationGroupName, desktopName, desktop, Context.NONE) - .getValue(); + public DesktopInner get(String resourceGroupName, String applicationGroupName, String desktopName) { + return getWithResponse(resourceGroupName, applicationGroupName, desktopName, Context.NONE).getValue(); } /** - * List desktops. + * Update a desktop. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param desktopName The name of the desktop within the specified desktop group. + * @param desktop The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return desktopList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return schema for Desktop properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String applicationGroupName, - Integer pageSize, Boolean isDescending, Integer initialSkip) { + public Mono> updateWithResponseAsync(String resourceGroupName, String applicationGroupName, + String desktopName, DesktopPatch desktop) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -411,33 +452,36 @@ private Mono> listSinglePageAsync(String resourceGro return Mono .error(new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null.")); } + if (desktopName == null) { + return Mono.error(new IllegalArgumentException("Parameter desktopName is required and cannot be null.")); + } + if (desktop != null) { + desktop.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, pageSize, isDescending, - initialSkip, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, desktopName, desktop, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List desktops. + * Update a desktop. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param desktopName The name of the desktop within the specified desktop group. + * @param desktop The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return desktopList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return schema for Desktop properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String applicationGroupName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, String applicationGroupName, + String desktopName, DesktopPatch desktop, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -454,115 +498,71 @@ private Mono> listSinglePageAsync(String resourceGro return Mono .error(new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null.")); } + if (desktopName == null) { + return Mono.error(new IllegalArgumentException("Parameter desktopName is required and cannot be null.")); + } + if (desktop != null) { + desktop.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List desktops. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return desktopList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String applicationGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip), - nextLink -> listNextSinglePageAsync(nextLink)); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, desktopName, desktop, accept, context); } /** - * List desktops. + * Update a desktop. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. + * @param desktopName The name of the desktop within the specified desktop 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 desktopList as paginated response with {@link PagedFlux}. + * @return schema for Desktop properties on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String applicationGroupName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String applicationGroupName, String desktopName) { + final DesktopPatch desktop = null; + return updateWithResponseAsync(resourceGroupName, applicationGroupName, desktopName, desktop) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List desktops. + * Update a desktop. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param desktopName The name of the desktop within the specified desktop group. + * @param desktop The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return desktopList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String applicationGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, applicationGroupName, pageSize, - isDescending, initialSkip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List desktops. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application 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 desktopList as paginated response with {@link PagedIterable}. + * @return schema for Desktop properties along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String applicationGroupName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedIterable<>( - listAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String applicationGroupName, + String desktopName, DesktopPatch desktop, Context context) { + return updateWithResponseAsync(resourceGroupName, applicationGroupName, desktopName, desktop, context).block(); } /** - * List desktops. + * Update a desktop. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param desktopName The name of the desktop within the specified desktop 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 desktopList as paginated response with {@link PagedIterable}. + * @return schema for Desktop properties. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public DesktopInner update(String resourceGroupName, String applicationGroupName, String desktopName) { + final DesktopPatch desktop = null; + return updateWithResponse(resourceGroupName, applicationGroupName, desktopName, desktop, Context.NONE) + .getValue(); } /** @@ -572,7 +572,7 @@ public PagedIterable list(String resourceGroupName, String applica * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return desktopList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of Desktop definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -598,7 +598,7 @@ private Mono> listNextSinglePageAsync(String nextLin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return desktopList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of Desktop definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopsImpl.java index 018ae1a083ea..d0850d1ae31d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopsImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopsImpl.java @@ -28,6 +28,18 @@ public DesktopsImpl(DesktopsClient innerClient, this.serviceManager = serviceManager; } + public PagedIterable list(String resourceGroupName, String applicationGroupName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, applicationGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DesktopImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DesktopImpl(inner1, this.manager())); + } + public Response getWithResponse(String resourceGroupName, String applicationGroupName, String desktopName, Context context) { Response inner @@ -70,18 +82,6 @@ public Desktop update(String resourceGroupName, String applicationGroupName, Str } } - public PagedIterable list(String resourceGroupName, String applicationGroupName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, applicationGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DesktopImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context) { - PagedIterable inner = this.serviceClient() - .list(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DesktopImpl(inner1, this.manager())); - } - private DesktopsClient serviceClient() { return this.innerClient; } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ExpandMsixImageImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ExpandMsixImageImpl.java index a20b790faf34..838344a82eec 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ExpandMsixImageImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ExpandMsixImageImpl.java @@ -7,11 +7,7 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ExpandMsixImageInner; import com.azure.resourcemanager.desktopvirtualization.models.ExpandMsixImage; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; +import com.azure.resourcemanager.desktopvirtualization.models.ExpandMsixImageProperties; public final class ExpandMsixImageImpl implements ExpandMsixImage { private ExpandMsixImageInner innerObject; @@ -36,78 +32,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String packageAlias() { - return this.innerModel().packageAlias(); - } - - public String imagePath() { - return this.innerModel().imagePath(); - } - - public String packageName() { - return this.innerModel().packageName(); - } - - public String packageFamilyName() { - return this.innerModel().packageFamilyName(); - } - - public String packageFullName() { - return this.innerModel().packageFullName(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String packageRelativePath() { - return this.innerModel().packageRelativePath(); + public ExpandMsixImageProperties properties() { + return this.innerModel().properties(); } - public Boolean isRegularRegistration() { - return this.innerModel().isRegularRegistration(); - } - - public Boolean isActive() { - return this.innerModel().isActive(); - } - - public List packageDependencies() { - List inner = this.innerModel().packageDependencies(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String version() { - return this.innerModel().version(); - } - - public OffsetDateTime lastUpdated() { - return this.innerModel().lastUpdated(); - } - - public List packageApplications() { - List inner = this.innerModel().packageApplications(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String certificateName() { - return this.innerModel().certificateName(); - } - - public OffsetDateTime certificateExpiry() { - return this.innerModel().certificateExpiry(); + public SystemData systemData() { + return this.innerModel().systemData(); } public ExpandMsixImageInner innerModel() { 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..adbb6dee4ad3 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 @@ -10,22 +10,26 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.HostPoolInner; 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.HostPoolPatchProperties; 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; @@ -61,30 +65,30 @@ public Map tags() { } } - public String managedBy() { - return this.innerModel().managedBy(); - } - - public String kind() { - return this.innerModel().kind(); + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); } public String etag() { return this.innerModel().etag(); } - public ResourceModelWithAllowedPropertySetIdentity identity() { - return this.innerModel().identity(); + public String kind() { + return this.innerModel().kind(); } - public ResourceModelWithAllowedPropertySetSku sku() { - return this.innerModel().sku(); + public String managedBy() { + return this.innerModel().managedBy(); } - public ResourceModelWithAllowedPropertySetPlan plan() { + public Plan plan() { return this.innerModel().plan(); } + public Sku sku() { + return this.innerModel().sku(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -205,6 +209,26 @@ 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 ManagementType managementType() { + return this.innerModel().managementType(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -304,6 +328,14 @@ public HostPool refresh(Context context) { return this; } + public Response listRegistrationTokensWithResponse(Context context) { + return serviceManager.hostPools().listRegistrationTokensWithResponse(resourceGroupName, hostPoolName, context); + } + + public RegistrationTokenList listRegistrationTokens() { + return serviceManager.hostPools().listRegistrationTokens(resourceGroupName, hostPoolName); + } + public Response retrieveRegistrationTokenWithResponse(Context context) { return serviceManager.hostPools() .retrieveRegistrationTokenWithResponse(resourceGroupName, hostPoolName, context); @@ -313,14 +345,6 @@ public RegistrationInfo retrieveRegistrationToken() { return serviceManager.hostPools().retrieveRegistrationToken(resourceGroupName, hostPoolName); } - public Response listRegistrationTokensWithResponse(Context context) { - return serviceManager.hostPools().listRegistrationTokensWithResponse(resourceGroupName, hostPoolName, context); - } - - public RegistrationTokenList listRegistrationTokens() { - return serviceManager.hostPools().listRegistrationTokens(resourceGroupName, hostPoolName); - } - public HostPoolImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -337,23 +361,13 @@ public HostPoolImpl withHostPoolType(HostPoolType hostPoolType) { } public HostPoolImpl withLoadBalancerType(LoadBalancerType loadBalancerType) { - if (isInCreateMode()) { - this.innerModel().withLoadBalancerType(loadBalancerType); - return this; - } else { - this.updateHostPool.withLoadBalancerType(loadBalancerType); - return this; - } + this.innerModel().withLoadBalancerType(loadBalancerType); + return this; } public HostPoolImpl withPreferredAppGroupType(PreferredAppGroupType preferredAppGroupType) { - if (isInCreateMode()) { - this.innerModel().withPreferredAppGroupType(preferredAppGroupType); - return this; - } else { - this.updateHostPool.withPreferredAppGroupType(preferredAppGroupType); - return this; - } + this.innerModel().withPreferredAppGroupType(preferredAppGroupType); + return this; } public HostPoolImpl withTags(Map tags) { @@ -366,8 +380,8 @@ public HostPoolImpl withTags(Map tags) { } } - public HostPoolImpl withManagedBy(String managedBy) { - this.innerModel().withManagedBy(managedBy); + public HostPoolImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); return this; } @@ -376,89 +390,54 @@ public HostPoolImpl withKind(String kind) { return this; } - public HostPoolImpl withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { - this.innerModel().withIdentity(identity); + public HostPoolImpl withManagedBy(String managedBy) { + this.innerModel().withManagedBy(managedBy); return this; } - public HostPoolImpl withSku(ResourceModelWithAllowedPropertySetSku sku) { - this.innerModel().withSku(sku); + public HostPoolImpl withPlan(Plan plan) { + this.innerModel().withPlan(plan); return this; } - public HostPoolImpl withPlan(ResourceModelWithAllowedPropertySetPlan plan) { - this.innerModel().withPlan(plan); + public HostPoolImpl withSku(Sku sku) { + this.innerModel().withSku(sku); return this; } public HostPoolImpl withFriendlyName(String friendlyName) { - if (isInCreateMode()) { - this.innerModel().withFriendlyName(friendlyName); - return this; - } else { - this.updateHostPool.withFriendlyName(friendlyName); - return this; - } + this.innerModel().withFriendlyName(friendlyName); + return this; } public HostPoolImpl withDescription(String description) { - if (isInCreateMode()) { - this.innerModel().withDescription(description); - return this; - } else { - this.updateHostPool.withDescription(description); - return this; - } + this.innerModel().withDescription(description); + return this; } public HostPoolImpl withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType personalDesktopAssignmentType) { - if (isInCreateMode()) { - this.innerModel().withPersonalDesktopAssignmentType(personalDesktopAssignmentType); - return this; - } else { - this.updateHostPool.withPersonalDesktopAssignmentType(personalDesktopAssignmentType); - return this; - } + this.innerModel().withPersonalDesktopAssignmentType(personalDesktopAssignmentType); + return this; } public HostPoolImpl withCustomRdpProperty(String customRdpProperty) { - if (isInCreateMode()) { - this.innerModel().withCustomRdpProperty(customRdpProperty); - return this; - } else { - this.updateHostPool.withCustomRdpProperty(customRdpProperty); - return this; - } + this.innerModel().withCustomRdpProperty(customRdpProperty); + return this; } public HostPoolImpl withMaxSessionLimit(Integer maxSessionLimit) { - if (isInCreateMode()) { - this.innerModel().withMaxSessionLimit(maxSessionLimit); - return this; - } else { - this.updateHostPool.withMaxSessionLimit(maxSessionLimit); - return this; - } + this.innerModel().withMaxSessionLimit(maxSessionLimit); + return this; } public HostPoolImpl withRing(Integer ring) { - if (isInCreateMode()) { - this.innerModel().withRing(ring); - return this; - } else { - this.updateHostPool.withRing(ring); - return this; - } + this.innerModel().withRing(ring); + return this; } public HostPoolImpl withValidationEnvironment(Boolean validationEnvironment) { - if (isInCreateMode()) { - this.innerModel().withValidationEnvironment(validationEnvironment); - return this; - } else { - this.updateHostPool.withValidationEnvironment(validationEnvironment); - return this; - } + this.innerModel().withValidationEnvironment(validationEnvironment); + return this; } public HostPoolImpl withRegistrationInfo(RegistrationInfoInner registrationInfo) { @@ -467,73 +446,38 @@ public HostPoolImpl withRegistrationInfo(RegistrationInfoInner registrationInfo) } public HostPoolImpl withVmTemplate(String vmTemplate) { - if (isInCreateMode()) { - this.innerModel().withVmTemplate(vmTemplate); - return this; - } else { - this.updateHostPool.withVmTemplate(vmTemplate); - return this; - } + this.innerModel().withVmTemplate(vmTemplate); + return this; } public HostPoolImpl withSsoadfsAuthority(String ssoadfsAuthority) { - if (isInCreateMode()) { - this.innerModel().withSsoadfsAuthority(ssoadfsAuthority); - return this; - } else { - this.updateHostPool.withSsoadfsAuthority(ssoadfsAuthority); - return this; - } + this.innerModel().withSsoadfsAuthority(ssoadfsAuthority); + return this; } public HostPoolImpl withSsoClientId(String ssoClientId) { - if (isInCreateMode()) { - this.innerModel().withSsoClientId(ssoClientId); - return this; - } else { - this.updateHostPool.withSsoClientId(ssoClientId); - return this; - } + this.innerModel().withSsoClientId(ssoClientId); + return this; } public HostPoolImpl withSsoClientSecretKeyVaultPath(String ssoClientSecretKeyVaultPath) { - if (isInCreateMode()) { - this.innerModel().withSsoClientSecretKeyVaultPath(ssoClientSecretKeyVaultPath); - return this; - } else { - this.updateHostPool.withSsoClientSecretKeyVaultPath(ssoClientSecretKeyVaultPath); - return this; - } + this.innerModel().withSsoClientSecretKeyVaultPath(ssoClientSecretKeyVaultPath); + return this; } public HostPoolImpl withSsoSecretType(SsoSecretType ssoSecretType) { - if (isInCreateMode()) { - this.innerModel().withSsoSecretType(ssoSecretType); - return this; - } else { - this.updateHostPool.withSsoSecretType(ssoSecretType); - return this; - } + this.innerModel().withSsoSecretType(ssoSecretType); + return this; } public HostPoolImpl withStartVMOnConnect(Boolean startVMOnConnect) { - if (isInCreateMode()) { - this.innerModel().withStartVMOnConnect(startVMOnConnect); - return this; - } else { - this.updateHostPool.withStartVMOnConnect(startVMOnConnect); - return this; - } + this.innerModel().withStartVMOnConnect(startVMOnConnect); + return this; } public HostPoolImpl withPublicNetworkAccess(HostpoolPublicNetworkAccess publicNetworkAccess) { - if (isInCreateMode()) { - this.innerModel().withPublicNetworkAccess(publicNetworkAccess); - return this; - } else { - this.updateHostPool.withPublicNetworkAccess(publicNetworkAccess); - return this; - } + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; } public HostPoolImpl withAgentUpdate(AgentUpdateProperties agentUpdate) { @@ -541,13 +485,33 @@ public HostPoolImpl withAgentUpdate(AgentUpdateProperties agentUpdate) { return this; } - public HostPoolImpl withRegistrationInfo(RegistrationInfoPatch registrationInfo) { - this.updateHostPool.withRegistrationInfo(registrationInfo); + public HostPoolImpl withManagedPrivateUdp(ManagedPrivateUdp managedPrivateUdp) { + this.innerModel().withManagedPrivateUdp(managedPrivateUdp); + return this; + } + + public HostPoolImpl withDirectUdp(DirectUdp directUdp) { + this.innerModel().withDirectUdp(directUdp); + return this; + } + + public HostPoolImpl withPublicUdp(PublicUdp publicUdp) { + this.innerModel().withPublicUdp(publicUdp); + return this; + } + + public HostPoolImpl withRelayUdp(RelayUdp relayUdp) { + this.innerModel().withRelayUdp(relayUdp); + return this; + } + + public HostPoolImpl withManagementType(ManagementType managementType) { + this.innerModel().withManagementType(managementType); return this; } - public HostPoolImpl withAgentUpdate(AgentUpdatePatchProperties agentUpdate) { - this.updateHostPool.withAgentUpdate(agentUpdate); + public HostPoolImpl withProperties(HostPoolPatchProperties properties) { + this.updateHostPool.withProperties(properties); 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..25cf339de253 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; @@ -146,6 +151,26 @@ 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 ManagementType managementType() { + return this.innerModel().managementType(); + } + public HostPoolPropertiesInner innerModel() { return this.innerObject; } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolsClientImpl.java index 61144cdaf015..f3cd0f5bef05 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolsClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolsClientImpl.java @@ -70,6 +70,25 @@ public final class HostPoolsClientImpl implements HostPoolsClient { @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface HostPoolsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/hostPools") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, + @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("pageSize") Integer pageSize, + @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") @ExpectedResponses({ 200 }) @@ -89,15 +108,6 @@ Mono> createOrUpdate(@HostParam("$host") String endpoint @BodyParam("application/json") HostPoolInner hostPool, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, - @QueryParam("force") Boolean force, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") @ExpectedResponses({ 200 }) @@ -109,23 +119,22 @@ Mono> update(@HostParam("$host") String endpoint, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools") - @ExpectedResponses({ 200 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, Context context); + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @QueryParam("force") Boolean force, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/hostPools") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/listRegistrationTokens") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> listRegistrationTokens(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/retrieveRegistrationToken") @@ -137,13 +146,11 @@ Mono> retrieveRegistrationToken(@HostParam("$hos @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/listRegistrationTokens") + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listRegistrationTokens(@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); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -152,28 +159,22 @@ Mono> listRegistrationTokens(@HostParam("$h Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Get a host pool. + * List hostPools in subscription. * - * @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 pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a host pool along with {@link Response} on successful completion of {@link Mono}. + * @return list of HostPool definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String hostPoolName) { + private Mono> listSinglePageAsync(Integer pageSize, Boolean isDescending, + Integer initialSkip) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -182,34 +183,30 @@ public Mono> getByResourceGroupWithResponseAsync(String return Mono.error(new IllegalArgumentException( "Parameter this.client.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.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), pageSize, isDescending, initialSkip, 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 a host pool. + * List hostPools in subscription. * - * @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 pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a host pool along with {@link Response} on successful completion of {@link Mono}. + * @return list of HostPool definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String hostPoolName, Context context) { + private Mono> listSinglePageAsync(Integer pageSize, Boolean isDescending, + Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -218,81 +215,115 @@ private Mono> getByResourceGroupWithResponseAsync(String return Mono.error(new IllegalArgumentException( "Parameter this.client.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.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), pageSize, + isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Get a host pool. + * List hostPools in subscription. * - * @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 pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a host pool on successful completion of {@link Mono}. + * @return list of HostPool definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String hostPoolName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, hostPoolName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip) { + return new PagedFlux<>(() -> listSinglePageAsync(pageSize, isDescending, initialSkip), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Get a host pool. + * List hostPools in subscription. * - * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HostPool definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedFlux<>(() -> listSinglePageAsync(pageSize, isDescending, initialSkip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List hostPools in subscription. + * + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a host pool along with {@link Response}. + * @return list of HostPool definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String hostPoolName, + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, hostPoolName, context).block(); + return new PagedFlux<>(() -> listSinglePageAsync(pageSize, isDescending, initialSkip, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Get a host pool. + * List hostPools in subscription. * - * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HostPool definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedIterable<>(listAsync(pageSize, isDescending, initialSkip)); + } + + /** + * List hostPools in subscription. + * + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a host pool. + * @return list of HostPool definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HostPoolInner getByResourceGroup(String resourceGroupName, String hostPoolName) { - return getByResourceGroupWithResponse(resourceGroupName, hostPoolName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, + Context context) { + return new PagedIterable<>(listAsync(pageSize, isDescending, initialSkip, context)); } /** - * Create or update a host pool. + * List hostPools. * * @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 hostPool Object containing HostPool definitions. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 HostPool definition along with {@link Response} on successful completion of {@link Mono}. + * @return list of HostPool definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String hostPoolName, - HostPoolInner hostPool) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -305,36 +336,32 @@ public Mono> createOrUpdateWithResponseAsync(String reso 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 (hostPool == null) { - return Mono.error(new IllegalArgumentException("Parameter hostPool is required and cannot be null.")); - } else { - hostPool.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, hostPool, accept, context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, initialSkip, 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())); } /** - * Create or update a host pool. + * List hostPools. * * @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 hostPool Object containing HostPool definitions. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 HostPool definition along with {@link Response} on successful completion of {@link Mono}. + * @return list of HostPool definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String hostPoolName, - HostPoolInner hostPool, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -347,85 +374,124 @@ private Mono> createOrUpdateWithResponseAsync(String res 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 (hostPool == null) { - return Mono.error(new IllegalArgumentException("Parameter hostPool is required and cannot be null.")); - } else { - hostPool.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, hostPool, accept, context); + return service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Create or update a host pool. + * List hostPools. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HostPool definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List hostPools. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HostPool definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List hostPools. * * @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 hostPool Object containing HostPool definitions. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 HostPool definition on successful completion of {@link Mono}. + * @return list of HostPool definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String resourceGroupName, String hostPoolName, - HostPoolInner hostPool) { - return createOrUpdateWithResponseAsync(resourceGroupName, hostPoolName, hostPool) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Create or update a host pool. + * List hostPools. * * @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 hostPool Object containing HostPool 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 HostPool definition along with {@link Response}. + * @return list of HostPool definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String hostPoolName, - HostPoolInner hostPool, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, hostPoolName, hostPool, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, pageSize, isDescending, initialSkip)); } /** - * Create or update a host pool. + * List hostPools. * * @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 hostPool Object containing HostPool definitions. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 HostPool definition. + * @return list of HostPool definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HostPoolInner createOrUpdate(String resourceGroupName, String hostPoolName, HostPoolInner hostPool) { - return createOrUpdateWithResponse(resourceGroupName, hostPoolName, hostPool, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + return new PagedIterable<>( + listByResourceGroupAsync(resourceGroupName, pageSize, isDescending, initialSkip, context)); } /** - * Remove a host pool. + * Get a host pool. * * @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 force Force flag to delete sessionHost. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return a host pool along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, Boolean force) { + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String hostPoolName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -443,26 +509,25 @@ 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, hostPoolName, force, accept, context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Remove a host pool. + * Get a host pool. * * @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 force Force flag to delete sessionHost. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return a host pool along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, Boolean force, - Context context) { + private Mono> getByResourceGroupWithResponseAsync(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.")); @@ -480,61 +545,60 @@ 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, hostPoolName, force, accept, context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context); } /** - * Remove a host pool. + * Get a host pool. * * @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. + * @return a host pool on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String hostPoolName) { - final Boolean force = null; - return deleteWithResponseAsync(resourceGroupName, hostPoolName, force).flatMap(ignored -> Mono.empty()); + public Mono getByResourceGroupAsync(String resourceGroupName, String hostPoolName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, hostPoolName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove a host pool. + * Get a host pool. * * @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 force Force flag to delete sessionHost. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return a host pool along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String hostPoolName, Boolean force, + public Response getByResourceGroupWithResponse(String resourceGroupName, String hostPoolName, Context context) { - return deleteWithResponseAsync(resourceGroupName, hostPoolName, force, context).block(); + return getByResourceGroupWithResponseAsync(resourceGroupName, hostPoolName, context).block(); } /** - * Remove a host pool. + * Get a host pool. * * @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 host pool. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String hostPoolName) { - final Boolean force = null; - deleteWithResponse(resourceGroupName, hostPoolName, force, Context.NONE); + public HostPoolInner getByResourceGroup(String resourceGroupName, String hostPoolName) { + return getByResourceGroupWithResponse(resourceGroupName, hostPoolName, Context.NONE).getValue(); } /** - * Update a host pool. + * Create or update a host pool. * * @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. @@ -545,8 +609,8 @@ public void delete(String resourceGroupName, String hostPoolName) { * @return represents a HostPool definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, - HostPoolPatch hostPool) { + public Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String hostPoolName, + HostPoolInner hostPool) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -562,18 +626,20 @@ public Mono> updateWithResponseAsync(String resourceGrou if (hostPoolName == null) { return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); } - if (hostPool != null) { + if (hostPool == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPool is required and cannot be null.")); + } else { hostPool.validate(); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, hostPoolName, hostPool, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update a host pool. + * Create or update a host pool. * * @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. @@ -585,8 +651,8 @@ public Mono> updateWithResponseAsync(String resourceGrou * @return represents a HostPool definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, - HostPoolPatch hostPool, Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String hostPoolName, + HostPoolInner hostPool, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -602,34 +668,37 @@ private Mono> updateWithResponseAsync(String resourceGro if (hostPoolName == null) { return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); } - if (hostPool != null) { + if (hostPool == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPool is required and cannot be null.")); + } else { hostPool.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, hostPool, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, hostPool, accept, context); } /** - * Update a host pool. + * Create or update a host pool. * * @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 hostPool Object containing HostPool 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 HostPool definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String hostPoolName) { - final HostPoolPatch hostPool = null; - return updateWithResponseAsync(resourceGroupName, hostPoolName, hostPool) + public Mono createOrUpdateAsync(String resourceGroupName, String hostPoolName, + HostPoolInner hostPool) { + return createOrUpdateWithResponseAsync(resourceGroupName, hostPoolName, hostPool) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Update a host pool. + * Create or update a host pool. * * @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. @@ -641,42 +710,41 @@ public Mono updateAsync(String resourceGroupName, String hostPool * @return represents a HostPool definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String hostPoolName, - HostPoolPatch hostPool, Context context) { - return updateWithResponseAsync(resourceGroupName, hostPoolName, hostPool, context).block(); + public Response createOrUpdateWithResponse(String resourceGroupName, String hostPoolName, + HostPoolInner hostPool, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, hostPoolName, hostPool, context).block(); } /** - * Update a host pool. + * Create or update a host pool. * * @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 hostPool Object containing HostPool 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 HostPool definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public HostPoolInner update(String resourceGroupName, String hostPoolName) { - final HostPoolPatch hostPool = null; - return updateWithResponse(resourceGroupName, hostPoolName, hostPool, Context.NONE).getValue(); + public HostPoolInner createOrUpdate(String resourceGroupName, String hostPoolName, HostPoolInner hostPool) { + return createOrUpdateWithResponse(resourceGroupName, hostPoolName, hostPool, Context.NONE).getValue(); } /** - * List hostPools. + * Update a host pool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPool The properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostPoolList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return represents a HostPool definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Integer pageSize, Boolean isDescending, Integer initialSkip) { + public Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + HostPoolPatch hostPool) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -689,32 +757,34 @@ private Mono> listByResourceGroupSinglePageAsync(St 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 (hostPool != null) { + hostPool.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, initialSkip, accept, - context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, hostPool, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List hostPools. + * Update a host pool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPool The properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostPoolList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return represents a HostPool definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + HostPoolPatch hostPool, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -727,125 +797,82 @@ private Mono> listByResourceGroupSinglePageAsync(St 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 (hostPool != null) { + hostPool.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, initialSkip, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List hostPools. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostPoolList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List hostPools. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostPoolList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, hostPool, accept, context); } /** - * List hostPools. + * Update a host pool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @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 hostPoolList as paginated response with {@link PagedFlux}. + * @return represents a HostPool definition on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String hostPoolName) { + final HostPoolPatch hostPool = null; + return updateWithResponseAsync(resourceGroupName, hostPoolName, hostPool) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List hostPools. + * Update a host pool. * * @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 hostPool The properties to be updated. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostPoolList as paginated response with {@link PagedIterable}. + * @return represents a HostPool definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, pageSize, isDescending, initialSkip)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String hostPoolName, + HostPoolPatch hostPool, Context context) { + return updateWithResponseAsync(resourceGroupName, hostPoolName, hostPool, context).block(); } /** - * List hostPools. + * Update a host pool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @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 hostPoolList as paginated response with {@link PagedIterable}. + * @return represents a HostPool definition. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context) { - return new PagedIterable<>( - listByResourceGroupAsync(resourceGroupName, pageSize, isDescending, initialSkip, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public HostPoolInner update(String resourceGroupName, String hostPoolName) { + final HostPoolPatch hostPool = null; + return updateWithResponse(resourceGroupName, hostPoolName, hostPool, Context.NONE).getValue(); } /** - * List hostPools in subscription. + * Remove a host pool. * - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @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 force Force flag to delete sessionHost. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostPoolList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Integer pageSize, Boolean isDescending, - Integer initialSkip) { + public Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, Boolean force) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -854,30 +881,35 @@ private Mono> listSinglePageAsync(Integer pageSize, return Mono.error(new IllegalArgumentException( "Parameter this.client.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.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), pageSize, isDescending, initialSkip, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, force, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List hostPools in subscription. + * Remove a host pool. * - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @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 force Force flag to delete sessionHost. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostPoolList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Integer pageSize, Boolean isDescending, - Integer initialSkip, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, Boolean force, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -886,113 +918,81 @@ private Mono> listSinglePageAsync(Integer pageSize, return Mono.error(new IllegalArgumentException( "Parameter this.client.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 - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), pageSize, - isDescending, initialSkip, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, force, accept, context); } /** - * List hostPools in subscription. + * Remove a host pool. * - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @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 hostPoolList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip) { - return new PagedFlux<>(() -> listSinglePageAsync(pageSize, isDescending, initialSkip), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List hostPools in subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostPoolList as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedFlux<>(() -> listSinglePageAsync(pageSize, isDescending, initialSkip), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String hostPoolName) { + final Boolean force = null; + return deleteWithResponseAsync(resourceGroupName, hostPoolName, force).flatMap(ignored -> Mono.empty()); } /** - * List hostPools in subscription. + * Remove a host pool. * - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @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 force Force flag to delete sessionHost. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostPoolList as paginated response with {@link PagedFlux}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip, + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String hostPoolName, Boolean force, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(pageSize, isDescending, initialSkip, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List hostPools in subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostPoolList as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedIterable<>(listAsync(pageSize, isDescending, initialSkip)); + return deleteWithResponseAsync(resourceGroupName, hostPoolName, force, context).block(); } /** - * List hostPools in subscription. + * Remove a host pool. * - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @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 hostPoolList as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, - Context context) { - return new PagedIterable<>(listAsync(pageSize, isDescending, initialSkip, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String hostPoolName) { + final Boolean force = null; + deleteWithResponse(resourceGroupName, hostPoolName, force, Context.NONE); } /** - * Registration token of the host pool. + * Operation to list the RegistrationTokens associated with the 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 represents a RegistrationInfo definition along with {@link Response} on successful completion of + * @return list of RegistrationToken definitions along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> retrieveRegistrationTokenWithResponseAsync(String resourceGroupName, + public Mono> listRegistrationTokensWithResponseAsync(String resourceGroupName, String hostPoolName) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -1012,13 +1012,13 @@ public Mono> retrieveRegistrationTokenWithRespon final String accept = "application/json"; return FluxUtil .withContext( - context -> service.retrieveRegistrationToken(this.client.getEndpoint(), this.client.getApiVersion(), + context -> service.listRegistrationTokens(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Registration token of the host pool. + * Operation to list the RegistrationTokens associated with the 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. @@ -1026,11 +1026,11 @@ public Mono> retrieveRegistrationTokenWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 RegistrationInfo definition along with {@link Response} on successful completion of + * @return list of RegistrationToken definitions along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> retrieveRegistrationTokenWithResponseAsync(String resourceGroupName, + private Mono> listRegistrationTokensWithResponseAsync(String resourceGroupName, String hostPoolName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -1049,28 +1049,28 @@ private Mono> retrieveRegistrationTokenWithRespo } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.retrieveRegistrationToken(this.client.getEndpoint(), this.client.getApiVersion(), + return service.listRegistrationTokens(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context); } /** - * Registration token of the host pool. + * Operation to list the RegistrationTokens associated with the 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 represents a RegistrationInfo definition on successful completion of {@link Mono}. + * @return list of RegistrationToken definitions on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono retrieveRegistrationTokenAsync(String resourceGroupName, String hostPoolName) { - return retrieveRegistrationTokenWithResponseAsync(resourceGroupName, hostPoolName) + public Mono listRegistrationTokensAsync(String resourceGroupName, String hostPoolName) { + return listRegistrationTokensWithResponseAsync(resourceGroupName, hostPoolName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Registration token of the host pool. + * Operation to list the RegistrationTokens associated with the 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. @@ -1078,41 +1078,42 @@ public Mono retrieveRegistrationTokenAsync(String resourc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 RegistrationInfo definition along with {@link Response}. + * @return list of RegistrationToken definitions along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response retrieveRegistrationTokenWithResponse(String resourceGroupName, + public Response listRegistrationTokensWithResponse(String resourceGroupName, String hostPoolName, Context context) { - return retrieveRegistrationTokenWithResponseAsync(resourceGroupName, hostPoolName, context).block(); + return listRegistrationTokensWithResponseAsync(resourceGroupName, hostPoolName, context).block(); } /** - * Registration token of the host pool. + * Operation to list the RegistrationTokens associated with the 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 represents a RegistrationInfo definition. + * @return list of RegistrationToken definitions. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RegistrationInfoInner retrieveRegistrationToken(String resourceGroupName, String hostPoolName) { - return retrieveRegistrationTokenWithResponse(resourceGroupName, hostPoolName, Context.NONE).getValue(); + public RegistrationTokenListInner listRegistrationTokens(String resourceGroupName, String hostPoolName) { + return listRegistrationTokensWithResponse(resourceGroupName, hostPoolName, Context.NONE).getValue(); } /** - * Operation to list the RegistrationTokens associated with the HostPool. + * Registration token of the host pool. * * @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 registrationTokenList along with {@link Response} on successful completion of {@link Mono}. + * @return represents a RegistrationInfo definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listRegistrationTokensWithResponseAsync(String resourceGroupName, + public Mono> retrieveRegistrationTokenWithResponseAsync(String resourceGroupName, String hostPoolName) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -1132,13 +1133,13 @@ public Mono> listRegistrationTokensWithResp final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listRegistrationTokens(this.client.getEndpoint(), this.client.getApiVersion(), + context -> service.retrieveRegistrationToken(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Operation to list the RegistrationTokens associated with the HostPool. + * Registration token of the host pool. * * @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. @@ -1146,10 +1147,11 @@ public Mono> listRegistrationTokensWithResp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return registrationTokenList along with {@link Response} on successful completion of {@link Mono}. + * @return represents a RegistrationInfo definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRegistrationTokensWithResponseAsync(String resourceGroupName, + private Mono> retrieveRegistrationTokenWithResponseAsync(String resourceGroupName, String hostPoolName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -1168,28 +1170,28 @@ private Mono> listRegistrationTokensWithRes } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listRegistrationTokens(this.client.getEndpoint(), this.client.getApiVersion(), + return service.retrieveRegistrationToken(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context); } /** - * Operation to list the RegistrationTokens associated with the HostPool. + * Registration token of the host pool. * * @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 registrationTokenList on successful completion of {@link Mono}. + * @return represents a RegistrationInfo definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listRegistrationTokensAsync(String resourceGroupName, String hostPoolName) { - return listRegistrationTokensWithResponseAsync(resourceGroupName, hostPoolName) + public Mono retrieveRegistrationTokenAsync(String resourceGroupName, String hostPoolName) { + return retrieveRegistrationTokenWithResponseAsync(resourceGroupName, hostPoolName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Operation to list the RegistrationTokens associated with the HostPool. + * Registration token of the host pool. * * @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. @@ -1197,27 +1199,27 @@ public Mono listRegistrationTokensAsync(String resou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return registrationTokenList along with {@link Response}. + * @return represents a RegistrationInfo definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listRegistrationTokensWithResponse(String resourceGroupName, + public Response retrieveRegistrationTokenWithResponse(String resourceGroupName, String hostPoolName, Context context) { - return listRegistrationTokensWithResponseAsync(resourceGroupName, hostPoolName, context).block(); + return retrieveRegistrationTokenWithResponseAsync(resourceGroupName, hostPoolName, context).block(); } /** - * Operation to list the RegistrationTokens associated with the HostPool. + * Registration token of the host pool. * * @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 registrationTokenList. + * @return represents a RegistrationInfo definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RegistrationTokenListInner listRegistrationTokens(String resourceGroupName, String hostPoolName) { - return listRegistrationTokensWithResponse(resourceGroupName, hostPoolName, Context.NONE).getValue(); + public RegistrationInfoInner retrieveRegistrationToken(String resourceGroupName, String hostPoolName) { + return retrieveRegistrationTokenWithResponse(resourceGroupName, hostPoolName, Context.NONE).getValue(); } /** @@ -1227,10 +1229,10 @@ public RegistrationTokenListInner listRegistrationTokens(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostPoolList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of HostPool definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1239,9 +1241,7 @@ private Mono> listByResourceGroupNextSinglePageAsyn new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1255,11 +1255,10 @@ private Mono> listByResourceGroupNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostPoolList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of HostPool definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { + private Mono> listNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1269,7 +1268,7 @@ private Mono> listByResourceGroupNextSinglePageAsyn } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1281,10 +1280,10 @@ private Mono> listByResourceGroupNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostPoolList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of HostPool definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1293,7 +1292,9 @@ private Mono> listNextSinglePageAsync(String nextLi new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1307,10 +1308,11 @@ private Mono> listNextSinglePageAsync(String nextLi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostPoolList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of HostPool definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1320,7 +1322,7 @@ private Mono> listNextSinglePageAsync(String nextLi } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolsImpl.java index f4dbfba46252..944ea22c9963 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolsImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolsImpl.java @@ -31,6 +31,28 @@ public HostPoolsImpl(HostPoolsClient innerClient, this.serviceManager = serviceManager; } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HostPoolImpl(inner1, this.manager())); + } + + public PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient().list(pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HostPoolImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HostPoolImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, + Integer initialSkip, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HostPoolImpl(inner1, this.manager())); + } + public Response getByResourceGroupWithResponse(String resourceGroupName, String hostPoolName, Context context) { Response inner @@ -61,65 +83,43 @@ public void delete(String resourceGroupName, String hostPoolName) { this.serviceClient().delete(resourceGroupName, hostPoolName); } - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new HostPoolImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, - Integer initialSkip, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, pageSize, isDescending, initialSkip, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new HostPoolImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new HostPoolImpl(inner1, this.manager())); - } - - public PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - PagedIterable inner = this.serviceClient().list(pageSize, isDescending, initialSkip, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new HostPoolImpl(inner1, this.manager())); - } - - public Response retrieveRegistrationTokenWithResponse(String resourceGroupName, + public Response listRegistrationTokensWithResponse(String resourceGroupName, String hostPoolName, Context context) { - Response inner - = this.serviceClient().retrieveRegistrationTokenWithResponse(resourceGroupName, hostPoolName, context); + Response inner + = this.serviceClient().listRegistrationTokensWithResponse(resourceGroupName, hostPoolName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RegistrationInfoImpl(inner.getValue(), this.manager())); + new RegistrationTokenListImpl(inner.getValue(), this.manager())); } else { return null; } } - public RegistrationInfo retrieveRegistrationToken(String resourceGroupName, String hostPoolName) { - RegistrationInfoInner inner = this.serviceClient().retrieveRegistrationToken(resourceGroupName, hostPoolName); + public RegistrationTokenList listRegistrationTokens(String resourceGroupName, String hostPoolName) { + RegistrationTokenListInner inner = this.serviceClient().listRegistrationTokens(resourceGroupName, hostPoolName); if (inner != null) { - return new RegistrationInfoImpl(inner, this.manager()); + return new RegistrationTokenListImpl(inner, this.manager()); } else { return null; } } - public Response listRegistrationTokensWithResponse(String resourceGroupName, + public Response retrieveRegistrationTokenWithResponse(String resourceGroupName, String hostPoolName, Context context) { - Response inner - = this.serviceClient().listRegistrationTokensWithResponse(resourceGroupName, hostPoolName, context); + Response inner + = this.serviceClient().retrieveRegistrationTokenWithResponse(resourceGroupName, hostPoolName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RegistrationTokenListImpl(inner.getValue(), this.manager())); + new RegistrationInfoImpl(inner.getValue(), this.manager())); } else { return null; } } - public RegistrationTokenList listRegistrationTokens(String resourceGroupName, String hostPoolName) { - RegistrationTokenListInner inner = this.serviceClient().listRegistrationTokens(resourceGroupName, hostPoolName); + public RegistrationInfo retrieveRegistrationToken(String resourceGroupName, String hostPoolName) { + RegistrationInfoInner inner = this.serviceClient().retrieveRegistrationToken(resourceGroupName, hostPoolName); if (inner != null) { - return new RegistrationTokenListImpl(inner, this.manager()); + return new RegistrationInfoImpl(inner, this.manager()); } else { return null; } 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..bc2dabed77ee --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/InitiateSessionHostUpdatesClientImpl.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.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 The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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/MsixImagesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixImagesClientImpl.java index 312a8394206d..d3cd61a9e0d0 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixImagesClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixImagesClientImpl.java @@ -85,14 +85,16 @@ Mono> expandNext(@PathParam(value = "nextLink", en /** * Expands and Lists MSIX packages in an Image, given the Image Path. + * This action uses incorrect Msix casing intentionally to match the previous APIs. * * @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 msixImageUri Object containing URI to MSIX Image. + * @param msixImageUri The msixImageUri parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expandMsixImageList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of MSIX package properties retrieved from MSIX Image expansion along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> expandSinglePageAsync(String resourceGroupName, @@ -128,15 +130,17 @@ private Mono> expandSinglePageAsync(String r /** * Expands and Lists MSIX packages in an Image, given the Image Path. + * This action uses incorrect Msix casing intentionally to match the previous APIs. * * @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 msixImageUri Object containing URI to MSIX Image. + * @param msixImageUri The msixImageUri parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expandMsixImageList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of MSIX package properties retrieved from MSIX Image expansion along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> expandSinglePageAsync(String resourceGroupName, @@ -172,14 +176,16 @@ private Mono> expandSinglePageAsync(String r /** * Expands and Lists MSIX packages in an Image, given the Image Path. + * This action uses incorrect Msix casing intentionally to match the previous APIs. * * @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 msixImageUri Object containing URI to MSIX Image. + * @param msixImageUri The msixImageUri parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expandMsixImageList as paginated response with {@link PagedFlux}. + * @return list of MSIX package properties retrieved from MSIX Image expansion as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux expandAsync(String resourceGroupName, String hostPoolName, @@ -190,15 +196,17 @@ public PagedFlux expandAsync(String resourceGroupName, Str /** * Expands and Lists MSIX packages in an Image, given the Image Path. + * This action uses incorrect Msix casing intentionally to match the previous APIs. * * @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 msixImageUri Object containing URI to MSIX Image. + * @param msixImageUri The msixImageUri parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expandMsixImageList as paginated response with {@link PagedFlux}. + * @return list of MSIX package properties retrieved from MSIX Image expansion as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux expandAsync(String resourceGroupName, String hostPoolName, @@ -209,14 +217,16 @@ private PagedFlux expandAsync(String resourceGroupName, St /** * Expands and Lists MSIX packages in an Image, given the Image Path. + * This action uses incorrect Msix casing intentionally to match the previous APIs. * * @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 msixImageUri Object containing URI to MSIX Image. + * @param msixImageUri The msixImageUri parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expandMsixImageList as paginated response with {@link PagedIterable}. + * @return list of MSIX package properties retrieved from MSIX Image expansion as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable expand(String resourceGroupName, String hostPoolName, @@ -226,15 +236,17 @@ public PagedIterable expand(String resourceGroupName, Stri /** * Expands and Lists MSIX packages in an Image, given the Image Path. + * This action uses incorrect Msix casing intentionally to match the previous APIs. * * @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 msixImageUri Object containing URI to MSIX Image. + * @param msixImageUri The msixImageUri parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expandMsixImageList as paginated response with {@link PagedIterable}. + * @return list of MSIX package properties retrieved from MSIX Image expansion as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable expand(String resourceGroupName, String hostPoolName, @@ -249,7 +261,8 @@ public PagedIterable expand(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expandMsixImageList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of MSIX package properties retrieved from MSIX Image expansion along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> expandNextSinglePageAsync(String nextLink) { @@ -275,7 +288,8 @@ private Mono> expandNextSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expandMsixImageList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of MSIX package properties retrieved from MSIX Image expansion along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> expandNextSinglePageAsync(String nextLink, Context context) { 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/MsixPackageImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackageImpl.java index 12b4482726bd..31f666aec466 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackageImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackageImpl.java @@ -11,6 +11,7 @@ import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackagePatch; +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackagePatchProperties; import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; @@ -166,7 +167,7 @@ public MsixPackage apply(Context context) { com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourcegroups"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.hostPoolName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "hostPools"); this.msixPackageFullName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "msixPackages"); } @@ -203,13 +204,8 @@ public MsixPackageImpl withPackageFamilyName(String packageFamilyName) { } public MsixPackageImpl withDisplayName(String displayName) { - if (isInCreateMode()) { - this.innerModel().withDisplayName(displayName); - return this; - } else { - this.updateMsixPackage.withDisplayName(displayName); - return this; - } + this.innerModel().withDisplayName(displayName); + return this; } public MsixPackageImpl withPackageRelativePath(String packageRelativePath) { @@ -218,23 +214,13 @@ public MsixPackageImpl withPackageRelativePath(String packageRelativePath) { } public MsixPackageImpl withIsRegularRegistration(Boolean isRegularRegistration) { - if (isInCreateMode()) { - this.innerModel().withIsRegularRegistration(isRegularRegistration); - return this; - } else { - this.updateMsixPackage.withIsRegularRegistration(isRegularRegistration); - return this; - } + this.innerModel().withIsRegularRegistration(isRegularRegistration); + return this; } public MsixPackageImpl withIsActive(Boolean isActive) { - if (isInCreateMode()) { - this.innerModel().withIsActive(isActive); - return this; - } else { - this.updateMsixPackage.withIsActive(isActive); - return this; - } + this.innerModel().withIsActive(isActive); + return this; } public MsixPackageImpl withPackageDependencies(List packageDependencies) { @@ -257,7 +243,8 @@ public MsixPackageImpl withPackageApplications(List pac return this; } - private boolean isInCreateMode() { - return this.innerModel().id() == null; + public MsixPackageImpl withProperties(MsixPackagePatchProperties properties) { + this.updateMsixPackage.withProperties(properties); + return this; } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackagesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackagesClientImpl.java index 6cd7c1455566..f22ff92e5e84 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackagesClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackagesClientImpl.java @@ -68,7 +68,17 @@ public final class MsixPackagesClientImpl implements MsixPackagesClient { @ServiceInterface(name = "DesktopVirtualizatio") public interface MsixPackagesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + 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); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get(@HostParam("$host") String endpoint, @@ -78,7 +88,7 @@ Mono> get(@HostParam("$host") String endpoint, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate(@HostParam("$host") String endpoint, @@ -89,17 +99,7 @@ Mono> createOrUpdate(@HostParam("$host") String endpo Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, - @PathParam("msixPackageFullName") String msixPackageFullName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> update(@HostParam("$host") String endpoint, @@ -110,14 +110,14 @@ Mono> update(@HostParam("$host") String endpoint, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages") - @ExpectedResponses({ 200 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> delete(@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); + @PathParam("msixPackageFullName") String msixPackageFullName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -128,19 +128,22 @@ Mono> listNext(@PathParam(value = "nextLink", encoded } /** - * Get a msixpackage. + * List MSIX packages in 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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a msixpackage along with {@link Response} on successful completion of {@link Mono}. + * @return list of MSIX Package definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName, - String msixPackageFullName) { + private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -156,32 +159,34 @@ public Mono> getWithResponseAsync(String resourceGrou if (hostPoolName == null) { return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); } - if (msixPackageFullName == null) { - return Mono - .error(new IllegalArgumentException("Parameter msixPackageFullName 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, msixPackageFullName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, + 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 a msixpackage. + * List MSIX packages in 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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a msixpackage along with {@link Response} on successful completion of {@link Mono}. + * @return list of MSIX Package definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName, - String msixPackageFullName, Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -197,82 +202,131 @@ private Mono> getWithResponseAsync(String resourceGro if (hostPoolName == null) { return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); } - if (msixPackageFullName == null) { - return Mono - .error(new IllegalArgumentException("Parameter msixPackageFullName 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, msixPackageFullName, accept, context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Get a msixpackage. + * List MSIX packages in 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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a msixpackage on successful completion of {@link Mono}. + * @return list of MSIX Package definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName) { - return getWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Get a msixpackage. + * List MSIX packages in 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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of MSIX Package definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String hostPoolName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List MSIX packages in 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 pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a msixpackage along with {@link Response}. + * @return list of MSIX Package definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String hostPoolName, - String msixPackageFullName, Context context) { - return getWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, context).block(); + @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)); } /** - * Get a msixpackage. + * List MSIX packages in 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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a msixpackage. + * @return list of MSIX Package definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MsixPackageInner get(String resourceGroupName, String hostPoolName, String msixPackageFullName) { - return getWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String hostPoolName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedIterable<>(listAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip)); } /** - * Create or update a MSIX package. + * List MSIX packages in 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 pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of MSIX Package definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context)); + } + + /** + * Get a msixpackage. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. - * @param msixPackage Object containing MSIX Package 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 schema for MSIX Package properties along with {@link Response} on successful completion of {@link Mono}. + * @return a msixpackage along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String hostPoolName, String msixPackageFullName, MsixPackageInner msixPackage) { + public Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -292,35 +346,28 @@ public Mono> createOrUpdateWithResponseAsync(String r return Mono .error(new IllegalArgumentException("Parameter msixPackageFullName is required and cannot be null.")); } - if (msixPackage == null) { - return Mono.error(new IllegalArgumentException("Parameter msixPackage is required and cannot be null.")); - } else { - msixPackage.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, - accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update a MSIX package. + * Get a msixpackage. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. - * @param msixPackage Object containing MSIX Package 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 schema for MSIX Package properties along with {@link Response} on successful completion of {@link Mono}. + * @return a msixpackage along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String hostPoolName, String msixPackageFullName, MsixPackageInner msixPackage, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -340,90 +387,78 @@ private Mono> createOrUpdateWithResponseAsync(String return Mono .error(new IllegalArgumentException("Parameter msixPackageFullName is required and cannot be null.")); } - if (msixPackage == null) { - return Mono.error(new IllegalArgumentException("Parameter msixPackage is required and cannot be null.")); - } else { - msixPackage.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, msixPackageFullName, msixPackage, accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, msixPackageFullName, accept, context); } /** - * Create or update a MSIX package. + * Get a msixpackage. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. - * @param msixPackage Object containing MSIX Package 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 schema for MSIX Package properties on successful completion of {@link Mono}. + * @return a msixpackage on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String resourceGroupName, String hostPoolName, - String msixPackageFullName, MsixPackageInner msixPackage) { - return createOrUpdateWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage) + public Mono getAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName) { + return getWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Create or update a MSIX package. + * Get a msixpackage. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. - * @param msixPackage Object containing MSIX Package 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 schema for MSIX Package properties along with {@link Response}. + * @return a msixpackage along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String hostPoolName, - String msixPackageFullName, MsixPackageInner msixPackage, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, - context).block(); + public Response getWithResponse(String resourceGroupName, String hostPoolName, + String msixPackageFullName, Context context) { + return getWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, context).block(); } /** - * Create or update a MSIX package. + * Get a msixpackage. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. - * @param msixPackage Object containing MSIX Package 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 schema for MSIX Package properties. + * @return a msixpackage. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MsixPackageInner createOrUpdate(String resourceGroupName, String hostPoolName, String msixPackageFullName, - MsixPackageInner msixPackage) { - return createOrUpdateWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, - Context.NONE).getValue(); + public MsixPackageInner get(String resourceGroupName, String hostPoolName, String msixPackageFullName) { + return getWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, Context.NONE).getValue(); } /** - * Remove an MSIX Package. + * Create or update a MSIX package. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param msixPackage Object containing MSIX Package 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 Response} on successful completion of {@link Mono}. + * @return schema for MSIX Package properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, - String msixPackageFullName) { + public Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String hostPoolName, String msixPackageFullName, MsixPackageInner msixPackage) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -443,28 +478,35 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St return Mono .error(new IllegalArgumentException("Parameter msixPackageFullName is required and cannot be null.")); } + if (msixPackage == null) { + return Mono.error(new IllegalArgumentException("Parameter msixPackage is required and cannot be null.")); + } else { + msixPackage.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Remove an MSIX Package. + * Create or update a MSIX package. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param msixPackage Object containing MSIX Package 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 Response} on successful completion of {@link Mono}. + * @return schema for MSIX Package properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, - String msixPackageFullName, Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String hostPoolName, String msixPackageFullName, MsixPackageInner msixPackage, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -484,60 +526,74 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono .error(new IllegalArgumentException("Parameter msixPackageFullName is required and cannot be null.")); } + if (msixPackage == null) { + return Mono.error(new IllegalArgumentException("Parameter msixPackage is required and cannot be null.")); + } else { + msixPackage.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, hostPoolName, msixPackageFullName, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, accept, + context); } /** - * Remove an MSIX Package. + * Create or update a MSIX package. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param msixPackage Object containing MSIX Package 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 A {@link Mono} that completes when a successful response is received. + * @return schema for MSIX Package properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName) { - return deleteWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName) - .flatMap(ignored -> Mono.empty()); + public Mono createOrUpdateAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName, MsixPackageInner msixPackage) { + return createOrUpdateWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove an MSIX Package. + * Create or update a MSIX package. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param msixPackage Object containing MSIX Package 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 Response}. + * @return schema for MSIX Package properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String msixPackageFullName, - Context context) { - return deleteWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, context).block(); + public Response createOrUpdateWithResponse(String resourceGroupName, String hostPoolName, + String msixPackageFullName, MsixPackageInner msixPackage, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, + context).block(); } /** - * Remove an MSIX Package. + * Create or update a MSIX package. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param msixPackage Object containing MSIX Package 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 schema for MSIX Package properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String hostPoolName, String msixPackageFullName) { - deleteWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, Context.NONE); + public MsixPackageInner createOrUpdate(String resourceGroupName, String hostPoolName, String msixPackageFullName, + MsixPackageInner msixPackage) { + return createOrUpdateWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, + Context.NONE).getValue(); } /** @@ -546,7 +602,7 @@ public void delete(String resourceGroupName, String hostPoolName, String msixPac * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. - * @param msixPackage Object containing MSIX Package definitions. + * @param msixPackage The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -574,7 +630,9 @@ public Mono> updateWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter msixPackageFullName is required and cannot be null.")); } - if (msixPackage != null) { + if (msixPackage == null) { + return Mono.error(new IllegalArgumentException("Parameter msixPackage is required and cannot be null.")); + } else { msixPackage.validate(); } final String accept = "application/json"; @@ -591,7 +649,7 @@ public Mono> updateWithResponseAsync(String resourceG * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. - * @param msixPackage Object containing MSIX Package definitions. + * @param msixPackage The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -620,7 +678,9 @@ private Mono> updateWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter msixPackageFullName is required and cannot be null.")); } - if (msixPackage != null) { + if (msixPackage == null) { + return Mono.error(new IllegalArgumentException("Parameter msixPackage is required and cannot be null.")); + } else { msixPackage.validate(); } final String accept = "application/json"; @@ -635,15 +695,15 @@ private Mono> updateWithResponseAsync(String resource * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param msixPackage The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return schema for MSIX Package properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String hostPoolName, - String msixPackageFullName) { - final MsixPackagePatch msixPackage = null; + public Mono updateAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName, + MsixPackagePatch msixPackage) { return updateWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -654,7 +714,7 @@ public Mono updateAsync(String resourceGroupName, String hostP * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. - * @param msixPackage Object containing MSIX Package definitions. + * @param msixPackage The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -674,34 +734,33 @@ public Response updateWithResponse(String resourceGroupName, S * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param msixPackage The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return schema for MSIX Package properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MsixPackageInner update(String resourceGroupName, String hostPoolName, String msixPackageFullName) { - final MsixPackagePatch msixPackage = null; + public MsixPackageInner update(String resourceGroupName, String hostPoolName, String msixPackageFullName, + MsixPackagePatch msixPackage) { return updateWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, Context.NONE) .getValue(); } /** - * List MSIX packages in hostpool. + * Remove an MSIX Package. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return msixPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, - Integer pageSize, Boolean isDescending, Integer initialSkip) { + public Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -717,33 +776,32 @@ private Mono> listSinglePageAsync(String resourc if (hostPoolName == null) { return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); } + if (msixPackageFullName == null) { + return Mono + .error(new IllegalArgumentException("Parameter msixPackageFullName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, - accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List MSIX packages in hostpool. + * Remove an MSIX Package. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return msixPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -759,115 +817,64 @@ private Mono> listSinglePageAsync(String resourc if (hostPoolName == null) { return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); } + if (msixPackageFullName == null) { + return Mono + .error(new IllegalArgumentException("Parameter msixPackageFullName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List MSIX packages in 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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return msixPackageList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), - nextLink -> listNextSinglePageAsync(nextLink)); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, msixPackageFullName, accept, context); } /** - * List MSIX packages in hostpool. + * Remove an MSIX Package. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return msixPackageList as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String hostPoolName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName) { + return deleteWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName) + .flatMap(ignored -> Mono.empty()); } /** - * List MSIX packages in hostpool. + * Remove an MSIX Package. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return msixPackageList as paginated response with {@link PagedFlux}. - */ - @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)); - } - - /** - * List MSIX packages in 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 msixPackageList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String hostPoolName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedIterable<>(listAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String msixPackageFullName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, context).block(); } /** - * List MSIX packages in hostpool. + * Remove an MSIX Package. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return msixPackageList as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String hostPoolName, String msixPackageFullName) { + deleteWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, Context.NONE); } /** @@ -877,7 +884,8 @@ public PagedIterable list(String resourceGroupName, String hos * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return msixPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of MSIX Package definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -903,7 +911,8 @@ private Mono> listNextSinglePageAsync(String nex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return msixPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of MSIX Package definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackagesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackagesImpl.java index 53c623e98339..f2466d9119e9 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackagesImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackagesImpl.java @@ -27,6 +27,18 @@ public MsixPackagesImpl(MsixPackagesClient innerClient, this.serviceManager = serviceManager; } + public PagedIterable list(String resourceGroupName, String hostPoolName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, hostPoolName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MsixPackageImpl(inner1, this.manager())); + } + + 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); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MsixPackageImpl(inner1, this.manager())); + } + public Response getWithResponse(String resourceGroupName, String hostPoolName, String msixPackageFullName, Context context) { Response inner @@ -57,23 +69,11 @@ public void delete(String resourceGroupName, String hostPoolName, String msixPac this.serviceClient().delete(resourceGroupName, hostPoolName, msixPackageFullName); } - public PagedIterable list(String resourceGroupName, String hostPoolName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, hostPoolName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new MsixPackageImpl(inner1, this.manager())); - } - - 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); - return ResourceManagerUtils.mapPage(inner, inner1 -> new MsixPackageImpl(inner1, this.manager())); - } - public MsixPackage getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } String hostPoolName = ResourceManagerUtils.getValueFromIdByName(id, "hostPools"); if (hostPoolName == null) { @@ -89,10 +89,10 @@ public MsixPackage getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } String hostPoolName = ResourceManagerUtils.getValueFromIdByName(id, "hostPools"); if (hostPoolName == null) { @@ -108,10 +108,10 @@ public Response getByIdWithResponse(String id, Context context) { } public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } String hostPoolName = ResourceManagerUtils.getValueFromIdByName(id, "hostPools"); if (hostPoolName == null) { @@ -127,10 +127,10 @@ public void deleteById(String id) { } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } String hostPoolName = ResourceManagerUtils.getValueFromIdByName(id, "hostPools"); if (hostPoolName == null) { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/OperationsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/OperationsClientImpl.java index 9c0ae7519cd3..fbf75ad5c5e2 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/OperationsClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/OperationsClientImpl.java @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.desktopvirtualization.fluent.OperationsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ResourceProviderOperationInner; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceProviderOperationList; +import com.azure.resourcemanager.desktopvirtualization.models.ResourceProviderOperationListResult; import reactor.core.publisher.Mono; /** @@ -66,25 +66,25 @@ public interface OperationsService { @Get("/providers/Microsoft.DesktopVirtualization/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * List all of the available operations the Desktop Virtualization resource provider supports. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -102,14 +102,14 @@ private Mono> listSinglePageAsync( } /** - * List all of the available operations the Desktop Virtualization resource provider supports. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -125,11 +125,12 @@ private Mono> listSinglePageAsync( } /** - * List all of the available operations the Desktop Virtualization resource provider supports. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations as paginated response with {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync() { @@ -137,13 +138,14 @@ public PagedFlux listAsync() { } /** - * List all of the available operations the Desktop Virtualization resource provider supports. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations as paginated response with {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -152,11 +154,12 @@ private PagedFlux listAsync(Context context) { } /** - * List all of the available operations the Desktop Virtualization resource provider supports. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -164,13 +167,14 @@ public PagedIterable list() { } /** - * List all of the available operations the Desktop Virtualization resource provider supports. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -184,8 +188,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -211,8 +215,8 @@ private Mono> listNextSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsClientImpl.java index 1c14072313de..bc9aae39cbc4 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsClientImpl.java @@ -30,7 +30,6 @@ import com.azure.core.util.FluxUtil; 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.PrivateEndpointConnectionListResultWithSystemData; import reactor.core.publisher.Mono; @@ -67,95 +66,95 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi @ServiceInterface(name = "DesktopVirtualizatio") public interface PrivateEndpointConnectionsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByWorkspace( + Mono> listByHostPool( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, Context context); + @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); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByWorkspace(@HostParam("$host") String endpoint, + Mono> getByHostPool(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200, 204 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteByWorkspace(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + Mono> updateByHostPool( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionWithSystemDataInner connection, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateByWorkspace( - @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + Mono> deleteByHostPool(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @BodyParam("application/json") PrivateEndpointConnection connection, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHostPool( + Mono> listByWorkspace( @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); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByHostPool(@HostParam("$host") String endpoint, + Mono> getByWorkspace(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200, 204 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteByHostPool(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + Mono> updateByWorkspace( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionWithSystemDataInner connection, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateByHostPool( - @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + Mono> deleteByWorkspace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @BodyParam("application/json") PrivateEndpointConnection connection, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByWorkspaceNext( + Mono> listByHostPoolNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); @@ -163,25 +162,28 @@ Mono> listByWorkspac @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHostPoolNext( + Mono> listByWorkspaceNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * List private endpoint connections. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return a PrivateEndpointConnectionWithSystemData along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByWorkspaceSinglePageAsync(String resourceGroupName, String workspaceName) { + private Mono> listByHostPoolSinglePageAsync( + String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -194,13 +196,14 @@ Mono> listByHostPool return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName 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.listByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) + .withContext(context -> service.listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, + accept, context)) .>map( res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -208,20 +211,24 @@ Mono> listByHostPool } /** - * List private endpoint connections. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return a PrivateEndpointConnectionWithSystemData along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByWorkspaceSinglePageAsync(String resourceGroupName, String workspaceName, Context context) { + private Mono> listByHostPoolSinglePageAsync( + String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -234,105 +241,137 @@ Mono> listByHostPool return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName 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 - .listByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, accept, context) + .listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * List private endpoint connections. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedFlux}. + * @return a PrivateEndpointConnectionWithSystemData as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByWorkspaceAsync(String resourceGroupName, - String workspaceName) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), - nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + public PagedFlux listByHostPoolAsync(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + return new PagedFlux<>( + () -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), + nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); } /** - * List private endpoint connections. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @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 PrivateEndpointConnectionWithSystemData as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByHostPoolAsync(String resourceGroupName, + String hostPoolName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedFlux<>( + () -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), + nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); + } + + /** + * Get a PrivateEndpointConnectionWithSystemData. + * + * @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 pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedFlux}. + * @return a PrivateEndpointConnectionWithSystemData as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, - String workspaceName, Context context) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context), - nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); + private PagedFlux listByHostPoolAsync(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, + isDescending, initialSkip, context), nextLink -> listByHostPoolNextSinglePageAsync(nextLink, context)); } /** - * List private endpoint connections. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @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 list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * @return a PrivateEndpointConnectionWithSystemData as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByWorkspace(String resourceGroupName, - String workspaceName) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + public PagedIterable listByHostPool(String resourceGroupName, + String hostPoolName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedIterable<>( + listByHostPoolAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip)); } /** - * List private endpoint connections. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * @return a PrivateEndpointConnectionWithSystemData as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByWorkspace(String resourceGroupName, - String workspaceName, Context context) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + public PagedIterable listByHostPool(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedIterable<>( + listByHostPoolAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context)); } /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + * @return a PrivateEndpointConnectionWithSystemData along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByWorkspaceWithResponseAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + public Mono> getByHostPoolWithResponseAsync( + String resourceGroupName, String hostPoolName, String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -345,8 +384,8 @@ public Mono> getByWorkspa return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { return Mono.error(new IllegalArgumentException( @@ -354,28 +393,28 @@ public Mono> getByWorkspa } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, - accept, context)) + .withContext(context -> service.getByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + * @return a PrivateEndpointConnectionWithSystemData along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByWorkspaceWithResponseAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + private Mono> getByHostPoolWithResponseAsync( + String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -388,8 +427,8 @@ private Mono> getByWorksp return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { return Mono.error(new IllegalArgumentException( @@ -397,84 +436,83 @@ private Mono> getByWorksp } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, accept, + return service.getByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, accept, context); } /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection on successful completion of {@link Mono}. + * @return a PrivateEndpointConnectionWithSystemData on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByWorkspaceAsync(String resourceGroupName, - String workspaceName, String privateEndpointConnectionName) { - return getByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) + public Mono getByHostPoolAsync(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName) { + return getByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection along with {@link Response}. + * @return a PrivateEndpointConnectionWithSystemData along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByWorkspaceWithResponse(String resourceGroupName, - String workspaceName, String privateEndpointConnectionName, Context context) { - return getByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context) + public Response getByHostPoolWithResponse(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, Context context) { + return getByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName, context) .block(); } /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return a PrivateEndpointConnectionWithSystemData. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionWithSystemDataInner getByWorkspace(String resourceGroupName, String workspaceName, + public PrivateEndpointConnectionWithSystemDataInner getByHostPool(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName) { - return getByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE) + return getByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, Context.NONE) .getValue(); } /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteByWorkspaceWithResponseAsync(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName) { + public Mono> updateByHostPoolWithResponseAsync( + String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -487,37 +525,44 @@ public Mono> deleteByWorkspaceWithResponseAsync(String resourceGr return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { return Mono.error(new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } + if (connection == null) { + return Mono.error(new IllegalArgumentException("Parameter connection is required and cannot be null.")); + } else { + connection.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deleteByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, - accept, context)) + .withContext(context -> service.updateByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, + connection, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByWorkspaceWithResponseAsync(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName, Context context) { + private Mono> updateByHostPoolWithResponseAsync( + String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -530,94 +575,99 @@ private Mono> deleteByWorkspaceWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { return Mono.error(new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } + if (connection == null) { + return Mono.error(new IllegalArgumentException("Parameter connection is required and cannot be null.")); + } else { + connection.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, accept, - context); + return service.updateByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, connection, + accept, context); } /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteByWorkspaceAsync(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName) { - return deleteByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) - .flatMap(ignored -> Mono.empty()); + public Mono updateByHostPoolAsync(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection) { + return updateByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName, + connection).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the Private Endpoint Connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteByWorkspaceWithResponse(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName, Context context) { - return deleteByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, - context).block(); + public Response updateByHostPoolWithResponse(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection, Context context) { + return updateByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName, + connection, context).block(); } /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteByWorkspace(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName) { - deleteByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE); + public PrivateEndpointConnectionWithSystemDataInner updateByHostPool(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName, PrivateEndpointConnectionWithSystemDataInner connection) { + return updateByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, connection, + Context.NONE).getValue(); } /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateByWorkspaceWithResponseAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, - PrivateEndpointConnection connection) { + public Mono> deleteByHostPoolWithResponseAsync(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -630,45 +680,36 @@ public Mono> updateByWork return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { return Mono.error(new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - if (connection == null) { - return Mono.error(new IllegalArgumentException("Parameter connection is required and cannot be null.")); - } else { - connection.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.updateByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, - connection, accept, context)) + .withContext(context -> service.deleteByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateByWorkspaceWithResponseAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, - PrivateEndpointConnection connection, Context context) { + private Mono> deleteByHostPoolWithResponseAsync(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -681,104 +722,86 @@ private Mono> updateByWor return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { return Mono.error(new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - if (connection == null) { - return Mono.error(new IllegalArgumentException("Parameter connection is required and cannot be null.")); - } else { - connection.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.updateByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, - connection, accept, context); + return service.deleteByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, accept, + context); } /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateByWorkspaceAsync(String resourceGroupName, - String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnection connection) { - return updateByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, - connection).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono deleteByHostPoolAsync(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName) { + return deleteByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName) + .flatMap(ignored -> Mono.empty()); } /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateByWorkspaceWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, - PrivateEndpointConnection connection, Context context) { - return updateByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, - connection, context).block(); + public Response deleteByHostPoolWithResponse(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName, Context context) { + return deleteByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName, + context).block(); } /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionWithSystemDataInner updateByWorkspace(String resourceGroupName, - String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnection connection) { - return updateByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, - connection, Context.NONE).getValue(); + public void deleteByHostPool(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName) { + deleteByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, Context.NONE); } /** - * List private endpoint connections associated with hostpool. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return a PrivateEndpointConnectionWithSystemData along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolSinglePageAsync( - String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + private Mono> + listByWorkspaceSinglePageAsync(String resourceGroupName, String workspaceName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -791,14 +814,13 @@ private Mono> listBy 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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, pageSize, isDescending, initialSkip, - accept, context)) + .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) .>map( res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -806,24 +828,20 @@ private Mono> listBy } /** - * List private endpoint connections associated with hostpool. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return a PrivateEndpointConnectionWithSystemData along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolSinglePageAsync( - String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, - Context context) { + private Mono> + listByWorkspaceSinglePageAsync(String resourceGroupName, String workspaceName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -836,142 +854,101 @@ private Mono> listBy 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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, pageSize, isDescending, initialSkip, accept, context) + .listByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * List private endpoint connections associated with 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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByHostPoolAsync(String resourceGroupName, - String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { - return new PagedFlux<>( - () -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), - nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); - } - - /** - * List private endpoint connections associated with hostpool. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedFlux}. + * @return a PrivateEndpointConnectionWithSystemData as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByHostPoolAsync(String resourceGroupName, - String hostPoolName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedFlux<>( - () -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), - nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); + public PagedFlux listByWorkspaceAsync(String resourceGroupName, + String workspaceName) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); } /** - * List private endpoint connections associated with hostpool. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedFlux}. + * @return a PrivateEndpointConnectionWithSystemData as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHostPoolAsync(String resourceGroupName, - String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, - isDescending, initialSkip, context), nextLink -> listByHostPoolNextSinglePageAsync(nextLink, context)); + private PagedFlux listByWorkspaceAsync(String resourceGroupName, + String workspaceName, Context context) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); } /** - * List private endpoint connections associated with hostpool. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * @return a PrivateEndpointConnectionWithSystemData as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHostPool(String resourceGroupName, - String hostPoolName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedIterable<>( - listByHostPoolAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip)); + public PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); } /** - * List private endpoint connections associated with hostpool. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * @return a PrivateEndpointConnectionWithSystemData as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHostPool(String resourceGroupName, - String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedIterable<>( - listByHostPoolAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context)); + public PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName, Context context) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); } /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + * @return a PrivateEndpointConnectionWithSystemData along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByHostPoolWithResponseAsync( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName) { + public Mono> getByWorkspaceWithResponseAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -984,8 +961,8 @@ public Mono> getByHostPoo 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { return Mono.error(new IllegalArgumentException( @@ -993,28 +970,28 @@ public Mono> getByHostPoo } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, accept, - context)) + .withContext(context -> service.getByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + * @return a PrivateEndpointConnectionWithSystemData along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByHostPoolWithResponseAsync( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, Context context) { + private Mono> getByWorkspaceWithResponseAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1027,8 +1004,8 @@ private Mono> getByHostPo 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { return Mono.error(new IllegalArgumentException( @@ -1036,84 +1013,83 @@ private Mono> getByHostPo } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, accept, + return service.getByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, accept, context); } /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection on successful completion of {@link Mono}. + * @return a PrivateEndpointConnectionWithSystemData on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByHostPoolAsync(String resourceGroupName, - String hostPoolName, String privateEndpointConnectionName) { - return getByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName) + public Mono getByWorkspaceAsync(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName) { + return getByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection along with {@link Response}. + * @return a PrivateEndpointConnectionWithSystemData along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByHostPoolWithResponse(String resourceGroupName, - String hostPoolName, String privateEndpointConnectionName, Context context) { - return getByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName, context) + public Response getByWorkspaceWithResponse(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, Context context) { + return getByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context) .block(); } /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return a PrivateEndpointConnectionWithSystemData. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionWithSystemDataInner getByHostPool(String resourceGroupName, String hostPoolName, + public PrivateEndpointConnectionWithSystemDataInner getByWorkspace(String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { - return getByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, Context.NONE) + return getByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE) .getValue(); } /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteByHostPoolWithResponseAsync(String resourceGroupName, String hostPoolName, - String privateEndpointConnectionName) { + public Mono> updateByWorkspaceWithResponseAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1126,37 +1102,44 @@ public Mono> deleteByHostPoolWithResponseAsync(String resourceGro 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { return Mono.error(new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } + if (connection == null) { + return Mono.error(new IllegalArgumentException("Parameter connection is required and cannot be null.")); + } else { + connection.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deleteByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, accept, - context)) + .withContext(context -> service.updateByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, + connection, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByHostPoolWithResponseAsync(String resourceGroupName, String hostPoolName, - String privateEndpointConnectionName, Context context) { + private Mono> updateByWorkspaceWithResponseAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1169,93 +1152,100 @@ private Mono> deleteByHostPoolWithResponseAsync(String resourceGr 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { return Mono.error(new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } + if (connection == null) { + return Mono.error(new IllegalArgumentException("Parameter connection is required and cannot be null.")); + } else { + connection.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, accept, - context); + return service.updateByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, + connection, accept, context); } /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteByHostPoolAsync(String resourceGroupName, String hostPoolName, - String privateEndpointConnectionName) { - return deleteByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName) - .flatMap(ignored -> Mono.empty()); + public Mono updateByWorkspaceAsync(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection) { + return updateByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, + connection).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the Private Endpoint Connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteByHostPoolWithResponse(String resourceGroupName, String hostPoolName, - String privateEndpointConnectionName, Context context) { - return deleteByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName, - context).block(); + public Response updateByWorkspaceWithResponse( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection, Context context) { + return updateByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, + connection, context).block(); } /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteByHostPool(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName) { - deleteByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, Context.NONE); + public PrivateEndpointConnectionWithSystemDataInner updateByWorkspace(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection) { + return updateByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, + connection, Context.NONE).getValue(); } /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateByHostPoolWithResponseAsync( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, - PrivateEndpointConnection connection) { + public Mono> deleteByWorkspaceWithResponseAsync(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1268,45 +1258,36 @@ public Mono> updateByHost 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { return Mono.error(new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - if (connection == null) { - return Mono.error(new IllegalArgumentException("Parameter connection is required and cannot be null.")); - } else { - connection.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.updateByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, - connection, accept, context)) + .withContext(context -> service.deleteByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateByHostPoolWithResponseAsync( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, - PrivateEndpointConnection connection, Context context) { + private Mono> deleteByWorkspaceWithResponseAsync(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1319,85 +1300,71 @@ private Mono> updateByHos 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { return Mono.error(new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - if (connection == null) { - return Mono.error(new IllegalArgumentException("Parameter connection is required and cannot be null.")); - } else { - connection.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.updateByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, connection, - accept, context); + return service.deleteByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, accept, + context); } /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateByHostPoolAsync(String resourceGroupName, - String hostPoolName, String privateEndpointConnectionName, PrivateEndpointConnection connection) { - return updateByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName, - connection).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono deleteByWorkspaceAsync(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName) { + return deleteByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) + .flatMap(ignored -> Mono.empty()); } /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateByHostPoolWithResponse(String resourceGroupName, - String hostPoolName, String privateEndpointConnectionName, PrivateEndpointConnection connection, - Context context) { - return updateByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName, - connection, context).block(); + public Response deleteByWorkspaceWithResponse(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, Context context) { + return deleteByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, + context).block(); } /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionWithSystemDataInner updateByHostPool(String resourceGroupName, String hostPoolName, - String privateEndpointConnectionName, PrivateEndpointConnection connection) { - return updateByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, connection, - Context.NONE).getValue(); + public void deleteByWorkspace(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName) { + deleteByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE); } /** @@ -1407,12 +1374,12 @@ public PrivateEndpointConnectionWithSystemDataInner updateByHostPool(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account along with + * @return list of private endpoint connection associated with the specified HostPool along with * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> - listByWorkspaceNextSinglePageAsync(String nextLink) { + listByHostPoolNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1422,7 +1389,7 @@ public PrivateEndpointConnectionWithSystemDataInner updateByHostPool(String reso } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context)) + .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)) @@ -1437,12 +1404,12 @@ public PrivateEndpointConnectionWithSystemDataInner updateByHostPool(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account along with + * @return list of private endpoint connection associated with the specified HostPool along with * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> - listByWorkspaceNextSinglePageAsync(String nextLink, Context context) { + listByHostPoolNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1452,7 +1419,7 @@ public PrivateEndpointConnectionWithSystemDataInner updateByHostPool(String reso } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, 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)); } @@ -1464,12 +1431,12 @@ public PrivateEndpointConnectionWithSystemDataInner updateByHostPool(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account along with + * @return list of private endpoint connection associated with the specified HostPool along with * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> - listByHostPoolNextSinglePageAsync(String nextLink) { + listByWorkspaceNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1479,7 +1446,7 @@ public PrivateEndpointConnectionWithSystemDataInner updateByHostPool(String reso } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context)) + .withContext(context -> service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -1494,12 +1461,12 @@ public PrivateEndpointConnectionWithSystemDataInner updateByHostPool(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account along with + * @return list of private endpoint connection associated with the specified HostPool along with * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> - listByHostPoolNextSinglePageAsync(String nextLink, Context context) { + listByWorkspaceNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1509,7 +1476,7 @@ public PrivateEndpointConnectionWithSystemDataInner updateByHostPool(String reso } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByWorkspaceNext(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/PrivateEndpointConnectionsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsImpl.java index 1b13deb5f8e9..e5e4c57cd542 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 @@ -11,9 +11,8 @@ import com.azure.core.util.logging.ClientLogger; 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); @@ -28,26 +27,26 @@ public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClie this.serviceManager = serviceManager; } - public PagedIterable listByWorkspace(String resourceGroupName, - String workspaceName) { + public PagedIterable listByHostPool(String resourceGroupName, + String hostPoolName) { PagedIterable inner - = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName); return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionWithSystemDataImpl(inner1, this.manager())); } - public PagedIterable listByWorkspace(String resourceGroupName, - String workspaceName, Context context) { - PagedIterable inner - = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context); + public PagedIterable listByHostPool(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient() + .listByHostPool(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionWithSystemDataImpl(inner1, this.manager())); } - public Response getByWorkspaceWithResponse(String resourceGroupName, - String workspaceName, String privateEndpointConnectionName, Context context) { + public Response getByHostPoolWithResponse(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, Context context) { Response inner = this.serviceClient() - .getByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context); + .getByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new PrivateEndpointConnectionWithSystemDataImpl(inner.getValue(), this.manager())); @@ -56,10 +55,10 @@ public Response getByWorkspaceWithRespo } } - public PrivateEndpointConnectionWithSystemData getByWorkspace(String resourceGroupName, String workspaceName, + public PrivateEndpointConnectionWithSystemData getByHostPool(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName) { PrivateEndpointConnectionWithSystemDataInner inner - = this.serviceClient().getByWorkspace(resourceGroupName, workspaceName, privateEndpointConnectionName); + = this.serviceClient().getByHostPool(resourceGroupName, hostPoolName, privateEndpointConnectionName); if (inner != null) { return new PrivateEndpointConnectionWithSystemDataImpl(inner, this.manager()); } else { @@ -67,22 +66,11 @@ public PrivateEndpointConnectionWithSystemData getByWorkspace(String resourceGro } } - public Response deleteByWorkspaceWithResponse(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName, Context context) { - return this.serviceClient() - .deleteByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context); - } - - public void deleteByWorkspace(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName) { - this.serviceClient().deleteByWorkspace(resourceGroupName, workspaceName, privateEndpointConnectionName); - } - - public Response updateByWorkspaceWithResponse(String resourceGroupName, - String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnection connection, - Context context) { + public Response updateByHostPoolWithResponse(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection, Context context) { Response inner = this.serviceClient() - .updateByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, connection, + .updateByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, connection, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), @@ -92,10 +80,10 @@ public Response updateByWorkspaceWithRe } } - public PrivateEndpointConnectionWithSystemData updateByWorkspace(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName, PrivateEndpointConnection connection) { + public PrivateEndpointConnectionWithSystemData updateByHostPool(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName, PrivateEndpointConnectionWithSystemDataInner connection) { PrivateEndpointConnectionWithSystemDataInner inner = this.serviceClient() - .updateByWorkspace(resourceGroupName, workspaceName, privateEndpointConnectionName, connection); + .updateByHostPool(resourceGroupName, hostPoolName, privateEndpointConnectionName, connection); if (inner != null) { return new PrivateEndpointConnectionWithSystemDataImpl(inner, this.manager()); } else { @@ -103,26 +91,36 @@ public PrivateEndpointConnectionWithSystemData updateByWorkspace(String resource } } - public PagedIterable listByHostPool(String resourceGroupName, - String hostPoolName) { + public Response deleteByHostPoolWithResponse(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName, Context context) { + return this.serviceClient() + .deleteByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, context); + } + + public void deleteByHostPool(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName) { + this.serviceClient().deleteByHostPool(resourceGroupName, hostPoolName, privateEndpointConnectionName); + } + + public PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName) { PagedIterable inner - = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName); + = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionWithSystemDataImpl(inner1, this.manager())); } - public PagedIterable listByHostPool(String resourceGroupName, - String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - PagedIterable inner = this.serviceClient() - .listByHostPool(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context); + public PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName, Context context) { + PagedIterable inner + = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionWithSystemDataImpl(inner1, this.manager())); } - public Response getByHostPoolWithResponse(String resourceGroupName, - String hostPoolName, String privateEndpointConnectionName, Context context) { + public Response getByWorkspaceWithResponse(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, Context context) { Response inner = this.serviceClient() - .getByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, context); + .getByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new PrivateEndpointConnectionWithSystemDataImpl(inner.getValue(), this.manager())); @@ -131,10 +129,10 @@ public Response getByHostPoolWithRespon } } - public PrivateEndpointConnectionWithSystemData getByHostPool(String resourceGroupName, String hostPoolName, + public PrivateEndpointConnectionWithSystemData getByWorkspace(String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { PrivateEndpointConnectionWithSystemDataInner inner - = this.serviceClient().getByHostPool(resourceGroupName, hostPoolName, privateEndpointConnectionName); + = this.serviceClient().getByWorkspace(resourceGroupName, workspaceName, privateEndpointConnectionName); if (inner != null) { return new PrivateEndpointConnectionWithSystemDataImpl(inner, this.manager()); } else { @@ -142,21 +140,11 @@ public PrivateEndpointConnectionWithSystemData getByHostPool(String resourceGrou } } - public Response deleteByHostPoolWithResponse(String resourceGroupName, String hostPoolName, - String privateEndpointConnectionName, Context context) { - return this.serviceClient() - .deleteByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, context); - } - - public void deleteByHostPool(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName) { - this.serviceClient().deleteByHostPool(resourceGroupName, hostPoolName, privateEndpointConnectionName); - } - - public Response updateByHostPoolWithResponse(String resourceGroupName, - String hostPoolName, String privateEndpointConnectionName, PrivateEndpointConnection connection, - Context context) { + public Response updateByWorkspaceWithResponse(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection, Context context) { Response inner = this.serviceClient() - .updateByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, connection, + .updateByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, connection, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), @@ -166,10 +154,10 @@ public Response updateByHostPoolWithRes } } - public PrivateEndpointConnectionWithSystemData updateByHostPool(String resourceGroupName, String hostPoolName, - String privateEndpointConnectionName, PrivateEndpointConnection connection) { + public PrivateEndpointConnectionWithSystemData updateByWorkspace(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionWithSystemDataInner connection) { PrivateEndpointConnectionWithSystemDataInner inner = this.serviceClient() - .updateByHostPool(resourceGroupName, hostPoolName, privateEndpointConnectionName, connection); + .updateByWorkspace(resourceGroupName, workspaceName, privateEndpointConnectionName, connection); if (inner != null) { return new PrivateEndpointConnectionWithSystemDataImpl(inner, this.manager()); } else { @@ -177,6 +165,17 @@ public PrivateEndpointConnectionWithSystemData updateByHostPool(String resourceG } } + public Response deleteByWorkspaceWithResponse(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, Context context) { + return this.serviceClient() + .deleteByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context); + } + + public void deleteByWorkspace(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName) { + this.serviceClient().deleteByWorkspace(resourceGroupName, workspaceName, privateEndpointConnectionName); + } + private PrivateEndpointConnectionsClient serviceClient() { return this.innerClient; } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourceImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourceImpl.java index 24cd87756cfb..71351021f9d0 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourceImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourceImpl.java @@ -7,8 +7,7 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateLinkResourceInner; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResource; -import java.util.Collections; -import java.util.List; +import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResourceProperties; public final class PrivateLinkResourceImpl implements PrivateLinkResource { private PrivateLinkResourceInner innerObject; @@ -33,30 +32,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String groupId() { - return this.innerModel().groupId(); + public PrivateLinkResourceProperties properties() { + return this.innerModel().properties(); } - public List requiredMembers() { - List inner = this.innerModel().requiredMembers(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List requiredZoneNames() { - List inner = this.innerModel().requiredZoneNames(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } + public SystemData systemData() { + return this.innerModel().systemData(); } public PrivateLinkResourceInner innerModel() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesClientImpl.java index 84d2869bd887..ce0c17da0ff2 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesClientImpl.java @@ -63,22 +63,22 @@ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResource @ServiceInterface(name = "DesktopVirtualizatio") public interface PrivateLinkResourcesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateLinkResources") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateLinkResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByWorkspace(@HostParam("$host") String endpoint, + Mono> listByHostPool(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @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); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateLinkResources") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateLinkResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHostPool(@HostParam("$host") String endpoint, + Mono> listByWorkspace(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); @@ -86,7 +86,7 @@ Mono> listByHostPool(@HostParam("$host") @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByWorkspaceNext( + Mono> listByHostPoolNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); @@ -94,16 +94,16 @@ Mono> listByWorkspaceNext( @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHostPoolNext( + Mono> listByWorkspaceNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * List the private link resources available for this workspace. + * List the private link resources available for this hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -114,8 +114,8 @@ Mono> listByHostPoolNext( * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceSinglePageAsync(String resourceGroupName, - String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -128,13 +128,13 @@ private Mono> listByWorkspaceSinglePageA return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName 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.listByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, workspaceName, pageSize, isDescending, initialSkip, + .withContext(context -> service.listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -142,10 +142,10 @@ private Mono> listByWorkspaceSinglePageA } /** - * List the private link resources available for this workspace. + * List the private link resources available for this hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -157,8 +157,8 @@ private Mono> listByWorkspaceSinglePageA * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceSinglePageAsync(String resourceGroupName, - String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -171,23 +171,23 @@ private Mono> listByWorkspaceSinglePageA return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName 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 - .listByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, pageSize, isDescending, initialSkip, accept, context) + .listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * List the private link resources available for this workspace. + * List the private link resources available for this hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -197,38 +197,38 @@ private Mono> listByWorkspaceSinglePageA * @return a list of private link resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, + public PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { return new PagedFlux<>( - () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip), - nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + () -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), + nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); } /** - * List the private link resources available for this workspace. + * List the private link resources available for this hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @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 list of private link resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + public PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName) { final Integer pageSize = null; final Boolean isDescending = null; final Integer initialSkip = null; return new PagedFlux<>( - () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip), - nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + () -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), + nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); } /** - * List the private link resources available for this workspace. + * List the private link resources available for this hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -239,36 +239,36 @@ public PagedFlux listByWorkspaceAsync(String resourceG * @return a list of private link resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, + private PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, pageSize, - isDescending, initialSkip, context), nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, + isDescending, initialSkip, context), nextLink -> listByHostPoolNextSinglePageAsync(nextLink, context)); } /** - * List the private link resources available for this workspace. + * List the private link resources available for this hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @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 list of private link resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { final Integer pageSize = null; final Boolean isDescending = null; final Integer initialSkip = null; return new PagedIterable<>( - listByWorkspaceAsync(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip)); + listByHostPoolAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip)); } /** - * List the private link resources available for this workspace. + * List the private link resources available for this hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -279,17 +279,17 @@ public PagedIterable listByWorkspace(String resourceGr * @return a list of private link resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( - listByWorkspaceAsync(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip, context)); + listByHostPoolAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context)); } /** - * List the private link resources available for this hostpool. + * List the private link resources available for this workspace. * * @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 workspaceName The name of the workspace. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -300,8 +300,8 @@ public PagedIterable listByWorkspace(String resourceGr * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, - String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + private Mono> listByWorkspaceSinglePageAsync(String resourceGroupName, + String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -314,13 +314,13 @@ private Mono> listByHostPoolSinglePageAs 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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, pageSize, isDescending, initialSkip, + .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, pageSize, isDescending, initialSkip, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -328,10 +328,10 @@ private Mono> listByHostPoolSinglePageAs } /** - * List the private link resources available for this hostpool. + * List the private link resources available for this workspace. * * @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 workspaceName The name of the workspace. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -343,8 +343,8 @@ private Mono> listByHostPoolSinglePageAs * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, - String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private Mono> listByWorkspaceSinglePageAsync(String resourceGroupName, + String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -357,23 +357,23 @@ private Mono> listByHostPoolSinglePageAs 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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, pageSize, isDescending, initialSkip, accept, context) + .listByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, pageSize, isDescending, initialSkip, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * List the private link resources available for this hostpool. + * List the private link resources available for this workspace. * * @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 workspaceName The name of the workspace. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -383,38 +383,38 @@ private Mono> listByHostPoolSinglePageAs * @return a list of private link resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, + public PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip) { return new PagedFlux<>( - () -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), - nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); } /** - * List the private link resources available for this hostpool. + * List the private link resources available for this workspace. * * @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 workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of private link resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName) { + public PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { final Integer pageSize = null; final Boolean isDescending = null; final Integer initialSkip = null; return new PagedFlux<>( - () -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), - nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); } /** - * List the private link resources available for this hostpool. + * List the private link resources available for this workspace. * * @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 workspaceName The name of the workspace. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -425,36 +425,36 @@ public PagedFlux listByHostPoolAsync(String resourceGr * @return a list of private link resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, - isDescending, initialSkip, context), nextLink -> listByHostPoolNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, pageSize, + isDescending, initialSkip, context), nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); } /** - * List the private link resources available for this hostpool. + * List the private link resources available for this workspace. * * @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 workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of private link resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { final Integer pageSize = null; final Boolean isDescending = null; final Integer initialSkip = null; return new PagedIterable<>( - listByHostPoolAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip)); + listByWorkspaceAsync(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip)); } /** - * List the private link resources available for this hostpool. + * List the private link resources available for this workspace. * * @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 workspaceName The name of the workspace. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -465,10 +465,10 @@ public PagedIterable listByHostPool(String resourceGro * @return a list of private link resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( - listByHostPoolAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context)); + listByWorkspaceAsync(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip, context)); } /** @@ -482,7 +482,7 @@ public PagedIterable listByHostPool(String resourceGro * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceNextSinglePageAsync(String nextLink) { + private Mono> listByHostPoolNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -492,7 +492,7 @@ private Mono> listByWorkspaceNextSingleP } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context)) + .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())); @@ -510,7 +510,7 @@ private Mono> listByWorkspaceNextSingleP * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceNextSinglePageAsync(String nextLink, + private Mono> listByHostPoolNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -521,7 +521,7 @@ private Mono> listByWorkspaceNextSingleP } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, 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)); } @@ -537,7 +537,7 @@ private Mono> listByWorkspaceNextSingleP * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolNextSinglePageAsync(String nextLink) { + private Mono> listByWorkspaceNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -547,7 +547,7 @@ private Mono> listByHostPoolNextSinglePa } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context)) + .withContext(context -> service.listByWorkspaceNext(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())); @@ -565,7 +565,7 @@ private Mono> listByHostPoolNextSinglePa * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolNextSinglePageAsync(String nextLink, + private Mono> listByWorkspaceNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -576,7 +576,7 @@ private Mono> listByHostPoolNextSinglePa } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByWorkspaceNext(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/PrivateLinkResourcesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesImpl.java index 864da3ae147d..828f60cd9397 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesImpl.java @@ -25,29 +25,29 @@ public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { PagedIterable inner - = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName); return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } - public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { PagedIterable inner = this.serviceClient() - .listByWorkspace(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip, context); + .listByHostPool(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } - public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { PagedIterable inner - = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName); + = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } - public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { PagedIterable inner = this.serviceClient() - .listByHostPool(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context); + .listByWorkspace(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } 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..3212271b9956 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,15 @@ 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.ScalingPlanPatchProperties; 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; @@ -50,30 +51,30 @@ public Map tags() { } } - public String managedBy() { - return this.innerModel().managedBy(); - } - - public String kind() { - return this.innerModel().kind(); + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); } public String etag() { return this.innerModel().etag(); } - public ResourceModelWithAllowedPropertySetIdentity identity() { - return this.innerModel().identity(); + public String kind() { + return this.innerModel().kind(); } - public ResourceModelWithAllowedPropertySetSku sku() { - return this.innerModel().sku(); + public String managedBy() { + return this.innerModel().managedBy(); } - public ResourceModelWithAllowedPropertySetPlan plan() { + public Plan plan() { return this.innerModel().plan(); } + public Sku sku() { + return this.innerModel().sku(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -230,13 +231,8 @@ public ScalingPlanImpl withRegion(String location) { } public ScalingPlanImpl withTimeZone(String timeZone) { - if (isInCreateMode()) { - this.innerModel().withTimeZone(timeZone); - return this; - } else { - this.updateScalingPlan.withTimeZone(timeZone); - return this; - } + this.innerModel().withTimeZone(timeZone); + return this; } public ScalingPlanImpl withTags(Map tags) { @@ -249,8 +245,8 @@ public ScalingPlanImpl withTags(Map tags) { } } - public ScalingPlanImpl withManagedBy(String managedBy) { - this.innerModel().withManagedBy(managedBy); + public ScalingPlanImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); return this; } @@ -259,39 +255,29 @@ public ScalingPlanImpl withKind(String kind) { return this; } - public ScalingPlanImpl withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { - this.innerModel().withIdentity(identity); + public ScalingPlanImpl withManagedBy(String managedBy) { + this.innerModel().withManagedBy(managedBy); return this; } - public ScalingPlanImpl withSku(ResourceModelWithAllowedPropertySetSku sku) { - this.innerModel().withSku(sku); + public ScalingPlanImpl withPlan(Plan plan) { + this.innerModel().withPlan(plan); return this; } - public ScalingPlanImpl withPlan(ResourceModelWithAllowedPropertySetPlan plan) { - this.innerModel().withPlan(plan); + public ScalingPlanImpl withSku(Sku sku) { + this.innerModel().withSku(sku); return this; } public ScalingPlanImpl withDescription(String description) { - if (isInCreateMode()) { - this.innerModel().withDescription(description); - return this; - } else { - this.updateScalingPlan.withDescription(description); - return this; - } + this.innerModel().withDescription(description); + return this; } public ScalingPlanImpl withFriendlyName(String friendlyName) { - if (isInCreateMode()) { - this.innerModel().withFriendlyName(friendlyName); - return this; - } else { - this.updateScalingPlan.withFriendlyName(friendlyName); - return this; - } + this.innerModel().withFriendlyName(friendlyName); + return this; } public ScalingPlanImpl withHostPoolType(ScalingHostPoolType hostPoolType) { @@ -300,33 +286,23 @@ public ScalingPlanImpl withHostPoolType(ScalingHostPoolType hostPoolType) { } public ScalingPlanImpl withExclusionTag(String exclusionTag) { - if (isInCreateMode()) { - this.innerModel().withExclusionTag(exclusionTag); - return this; - } else { - this.updateScalingPlan.withExclusionTag(exclusionTag); - return this; - } + this.innerModel().withExclusionTag(exclusionTag); + return this; } public ScalingPlanImpl withSchedules(List schedules) { - if (isInCreateMode()) { - this.innerModel().withSchedules(schedules); - return this; - } else { - this.updateScalingPlan.withSchedules(schedules); - return this; - } + this.innerModel().withSchedules(schedules); + return this; } public ScalingPlanImpl withHostPoolReferences(List hostPoolReferences) { - if (isInCreateMode()) { - this.innerModel().withHostPoolReferences(hostPoolReferences); - return this; - } else { - this.updateScalingPlan.withHostPoolReferences(hostPoolReferences); - return this; - } + this.innerModel().withHostPoolReferences(hostPoolReferences); + return this; + } + + public ScalingPlanImpl withProperties(ScalingPlanPatchProperties properties) { + this.updateScalingPlan.withProperties(properties); + return this; } private boolean isInCreateMode() { 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..7a15b85f48b4 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 @@ -10,6 +10,7 @@ import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedule; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedulePatch; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedulePatchProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; @@ -247,272 +248,143 @@ public ScalingPlanPersonalSchedule refresh(Context context) { } public ScalingPlanPersonalScheduleImpl withDaysOfWeek(List daysOfWeek) { - if (isInCreateMode()) { - this.innerModel().withDaysOfWeek(daysOfWeek); - return this; - } else { - this.updateScalingPlanSchedule.withDaysOfWeek(daysOfWeek); - return this; - } + this.innerModel().withDaysOfWeek(daysOfWeek); + return this; } public ScalingPlanPersonalScheduleImpl withRampUpStartTime(Time rampUpStartTime) { - if (isInCreateMode()) { - this.innerModel().withRampUpStartTime(rampUpStartTime); - return this; - } else { - this.updateScalingPlanSchedule.withRampUpStartTime(rampUpStartTime); - return this; - } + this.innerModel().withRampUpStartTime(rampUpStartTime); + return this; + } + + public ScalingPlanPersonalScheduleImpl withPeakStartTime(Time peakStartTime) { + this.innerModel().withPeakStartTime(peakStartTime); + return this; + } + + public ScalingPlanPersonalScheduleImpl withRampDownStartTime(Time rampDownStartTime) { + this.innerModel().withRampDownStartTime(rampDownStartTime); + return this; + } + + public ScalingPlanPersonalScheduleImpl withOffPeakStartTime(Time offPeakStartTime) { + this.innerModel().withOffPeakStartTime(offPeakStartTime); + return this; } public ScalingPlanPersonalScheduleImpl withRampUpAutoStartHosts(StartupBehavior rampUpAutoStartHosts) { - if (isInCreateMode()) { - this.innerModel().withRampUpAutoStartHosts(rampUpAutoStartHosts); - return this; - } else { - this.updateScalingPlanSchedule.withRampUpAutoStartHosts(rampUpAutoStartHosts); - return this; - } + this.innerModel().withRampUpAutoStartHosts(rampUpAutoStartHosts); + return this; } public ScalingPlanPersonalScheduleImpl withRampUpStartVMOnConnect(SetStartVMOnConnect rampUpStartVMOnConnect) { - if (isInCreateMode()) { - this.innerModel().withRampUpStartVMOnConnect(rampUpStartVMOnConnect); - return this; - } else { - this.updateScalingPlanSchedule.withRampUpStartVMOnConnect(rampUpStartVMOnConnect); - return this; - } + this.innerModel().withRampUpStartVMOnConnect(rampUpStartVMOnConnect); + return this; } public ScalingPlanPersonalScheduleImpl withRampUpActionOnDisconnect(SessionHandlingOperation rampUpActionOnDisconnect) { - if (isInCreateMode()) { - this.innerModel().withRampUpActionOnDisconnect(rampUpActionOnDisconnect); - return this; - } else { - this.updateScalingPlanSchedule.withRampUpActionOnDisconnect(rampUpActionOnDisconnect); - return this; - } + this.innerModel().withRampUpActionOnDisconnect(rampUpActionOnDisconnect); + return this; } public ScalingPlanPersonalScheduleImpl withRampUpMinutesToWaitOnDisconnect(Integer rampUpMinutesToWaitOnDisconnect) { - if (isInCreateMode()) { - this.innerModel().withRampUpMinutesToWaitOnDisconnect(rampUpMinutesToWaitOnDisconnect); - return this; - } else { - this.updateScalingPlanSchedule.withRampUpMinutesToWaitOnDisconnect(rampUpMinutesToWaitOnDisconnect); - return this; - } + this.innerModel().withRampUpMinutesToWaitOnDisconnect(rampUpMinutesToWaitOnDisconnect); + return this; } public ScalingPlanPersonalScheduleImpl withRampUpActionOnLogoff(SessionHandlingOperation rampUpActionOnLogoff) { - if (isInCreateMode()) { - this.innerModel().withRampUpActionOnLogoff(rampUpActionOnLogoff); - return this; - } else { - this.updateScalingPlanSchedule.withRampUpActionOnLogoff(rampUpActionOnLogoff); - return this; - } + this.innerModel().withRampUpActionOnLogoff(rampUpActionOnLogoff); + return this; } public ScalingPlanPersonalScheduleImpl withRampUpMinutesToWaitOnLogoff(Integer rampUpMinutesToWaitOnLogoff) { - if (isInCreateMode()) { - this.innerModel().withRampUpMinutesToWaitOnLogoff(rampUpMinutesToWaitOnLogoff); - return this; - } else { - this.updateScalingPlanSchedule.withRampUpMinutesToWaitOnLogoff(rampUpMinutesToWaitOnLogoff); - return this; - } - } - - public ScalingPlanPersonalScheduleImpl withPeakStartTime(Time peakStartTime) { - if (isInCreateMode()) { - this.innerModel().withPeakStartTime(peakStartTime); - return this; - } else { - this.updateScalingPlanSchedule.withPeakStartTime(peakStartTime); - return this; - } + this.innerModel().withRampUpMinutesToWaitOnLogoff(rampUpMinutesToWaitOnLogoff); + return this; } public ScalingPlanPersonalScheduleImpl withPeakStartVMOnConnect(SetStartVMOnConnect peakStartVMOnConnect) { - if (isInCreateMode()) { - this.innerModel().withPeakStartVMOnConnect(peakStartVMOnConnect); - return this; - } else { - this.updateScalingPlanSchedule.withPeakStartVMOnConnect(peakStartVMOnConnect); - return this; - } + this.innerModel().withPeakStartVMOnConnect(peakStartVMOnConnect); + return this; } public ScalingPlanPersonalScheduleImpl withPeakActionOnDisconnect(SessionHandlingOperation peakActionOnDisconnect) { - if (isInCreateMode()) { - this.innerModel().withPeakActionOnDisconnect(peakActionOnDisconnect); - return this; - } else { - this.updateScalingPlanSchedule.withPeakActionOnDisconnect(peakActionOnDisconnect); - return this; - } + this.innerModel().withPeakActionOnDisconnect(peakActionOnDisconnect); + return this; } public ScalingPlanPersonalScheduleImpl withPeakMinutesToWaitOnDisconnect(Integer peakMinutesToWaitOnDisconnect) { - if (isInCreateMode()) { - this.innerModel().withPeakMinutesToWaitOnDisconnect(peakMinutesToWaitOnDisconnect); - return this; - } else { - this.updateScalingPlanSchedule.withPeakMinutesToWaitOnDisconnect(peakMinutesToWaitOnDisconnect); - return this; - } + this.innerModel().withPeakMinutesToWaitOnDisconnect(peakMinutesToWaitOnDisconnect); + return this; } public ScalingPlanPersonalScheduleImpl withPeakActionOnLogoff(SessionHandlingOperation peakActionOnLogoff) { - if (isInCreateMode()) { - this.innerModel().withPeakActionOnLogoff(peakActionOnLogoff); - return this; - } else { - this.updateScalingPlanSchedule.withPeakActionOnLogoff(peakActionOnLogoff); - return this; - } + this.innerModel().withPeakActionOnLogoff(peakActionOnLogoff); + return this; } public ScalingPlanPersonalScheduleImpl withPeakMinutesToWaitOnLogoff(Integer peakMinutesToWaitOnLogoff) { - if (isInCreateMode()) { - this.innerModel().withPeakMinutesToWaitOnLogoff(peakMinutesToWaitOnLogoff); - return this; - } else { - this.updateScalingPlanSchedule.withPeakMinutesToWaitOnLogoff(peakMinutesToWaitOnLogoff); - return this; - } - } - - public ScalingPlanPersonalScheduleImpl withRampDownStartTime(Time rampDownStartTime) { - if (isInCreateMode()) { - this.innerModel().withRampDownStartTime(rampDownStartTime); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownStartTime(rampDownStartTime); - return this; - } + this.innerModel().withPeakMinutesToWaitOnLogoff(peakMinutesToWaitOnLogoff); + return this; } public ScalingPlanPersonalScheduleImpl withRampDownStartVMOnConnect(SetStartVMOnConnect rampDownStartVMOnConnect) { - if (isInCreateMode()) { - this.innerModel().withRampDownStartVMOnConnect(rampDownStartVMOnConnect); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownStartVMOnConnect(rampDownStartVMOnConnect); - return this; - } + this.innerModel().withRampDownStartVMOnConnect(rampDownStartVMOnConnect); + return this; } public ScalingPlanPersonalScheduleImpl withRampDownActionOnDisconnect(SessionHandlingOperation rampDownActionOnDisconnect) { - if (isInCreateMode()) { - this.innerModel().withRampDownActionOnDisconnect(rampDownActionOnDisconnect); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownActionOnDisconnect(rampDownActionOnDisconnect); - return this; - } + this.innerModel().withRampDownActionOnDisconnect(rampDownActionOnDisconnect); + return this; } public ScalingPlanPersonalScheduleImpl withRampDownMinutesToWaitOnDisconnect(Integer rampDownMinutesToWaitOnDisconnect) { - if (isInCreateMode()) { - this.innerModel().withRampDownMinutesToWaitOnDisconnect(rampDownMinutesToWaitOnDisconnect); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownMinutesToWaitOnDisconnect(rampDownMinutesToWaitOnDisconnect); - return this; - } + this.innerModel().withRampDownMinutesToWaitOnDisconnect(rampDownMinutesToWaitOnDisconnect); + return this; } public ScalingPlanPersonalScheduleImpl withRampDownActionOnLogoff(SessionHandlingOperation rampDownActionOnLogoff) { - if (isInCreateMode()) { - this.innerModel().withRampDownActionOnLogoff(rampDownActionOnLogoff); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownActionOnLogoff(rampDownActionOnLogoff); - return this; - } + this.innerModel().withRampDownActionOnLogoff(rampDownActionOnLogoff); + return this; } public ScalingPlanPersonalScheduleImpl withRampDownMinutesToWaitOnLogoff(Integer rampDownMinutesToWaitOnLogoff) { - if (isInCreateMode()) { - this.innerModel().withRampDownMinutesToWaitOnLogoff(rampDownMinutesToWaitOnLogoff); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownMinutesToWaitOnLogoff(rampDownMinutesToWaitOnLogoff); - return this; - } - } - - public ScalingPlanPersonalScheduleImpl withOffPeakStartTime(Time offPeakStartTime) { - if (isInCreateMode()) { - this.innerModel().withOffPeakStartTime(offPeakStartTime); - return this; - } else { - this.updateScalingPlanSchedule.withOffPeakStartTime(offPeakStartTime); - return this; - } + this.innerModel().withRampDownMinutesToWaitOnLogoff(rampDownMinutesToWaitOnLogoff); + return this; } public ScalingPlanPersonalScheduleImpl withOffPeakStartVMOnConnect(SetStartVMOnConnect offPeakStartVMOnConnect) { - if (isInCreateMode()) { - this.innerModel().withOffPeakStartVMOnConnect(offPeakStartVMOnConnect); - return this; - } else { - this.updateScalingPlanSchedule.withOffPeakStartVMOnConnect(offPeakStartVMOnConnect); - return this; - } + this.innerModel().withOffPeakStartVMOnConnect(offPeakStartVMOnConnect); + return this; } public ScalingPlanPersonalScheduleImpl withOffPeakActionOnDisconnect(SessionHandlingOperation offPeakActionOnDisconnect) { - if (isInCreateMode()) { - this.innerModel().withOffPeakActionOnDisconnect(offPeakActionOnDisconnect); - return this; - } else { - this.updateScalingPlanSchedule.withOffPeakActionOnDisconnect(offPeakActionOnDisconnect); - return this; - } + this.innerModel().withOffPeakActionOnDisconnect(offPeakActionOnDisconnect); + return this; } public ScalingPlanPersonalScheduleImpl withOffPeakMinutesToWaitOnDisconnect(Integer offPeakMinutesToWaitOnDisconnect) { - if (isInCreateMode()) { - this.innerModel().withOffPeakMinutesToWaitOnDisconnect(offPeakMinutesToWaitOnDisconnect); - return this; - } else { - this.updateScalingPlanSchedule.withOffPeakMinutesToWaitOnDisconnect(offPeakMinutesToWaitOnDisconnect); - return this; - } + this.innerModel().withOffPeakMinutesToWaitOnDisconnect(offPeakMinutesToWaitOnDisconnect); + return this; } public ScalingPlanPersonalScheduleImpl withOffPeakActionOnLogoff(SessionHandlingOperation offPeakActionOnLogoff) { - if (isInCreateMode()) { - this.innerModel().withOffPeakActionOnLogoff(offPeakActionOnLogoff); - return this; - } else { - this.updateScalingPlanSchedule.withOffPeakActionOnLogoff(offPeakActionOnLogoff); - return this; - } + this.innerModel().withOffPeakActionOnLogoff(offPeakActionOnLogoff); + return this; } public ScalingPlanPersonalScheduleImpl withOffPeakMinutesToWaitOnLogoff(Integer offPeakMinutesToWaitOnLogoff) { - if (isInCreateMode()) { - this.innerModel().withOffPeakMinutesToWaitOnLogoff(offPeakMinutesToWaitOnLogoff); - return this; - } else { - this.updateScalingPlanSchedule.withOffPeakMinutesToWaitOnLogoff(offPeakMinutesToWaitOnLogoff); - return this; - } + this.innerModel().withOffPeakMinutesToWaitOnLogoff(offPeakMinutesToWaitOnLogoff); + return this; } - private boolean isInCreateMode() { - return this.innerModel().id() == null; + public ScalingPlanPersonalScheduleImpl withProperties(ScalingPlanPersonalSchedulePatchProperties properties) { + this.updateScalingPlanSchedule.withProperties(properties); + return this; } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesClientImpl.java index 4d7508d80dc5..6e3a4f7d1c4e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesClientImpl.java @@ -67,6 +67,17 @@ public final class ScalingPlanPersonalSchedulesClientImpl implements ScalingPlan @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface ScalingPlanPersonalSchedulesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("scalingPlanName") String scalingPlanName, @QueryParam("pageSize") Integer pageSize, + @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}") @ExpectedResponses({ 200 }) @@ -90,17 +101,6 @@ Mono> create(@HostParam("$host") Stri @BodyParam("application/json") ScalingPlanPersonalScheduleInner scalingPlanSchedule, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("scalingPlanName") String scalingPlanName, - @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, @HeaderParam("Accept") String accept, - Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}") @ExpectedResponses({ 200 }) @@ -114,15 +114,15 @@ Mono> update(@HostParam("$host") Stri @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules") - @ExpectedResponses({ 200 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("scalingPlanName") String scalingPlanName, @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, Context context); + @PathParam("scalingPlanName") String scalingPlanName, + @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -134,19 +134,22 @@ Mono> listNext( } /** - * Get a ScalingPlanPersonalSchedule. + * List ScalingPlanPersonalSchedules. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ScalingPlanPersonalSchedule along with {@link Response} on successful completion of {@link Mono}. + * @return list of ScalingPlanPersonalSchedule definitions along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String resourceGroupName, - String scalingPlanName, String scalingPlanScheduleName) { + private Mono> listSinglePageAsync(String resourceGroupName, + String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -163,33 +166,34 @@ public Mono> getWithResponseAsync(Str return Mono .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } - if (scalingPlanScheduleName == null) { - return Mono.error( - new IllegalArgumentException("Parameter scalingPlanScheduleName 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, scalingPlanName, scalingPlanScheduleName, accept, - context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, pageSize, isDescending, + initialSkip, 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 a ScalingPlanPersonalSchedule. + * List ScalingPlanPersonalSchedules. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ScalingPlanPersonalSchedule along with {@link Response} on successful completion of {@link Mono}. + * @return list of ScalingPlanPersonalSchedule definitions along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String scalingPlanName, String scalingPlanScheduleName, Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, + String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -206,85 +210,131 @@ private Mono> getWithResponseAsync(St return Mono .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } - if (scalingPlanScheduleName == null) { - return Mono.error( - new IllegalArgumentException("Parameter scalingPlanScheduleName 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, scalingPlanName, scalingPlanScheduleName, accept, context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Get a ScalingPlanPersonalSchedule. + * List ScalingPlanPersonalSchedules. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ScalingPlanPersonalSchedule on successful completion of {@link Mono}. + * @return list of ScalingPlanPersonalSchedule definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName) { - return getWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Get a ScalingPlanPersonalSchedule. + * List ScalingPlanPersonalSchedules. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ScalingPlanPersonalSchedule definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String scalingPlanName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List ScalingPlanPersonalSchedules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ScalingPlanPersonalSchedule along with {@link Response}. + * @return list of ScalingPlanPersonalSchedule definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName, Context context) { - return getWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Get a ScalingPlanPersonalSchedule. + * List ScalingPlanPersonalSchedules. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ScalingPlanPersonalSchedule. + * @return list of ScalingPlanPersonalSchedule definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScalingPlanPersonalScheduleInner get(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName) { - return getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String scalingPlanName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedIterable<>(listAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip)); } /** - * Create or update a ScalingPlanPersonalSchedule. + * List ScalingPlanPersonalSchedules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ScalingPlanPersonalSchedule definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context)); + } + + /** + * Get a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule 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 ScalingPlanPersonalSchedule definition along with {@link Response} on successful completion - * of {@link Mono}. + * @return a ScalingPlanPersonalSchedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync(String resourceGroupName, - String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule) { + public Mono> getWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -305,38 +355,29 @@ public Mono> createWithResponseAsync( return Mono.error( new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } - if (scalingPlanSchedule == null) { - return Mono - .error(new IllegalArgumentException("Parameter scalingPlanSchedule is required and cannot be null.")); - } else { - scalingPlanSchedule.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, - scalingPlanSchedule, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update a ScalingPlanPersonalSchedule. + * Get a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule 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 ScalingPlanPersonalSchedule definition along with {@link Response} on successful completion - * of {@link Mono}. + * @return a ScalingPlanPersonalSchedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceGroupName, - String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule, - Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -357,91 +398,81 @@ private Mono> createWithResponseAsync return Mono.error( new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } - if (scalingPlanSchedule == null) { - return Mono - .error(new IllegalArgumentException("Parameter scalingPlanSchedule is required and cannot be null.")); - } else { - scalingPlanSchedule.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, context); } /** - * Create or update a ScalingPlanPersonalSchedule. + * Get a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule 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 ScalingPlanPersonalSchedule definition on successful completion of {@link Mono}. + * @return a ScalingPlanPersonalSchedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule) { - return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule) + public Mono getAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { + return getWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Create or update a ScalingPlanPersonalSchedule. + * Get a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule 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 ScalingPlanPersonalSchedule definition along with {@link Response}. + * @return a ScalingPlanPersonalSchedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String resourceGroupName, - String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule, - Context context) { - return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, - context).block(); + public Response getWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context) { + return getWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context).block(); } /** - * Create or update a ScalingPlanPersonalSchedule. + * Get a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule 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 ScalingPlanPersonalSchedule definition. + * @return a ScalingPlanPersonalSchedule. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ScalingPlanPersonalScheduleInner create(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule) { - return createWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, - Context.NONE).getValue(); + public ScalingPlanPersonalScheduleInner get(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { + return getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE).getValue(); } /** - * Remove a ScalingPlanPersonalSchedule. + * Create or update a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule 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 Response} on successful completion of {@link Mono}. + * @return represents a ScalingPlanPersonalSchedule definition along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName) { + public Mono> createWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -462,29 +493,38 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St return Mono.error( new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } + if (scalingPlanSchedule == null) { + return Mono + .error(new IllegalArgumentException("Parameter scalingPlanSchedule is required and cannot be null.")); + } else { + scalingPlanSchedule.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, + scalingPlanSchedule, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Remove a ScalingPlanPersonalSchedule. + * Create or update a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule 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 Response} on successful completion of {@link Mono}. + * @return represents a ScalingPlanPersonalSchedule definition along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName, Context context) { + private Mono> createWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -505,60 +545,75 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono.error( new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } + if (scalingPlanSchedule == null) { + return Mono + .error(new IllegalArgumentException("Parameter scalingPlanSchedule is required and cannot be null.")); + } else { + scalingPlanSchedule.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, accept, context); } /** - * Remove a ScalingPlanPersonalSchedule. + * Create or update a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule 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 A {@link Mono} that completes when a successful response is received. + * @return represents a ScalingPlanPersonalSchedule definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { - return deleteWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName) - .flatMap(ignored -> Mono.empty()); + public Mono createAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule) { + return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove a ScalingPlanPersonalSchedule. + * Create or update a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule 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 Response}. + * @return represents a ScalingPlanPersonalSchedule definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName, Context context) { - return deleteWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context).block(); + public Response createWithResponse(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule, + Context context) { + return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, + context).block(); } /** - * Remove a ScalingPlanPersonalSchedule. + * Create or update a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule 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 ScalingPlanPersonalSchedule definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { - deleteWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE); + public ScalingPlanPersonalScheduleInner create(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule) { + return createWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, + Context.NONE).getValue(); } /** @@ -567,7 +622,7 @@ public void delete(String resourceGroupName, String scalingPlanName, String scal * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule definitions. + * @param scalingPlanSchedule The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -614,7 +669,7 @@ public Mono> updateWithResponseAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule definitions. + * @param scalingPlanSchedule The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -680,7 +735,7 @@ public Mono updateAsync(String resourceGroupNa * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule definitions. + * @param scalingPlanSchedule The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -715,22 +770,19 @@ public ScalingPlanPersonalScheduleInner update(String resourceGroupName, String } /** - * List ScalingPlanPersonalSchedules. + * Remove a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPersonalScheduleList along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + public Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -747,34 +799,33 @@ private Mono> listSinglePageAsyn return Mono .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } + if (scalingPlanScheduleName == null) { + return Mono.error( + new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, pageSize, isDescending, - initialSkip, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List ScalingPlanPersonalSchedules. + * Remove a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPersonalScheduleList along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -791,115 +842,64 @@ private Mono> listSinglePageAsyn return Mono .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } + if (scalingPlanScheduleName == null) { + return Mono.error( + new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List ScalingPlanPersonalSchedules. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPersonalScheduleList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String scalingPlanName, - Integer pageSize, Boolean isDescending, Integer initialSkip) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip), - nextLink -> listNextSinglePageAsync(nextLink)); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, context); } /** - * List ScalingPlanPersonalSchedules. + * Remove a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPersonalScheduleList as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String scalingPlanName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { + return deleteWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName) + .flatMap(ignored -> Mono.empty()); } /** - * List ScalingPlanPersonalSchedules. + * Remove a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPersonalScheduleList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String scalingPlanName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List ScalingPlanPersonalSchedules. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPersonalScheduleList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String scalingPlanName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedIterable<>(listAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context) { + return deleteWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context).block(); } /** - * List ScalingPlanPersonalSchedules. + * Remove a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPersonalScheduleList as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String scalingPlanName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { + deleteWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE); } /** @@ -909,8 +909,8 @@ public PagedIterable list(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPersonalScheduleList along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return list of ScalingPlanPersonalSchedule definitions along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -936,8 +936,8 @@ private Mono> listNextSinglePage * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPersonalScheduleList along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return list of ScalingPlanPersonalSchedule definitions along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesImpl.java index 533f86fb5eda..cae7044a8c0a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesImpl.java @@ -27,6 +27,21 @@ public ScalingPlanPersonalSchedulesImpl(ScalingPlanPersonalSchedulesClient inner this.serviceManager = serviceManager; } + public PagedIterable list(String resourceGroupName, String scalingPlanName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, scalingPlanName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ScalingPlanPersonalScheduleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ScalingPlanPersonalScheduleImpl(inner1, this.manager())); + } + public Response getWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context) { Response inner = this.serviceClient() @@ -60,21 +75,6 @@ public void delete(String resourceGroupName, String scalingPlanName, String scal this.serviceClient().delete(resourceGroupName, scalingPlanName, scalingPlanScheduleName); } - public PagedIterable list(String resourceGroupName, String scalingPlanName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, scalingPlanName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ScalingPlanPersonalScheduleImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String scalingPlanName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - PagedIterable inner = this.serviceClient() - .list(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ScalingPlanPersonalScheduleImpl(inner1, this.manager())); - } - public ScalingPlanPersonalSchedule getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { 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..3b750e97c957 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 @@ -10,6 +10,7 @@ import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedule; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedulePatch; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedulePatchProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; import com.azure.resourcemanager.desktopvirtualization.models.Time; @@ -38,6 +39,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) { @@ -59,7 +64,7 @@ public Integer rampUpMinimumHostsPct() { return this.innerModel().rampUpMinimumHostsPct(); } - public Integer rampUpCapacityThresholdPct() { + public int rampUpCapacityThresholdPct() { return this.innerModel().rampUpCapacityThresholdPct(); } @@ -83,7 +88,7 @@ public Integer rampDownMinimumHostsPct() { return this.innerModel().rampDownMinimumHostsPct(); } - public Integer rampDownCapacityThresholdPct() { + public int rampDownCapacityThresholdPct() { return this.innerModel().rampDownCapacityThresholdPct(); } @@ -210,180 +215,101 @@ public ScalingPlanPooledSchedule refresh(Context context) { } public ScalingPlanPooledScheduleImpl withDaysOfWeek(List daysOfWeek) { - if (isInCreateMode()) { - this.innerModel().withDaysOfWeek(daysOfWeek); - return this; - } else { - this.updateScalingPlanSchedule.withDaysOfWeek(daysOfWeek); - return this; - } + this.innerModel().withDaysOfWeek(daysOfWeek); + return this; } public ScalingPlanPooledScheduleImpl withRampUpStartTime(Time rampUpStartTime) { - if (isInCreateMode()) { - this.innerModel().withRampUpStartTime(rampUpStartTime); - return this; - } else { - this.updateScalingPlanSchedule.withRampUpStartTime(rampUpStartTime); - return this; - } + this.innerModel().withRampUpStartTime(rampUpStartTime); + return this; } - public ScalingPlanPooledScheduleImpl - withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm) { - if (isInCreateMode()) { - this.innerModel().withRampUpLoadBalancingAlgorithm(rampUpLoadBalancingAlgorithm); - return this; - } else { - this.updateScalingPlanSchedule.withRampUpLoadBalancingAlgorithm(rampUpLoadBalancingAlgorithm); - return this; - } + public ScalingPlanPooledScheduleImpl withRampUpCapacityThresholdPct(int rampUpCapacityThresholdPct) { + this.innerModel().withRampUpCapacityThresholdPct(rampUpCapacityThresholdPct); + return this; } - public ScalingPlanPooledScheduleImpl withRampUpMinimumHostsPct(Integer rampUpMinimumHostsPct) { - if (isInCreateMode()) { - this.innerModel().withRampUpMinimumHostsPct(rampUpMinimumHostsPct); - return this; - } else { - this.updateScalingPlanSchedule.withRampUpMinimumHostsPct(rampUpMinimumHostsPct); - return this; - } + public ScalingPlanPooledScheduleImpl withPeakStartTime(Time peakStartTime) { + this.innerModel().withPeakStartTime(peakStartTime); + return this; } - public ScalingPlanPooledScheduleImpl withRampUpCapacityThresholdPct(Integer rampUpCapacityThresholdPct) { - if (isInCreateMode()) { - this.innerModel().withRampUpCapacityThresholdPct(rampUpCapacityThresholdPct); - return this; - } else { - this.updateScalingPlanSchedule.withRampUpCapacityThresholdPct(rampUpCapacityThresholdPct); - return this; - } + public ScalingPlanPooledScheduleImpl withRampDownStartTime(Time rampDownStartTime) { + this.innerModel().withRampDownStartTime(rampDownStartTime); + return this; } - public ScalingPlanPooledScheduleImpl withPeakStartTime(Time peakStartTime) { - if (isInCreateMode()) { - this.innerModel().withPeakStartTime(peakStartTime); - return this; - } else { - this.updateScalingPlanSchedule.withPeakStartTime(peakStartTime); - return this; - } + public ScalingPlanPooledScheduleImpl withRampDownCapacityThresholdPct(int rampDownCapacityThresholdPct) { + this.innerModel().withRampDownCapacityThresholdPct(rampDownCapacityThresholdPct); + return this; + } + + public ScalingPlanPooledScheduleImpl withOffPeakStartTime(Time offPeakStartTime) { + this.innerModel().withOffPeakStartTime(offPeakStartTime); + return this; + } + + public ScalingPlanPooledScheduleImpl withNamePropertiesName(String namePropertiesName) { + this.innerModel().withNamePropertiesName(namePropertiesName); + return this; } public ScalingPlanPooledScheduleImpl - withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm) { - if (isInCreateMode()) { - this.innerModel().withPeakLoadBalancingAlgorithm(peakLoadBalancingAlgorithm); - return this; - } else { - this.updateScalingPlanSchedule.withPeakLoadBalancingAlgorithm(peakLoadBalancingAlgorithm); - return this; - } + withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm) { + this.innerModel().withRampUpLoadBalancingAlgorithm(rampUpLoadBalancingAlgorithm); + return this; } - public ScalingPlanPooledScheduleImpl withRampDownStartTime(Time rampDownStartTime) { - if (isInCreateMode()) { - this.innerModel().withRampDownStartTime(rampDownStartTime); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownStartTime(rampDownStartTime); - return this; - } + public ScalingPlanPooledScheduleImpl withRampUpMinimumHostsPct(Integer rampUpMinimumHostsPct) { + this.innerModel().withRampUpMinimumHostsPct(rampUpMinimumHostsPct); + return this; } public ScalingPlanPooledScheduleImpl - withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm) { - if (isInCreateMode()) { - this.innerModel().withRampDownLoadBalancingAlgorithm(rampDownLoadBalancingAlgorithm); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownLoadBalancingAlgorithm(rampDownLoadBalancingAlgorithm); - return this; - } + withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm) { + this.innerModel().withPeakLoadBalancingAlgorithm(peakLoadBalancingAlgorithm); + return this; } - public ScalingPlanPooledScheduleImpl withRampDownMinimumHostsPct(Integer rampDownMinimumHostsPct) { - if (isInCreateMode()) { - this.innerModel().withRampDownMinimumHostsPct(rampDownMinimumHostsPct); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownMinimumHostsPct(rampDownMinimumHostsPct); - return this; - } + public ScalingPlanPooledScheduleImpl + withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm) { + this.innerModel().withRampDownLoadBalancingAlgorithm(rampDownLoadBalancingAlgorithm); + return this; } - public ScalingPlanPooledScheduleImpl withRampDownCapacityThresholdPct(Integer rampDownCapacityThresholdPct) { - if (isInCreateMode()) { - this.innerModel().withRampDownCapacityThresholdPct(rampDownCapacityThresholdPct); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownCapacityThresholdPct(rampDownCapacityThresholdPct); - return this; - } + public ScalingPlanPooledScheduleImpl withRampDownMinimumHostsPct(Integer rampDownMinimumHostsPct) { + this.innerModel().withRampDownMinimumHostsPct(rampDownMinimumHostsPct); + return this; } public ScalingPlanPooledScheduleImpl withRampDownForceLogoffUsers(Boolean rampDownForceLogoffUsers) { - if (isInCreateMode()) { - this.innerModel().withRampDownForceLogoffUsers(rampDownForceLogoffUsers); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownForceLogoffUsers(rampDownForceLogoffUsers); - return this; - } + this.innerModel().withRampDownForceLogoffUsers(rampDownForceLogoffUsers); + return this; } public ScalingPlanPooledScheduleImpl withRampDownStopHostsWhen(StopHostsWhen rampDownStopHostsWhen) { - if (isInCreateMode()) { - this.innerModel().withRampDownStopHostsWhen(rampDownStopHostsWhen); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownStopHostsWhen(rampDownStopHostsWhen); - return this; - } + this.innerModel().withRampDownStopHostsWhen(rampDownStopHostsWhen); + return this; } public ScalingPlanPooledScheduleImpl withRampDownWaitTimeMinutes(Integer rampDownWaitTimeMinutes) { - if (isInCreateMode()) { - this.innerModel().withRampDownWaitTimeMinutes(rampDownWaitTimeMinutes); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownWaitTimeMinutes(rampDownWaitTimeMinutes); - return this; - } + this.innerModel().withRampDownWaitTimeMinutes(rampDownWaitTimeMinutes); + return this; } public ScalingPlanPooledScheduleImpl withRampDownNotificationMessage(String rampDownNotificationMessage) { - if (isInCreateMode()) { - this.innerModel().withRampDownNotificationMessage(rampDownNotificationMessage); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownNotificationMessage(rampDownNotificationMessage); - return this; - } - } - - public ScalingPlanPooledScheduleImpl withOffPeakStartTime(Time offPeakStartTime) { - if (isInCreateMode()) { - this.innerModel().withOffPeakStartTime(offPeakStartTime); - return this; - } else { - this.updateScalingPlanSchedule.withOffPeakStartTime(offPeakStartTime); - return this; - } + this.innerModel().withRampDownNotificationMessage(rampDownNotificationMessage); + return this; } public ScalingPlanPooledScheduleImpl withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm) { - if (isInCreateMode()) { - this.innerModel().withOffPeakLoadBalancingAlgorithm(offPeakLoadBalancingAlgorithm); - return this; - } else { - this.updateScalingPlanSchedule.withOffPeakLoadBalancingAlgorithm(offPeakLoadBalancingAlgorithm); - return this; - } + this.innerModel().withOffPeakLoadBalancingAlgorithm(offPeakLoadBalancingAlgorithm); + return this; } - private boolean isInCreateMode() { - return this.innerModel().id() == null; + public ScalingPlanPooledScheduleImpl withProperties(ScalingPlanPooledSchedulePatchProperties properties) { + this.updateScalingPlanSchedule.withProperties(properties); + return this; } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledSchedulesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledSchedulesClientImpl.java index 29d9ad8088e8..8260a3cb8ac6 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledSchedulesClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledSchedulesClientImpl.java @@ -67,6 +67,17 @@ public final class ScalingPlanPooledSchedulesClientImpl implements ScalingPlanPo @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface ScalingPlanPooledSchedulesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("scalingPlanName") String scalingPlanName, @QueryParam("pageSize") Integer pageSize, + @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}") @ExpectedResponses({ 200 }) @@ -90,17 +101,6 @@ Mono> create(@HostParam("$host") String @BodyParam("application/json") ScalingPlanPooledScheduleInner scalingPlanSchedule, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("scalingPlanName") String scalingPlanName, - @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, @HeaderParam("Accept") String accept, - Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}") @ExpectedResponses({ 200 }) @@ -114,15 +114,15 @@ Mono> update(@HostParam("$host") String @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules") - @ExpectedResponses({ 200 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("scalingPlanName") String scalingPlanName, @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, Context context); + @PathParam("scalingPlanName") String scalingPlanName, + @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -134,19 +134,22 @@ Mono> listNext( } /** - * Get a ScalingPlanPooledSchedule. + * List ScalingPlanPooledSchedules. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ScalingPlanPooledSchedule along with {@link Response} on successful completion of {@link Mono}. + * @return list of ScalingPlanPooledSchedule definitions along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String resourceGroupName, - String scalingPlanName, String scalingPlanScheduleName) { + private Mono> listSinglePageAsync(String resourceGroupName, + String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -163,33 +166,34 @@ public Mono> getWithResponseAsync(Strin return Mono .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } - if (scalingPlanScheduleName == null) { - return Mono.error( - new IllegalArgumentException("Parameter scalingPlanScheduleName 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, scalingPlanName, scalingPlanScheduleName, accept, - context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, pageSize, isDescending, + initialSkip, 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 a ScalingPlanPooledSchedule. + * List ScalingPlanPooledSchedules. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ScalingPlanPooledSchedule along with {@link Response} on successful completion of {@link Mono}. + * @return list of ScalingPlanPooledSchedule definitions along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String scalingPlanName, String scalingPlanScheduleName, Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, + String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -206,85 +210,131 @@ private Mono> getWithResponseAsync(Stri return Mono .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } - if (scalingPlanScheduleName == null) { - return Mono.error( - new IllegalArgumentException("Parameter scalingPlanScheduleName 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, scalingPlanName, scalingPlanScheduleName, accept, context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Get a ScalingPlanPooledSchedule. + * List ScalingPlanPooledSchedules. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ScalingPlanPooledSchedule on successful completion of {@link Mono}. + * @return list of ScalingPlanPooledSchedule definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName) { - return getWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Get a ScalingPlanPooledSchedule. + * List ScalingPlanPooledSchedules. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ScalingPlanPooledSchedule definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String scalingPlanName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List ScalingPlanPooledSchedules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ScalingPlanPooledSchedule along with {@link Response}. + * @return list of ScalingPlanPooledSchedule definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName, Context context) { - return getWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Get a ScalingPlanPooledSchedule. + * List ScalingPlanPooledSchedules. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ScalingPlanPooledSchedule. + * @return list of ScalingPlanPooledSchedule definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScalingPlanPooledScheduleInner get(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName) { - return getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String scalingPlanName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedIterable<>(listAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip)); } /** - * Create or update a ScalingPlanPooledSchedule. + * List ScalingPlanPooledSchedules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ScalingPlanPooledSchedule definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context)); + } + + /** + * Get a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param scalingPlanSchedule Object containing ScalingPlanPooledSchedule 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 ScalingPlanPooledSchedule definition along with {@link Response} on successful completion of - * {@link Mono}. + * @return a ScalingPlanPooledSchedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync(String resourceGroupName, - String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule) { + public Mono> getWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -305,38 +355,29 @@ public Mono> createWithResponseAsync(St return Mono.error( new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } - if (scalingPlanSchedule == null) { - return Mono - .error(new IllegalArgumentException("Parameter scalingPlanSchedule is required and cannot be null.")); - } else { - scalingPlanSchedule.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, - scalingPlanSchedule, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update a ScalingPlanPooledSchedule. + * Get a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param scalingPlanSchedule Object containing ScalingPlanPooledSchedule 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 ScalingPlanPooledSchedule definition along with {@link Response} on successful completion of - * {@link Mono}. + * @return a ScalingPlanPooledSchedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceGroupName, - String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule, - Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -357,90 +398,81 @@ private Mono> createWithResponseAsync(S return Mono.error( new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } - if (scalingPlanSchedule == null) { - return Mono - .error(new IllegalArgumentException("Parameter scalingPlanSchedule is required and cannot be null.")); - } else { - scalingPlanSchedule.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, context); } /** - * Create or update a ScalingPlanPooledSchedule. + * Get a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param scalingPlanSchedule Object containing ScalingPlanPooledSchedule 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 ScalingPlanPooledSchedule definition on successful completion of {@link Mono}. + * @return a ScalingPlanPooledSchedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule) { - return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule) + public Mono getAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { + return getWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Create or update a ScalingPlanPooledSchedule. + * Get a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param scalingPlanSchedule Object containing ScalingPlanPooledSchedule 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 ScalingPlanPooledSchedule definition along with {@link Response}. + * @return a ScalingPlanPooledSchedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule, Context context) { - return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, - context).block(); + public Response getWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context) { + return getWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context).block(); } /** - * Create or update a ScalingPlanPooledSchedule. + * Get a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param scalingPlanSchedule Object containing ScalingPlanPooledSchedule 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 ScalingPlanPooledSchedule definition. + * @return a ScalingPlanPooledSchedule. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ScalingPlanPooledScheduleInner create(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule) { - return createWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, - Context.NONE).getValue(); + public ScalingPlanPooledScheduleInner get(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { + return getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE).getValue(); } /** - * Remove a ScalingPlanPooledSchedule. + * Create or update a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param scalingPlanSchedule Object containing ScalingPlanPooledSchedule 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 Response} on successful completion of {@link Mono}. + * @return represents a ScalingPlanPooledSchedule definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName) { + public Mono> createWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -461,29 +493,38 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St return Mono.error( new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } + if (scalingPlanSchedule == null) { + return Mono + .error(new IllegalArgumentException("Parameter scalingPlanSchedule is required and cannot be null.")); + } else { + scalingPlanSchedule.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, + scalingPlanSchedule, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Remove a ScalingPlanPooledSchedule. + * Create or update a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param scalingPlanSchedule Object containing ScalingPlanPooledSchedule 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 Response} on successful completion of {@link Mono}. + * @return represents a ScalingPlanPooledSchedule definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName, Context context) { + private Mono> createWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -504,60 +545,74 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono.error( new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } + if (scalingPlanSchedule == null) { + return Mono + .error(new IllegalArgumentException("Parameter scalingPlanSchedule is required and cannot be null.")); + } else { + scalingPlanSchedule.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, accept, context); } /** - * Remove a ScalingPlanPooledSchedule. + * Create or update a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param scalingPlanSchedule Object containing ScalingPlanPooledSchedule 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 A {@link Mono} that completes when a successful response is received. + * @return represents a ScalingPlanPooledSchedule definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { - return deleteWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName) - .flatMap(ignored -> Mono.empty()); + public Mono createAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule) { + return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove a ScalingPlanPooledSchedule. + * Create or update a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param scalingPlanSchedule Object containing ScalingPlanPooledSchedule 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 Response}. + * @return represents a ScalingPlanPooledSchedule definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName, Context context) { - return deleteWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context).block(); + public Response createWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule, Context context) { + return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, + context).block(); } /** - * Remove a ScalingPlanPooledSchedule. + * Create or update a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param scalingPlanSchedule Object containing ScalingPlanPooledSchedule 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 ScalingPlanPooledSchedule definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { - deleteWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE); + public ScalingPlanPooledScheduleInner create(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule) { + return createWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, + Context.NONE).getValue(); } /** @@ -566,7 +621,7 @@ public void delete(String resourceGroupName, String scalingPlanName, String scal * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param scalingPlanSchedule Object containing ScalingPlanPooledSchedule definitions. + * @param scalingPlanSchedule The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -613,7 +668,7 @@ public Mono> updateWithResponseAsync(St * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param scalingPlanSchedule Object containing ScalingPlanPooledSchedule definitions. + * @param scalingPlanSchedule The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -679,7 +734,7 @@ public Mono updateAsync(String resourceGroupName * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param scalingPlanSchedule Object containing ScalingPlanPooledSchedule definitions. + * @param scalingPlanSchedule The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -713,21 +768,19 @@ public ScalingPlanPooledScheduleInner update(String resourceGroupName, String sc } /** - * List ScalingPlanPooledSchedules. + * Remove a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPooledScheduleList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + public Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -744,33 +797,33 @@ private Mono> listSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } + if (scalingPlanScheduleName == null) { + return Mono.error( + new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, pageSize, isDescending, - initialSkip, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List ScalingPlanPooledSchedules. + * Remove a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPooledScheduleList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -787,115 +840,64 @@ private Mono> listSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } + if (scalingPlanScheduleName == null) { + return Mono.error( + new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List ScalingPlanPooledSchedules. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPooledScheduleList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String scalingPlanName, - Integer pageSize, Boolean isDescending, Integer initialSkip) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip), - nextLink -> listNextSinglePageAsync(nextLink)); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, context); } /** - * List ScalingPlanPooledSchedules. + * Remove a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPooledScheduleList as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String scalingPlanName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { + return deleteWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName) + .flatMap(ignored -> Mono.empty()); } /** - * List ScalingPlanPooledSchedules. + * Remove a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPooledScheduleList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String scalingPlanName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List ScalingPlanPooledSchedules. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPooledScheduleList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String scalingPlanName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedIterable<>(listAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context) { + return deleteWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context).block(); } /** - * List ScalingPlanPooledSchedules. + * Remove a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPooledScheduleList as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String scalingPlanName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { + deleteWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE); } /** @@ -905,7 +907,8 @@ public PagedIterable list(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPooledScheduleList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of ScalingPlanPooledSchedule definitions along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -931,7 +934,8 @@ private Mono> listNextSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPooledScheduleList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of ScalingPlanPooledSchedule definitions along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledSchedulesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledSchedulesImpl.java index 041841991061..1325d4e52b82 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledSchedulesImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledSchedulesImpl.java @@ -27,6 +27,19 @@ public ScalingPlanPooledSchedulesImpl(ScalingPlanPooledSchedulesClient innerClie this.serviceManager = serviceManager; } + public PagedIterable list(String resourceGroupName, String scalingPlanName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, scalingPlanName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanPooledScheduleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanPooledScheduleImpl(inner1, this.manager())); + } + public Response getWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context) { Response inner = this.serviceClient() @@ -60,19 +73,6 @@ public void delete(String resourceGroupName, String scalingPlanName, String scal this.serviceClient().delete(resourceGroupName, scalingPlanName, scalingPlanScheduleName); } - public PagedIterable list(String resourceGroupName, String scalingPlanName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, scalingPlanName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanPooledScheduleImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String scalingPlanName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - PagedIterable inner = this.serviceClient() - .list(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanPooledScheduleImpl(inner1, this.manager())); - } - public ScalingPlanPooledSchedule getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlansClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlansClientImpl.java index 9868b5f8e58a..9ddec206ce72 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlansClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlansClientImpl.java @@ -67,6 +67,35 @@ public final class ScalingPlansClientImpl implements ScalingPlansClient { @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface ScalingPlansService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/scalingPlans") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, + @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/scalingPlans") + @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, + @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, + @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("pageSize") Integer pageSize, + @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") @ExpectedResponses({ 200 }) @@ -88,16 +117,6 @@ Mono> create(@HostParam("$host") String endpoint, @BodyParam("application/json") ScalingPlanInner scalingPlan, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("scalingPlanName") String scalingPlanName, @HeaderParam("Accept") String accept, - Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") @ExpectedResponses({ 200 }) @@ -110,39 +129,20 @@ Mono> update(@HostParam("$host") String endpoint, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/scalingPlans") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/scalingPlans") - @ExpectedResponses({ 200 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") + @ExpectedResponses({ 200, 204 }) @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, - @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("scalingPlanName") String scalingPlanName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( + Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); @@ -150,7 +150,7 @@ Mono> listByResourceGroupNext( @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( + Mono> listByHostPoolNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); @@ -158,24 +158,26 @@ Mono> listBySubscriptionNext( @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHostPoolNext( + Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Get a scaling plan. + * List scaling plans in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a scaling plan along with {@link Response} on successful completion of {@link Mono}. + * @return list of scaling plan definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String scalingPlanName) { + private Mono> listSinglePageAsync(Integer pageSize, Boolean isDescending, + Integer initialSkip) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -184,35 +186,31 @@ public Mono> getByResourceGroupWithResponseAsync(Stri return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scalingPlanName == null) { - return Mono - .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), pageSize, isDescending, initialSkip, 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 a scaling plan. + * List scaling plans in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a scaling plan along with {@link Response} on successful completion of {@link Mono}. + * @return list of scaling plan definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String scalingPlanName, Context context) { + private Mono> listSinglePageAsync(Integer pageSize, Boolean isDescending, + Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -221,82 +219,117 @@ private Mono> getByResourceGroupWithResponseAsync(Str return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (scalingPlanName == null) { - return Mono - .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, accept, context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), pageSize, + isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Get a scaling plan. + * List scaling plans in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a scaling plan on successful completion of {@link Mono}. + * @return list of scaling plan definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String scalingPlanName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, scalingPlanName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip) { + return new PagedFlux<>(() -> listSinglePageAsync(pageSize, isDescending, initialSkip), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Get a scaling plan. + * List scaling plans in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of scaling plan definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedFlux<>(() -> listSinglePageAsync(pageSize, isDescending, initialSkip), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List scaling plans in subscription. + * + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a scaling plan along with {@link Response}. + * @return list of scaling plan definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String scalingPlanName, + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, scalingPlanName, context).block(); + return new PagedFlux<>(() -> listSinglePageAsync(pageSize, isDescending, initialSkip, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** - * Get a scaling plan. + * List scaling plans in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedIterable<>(listAsync(pageSize, isDescending, initialSkip)); + } + + /** + * List scaling plans in subscription. + * + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a scaling plan. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScalingPlanInner getByResourceGroup(String resourceGroupName, String scalingPlanName) { - return getByResourceGroupWithResponse(resourceGroupName, scalingPlanName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, + Context context) { + return new PagedIterable<>(listAsync(pageSize, isDescending, initialSkip, context)); } /** - * Create or update a scaling plan. + * List scaling plan associated with hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param scalingPlan Object containing scaling plan definitions. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlan along with {@link Response} on successful completion of {@link Mono}. + * @return list of scaling plan definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync(String resourceGroupName, String scalingPlanName, - ScalingPlanInner scalingPlan) { + private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -309,37 +342,37 @@ public Mono> createWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (scalingPlanName == null) { - return Mono - .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); - } - if (scalingPlan == null) { - return Mono.error(new IllegalArgumentException("Parameter scalingPlan is required and cannot be null.")); - } else { - scalingPlan.validate(); + 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.create(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlan, accept, context)) + .withContext(context -> service.listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, + 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())); } /** - * Create or update a scaling plan. + * List scaling plan associated with hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param scalingPlan Object containing scaling plan definitions. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlan along with {@link Response} on successful completion of {@link Mono}. + * @return list of scaling plan definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceGroupName, String scalingPlanName, - ScalingPlanInner scalingPlan, Context context) { + private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -352,85 +385,136 @@ private Mono> createWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (scalingPlanName == null) { - return Mono - .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); - } - if (scalingPlan == null) { - return Mono.error(new IllegalArgumentException("Parameter scalingPlan is required and cannot be null.")); - } else { - scalingPlan.validate(); + 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.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, scalingPlanName, scalingPlan, accept, context); + return service + .listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Create or update a scaling plan. + * List scaling plan associated with hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param scalingPlan Object containing scaling plan definitions. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlan on successful completion of {@link Mono}. + * @return list of scaling plan definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String resourceGroupName, String scalingPlanName, - ScalingPlanInner scalingPlan) { - return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlan) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { + return new PagedFlux<>( + () -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), + nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); } /** - * Create or update a scaling plan. + * List scaling plan associated with hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param scalingPlan Object containing scaling plan definitions. + * @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 list of scaling plan definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedFlux<>( + () -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), + nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); + } + + /** + * List scaling plan associated with 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 pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlan along with {@link Response}. + * @return list of scaling plan definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String resourceGroupName, String scalingPlanName, - ScalingPlanInner scalingPlan, Context context) { - return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlan, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, + isDescending, initialSkip, context), nextLink -> listByHostPoolNextSinglePageAsync(nextLink, context)); } /** - * Create or update a scaling plan. + * List scaling plan associated with hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param scalingPlan Object containing scaling plan definitions. + * @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 scalingPlan. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScalingPlanInner create(String resourceGroupName, String scalingPlanName, ScalingPlanInner scalingPlan) { - return createWithResponse(resourceGroupName, scalingPlanName, scalingPlan, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedIterable<>( + listByHostPoolAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip)); } /** - * Remove a scaling plan. + * List scaling plan associated with hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedIterable<>( + listByHostPoolAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context)); + } + + /** + * List scaling plans. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of scaling plan definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -443,31 +527,33 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (scalingPlanName == null) { - return Mono - .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, accept, context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, initialSkip, 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())); } /** - * Remove a scaling plan. + * List scaling plans. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return list of scaling plan definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, - Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -480,75 +566,124 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (scalingPlanName == null) { - return Mono - .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, scalingPlanName, accept, context); + return service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Remove a scaling plan. + * List scaling plans. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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. + * @return list of scaling plan definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String scalingPlanName) { - return deleteWithResponseAsync(resourceGroupName, scalingPlanName).flatMap(ignored -> Mono.empty()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Remove a scaling plan. + * List scaling plans. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of scaling plan definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List scaling plans. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return list of scaling plan definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List scaling plans. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String scalingPlanName, Context context) { - return deleteWithResponseAsync(resourceGroupName, scalingPlanName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, pageSize, isDescending, initialSkip)); } /** - * Remove a scaling plan. + * List scaling plans. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String scalingPlanName) { - deleteWithResponse(resourceGroupName, scalingPlanName, Context.NONE); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + return new PagedIterable<>( + listByResourceGroupAsync(resourceGroupName, pageSize, isDescending, initialSkip, context)); } /** - * Update a scaling plan. + * Get a scaling plan. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param scalingPlan Object containing scaling plan 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 scalingPlan along with {@link Response} on successful completion of {@link Mono}. + * @return a scaling plan along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync(String resourceGroupName, String scalingPlanName, - ScalingPlanPatch scalingPlan) { + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String scalingPlanName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -565,31 +700,27 @@ public Mono> updateWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } - if (scalingPlan != null) { - scalingPlan.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlan, accept, context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update a scaling plan. + * Get a scaling plan. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param scalingPlan Object containing scaling plan 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 scalingPlan along with {@link Response} on successful completion of {@link Mono}. + * @return a scaling plan along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String scalingPlanName, - ScalingPlanPatch scalingPlan, Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String scalingPlanName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -606,81 +737,75 @@ private Mono> updateWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } - if (scalingPlan != null) { - scalingPlan.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, scalingPlanName, scalingPlan, accept, context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, accept, context); } /** - * Update a scaling plan. + * Get a scaling plan. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlan on successful completion of {@link Mono}. + * @return a scaling plan on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String scalingPlanName) { - final ScalingPlanPatch scalingPlan = null; - return updateWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlan) + public Mono getByResourceGroupAsync(String resourceGroupName, String scalingPlanName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, scalingPlanName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Update a scaling plan. + * Get a scaling plan. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param scalingPlan Object containing scaling plan 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 scalingPlan along with {@link Response}. + * @return a scaling plan along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String scalingPlanName, - ScalingPlanPatch scalingPlan, Context context) { - return updateWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlan, context).block(); + public Response getByResourceGroupWithResponse(String resourceGroupName, String scalingPlanName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, scalingPlanName, context).block(); } /** - * Update a scaling plan. + * Get a scaling plan. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlan. + * @return a scaling plan. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ScalingPlanInner update(String resourceGroupName, String scalingPlanName) { - final ScalingPlanPatch scalingPlan = null; - return updateWithResponse(resourceGroupName, scalingPlanName, scalingPlan, Context.NONE).getValue(); + public ScalingPlanInner getByResourceGroup(String resourceGroupName, String scalingPlanName) { + return getByResourceGroupWithResponse(resourceGroupName, scalingPlanName, Context.NONE).getValue(); } /** - * List scaling plans. + * Create or update a scaling plan. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param scalingPlanName The name of the scaling plan. + * @param scalingPlan Object containing scaling plan 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 scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return represents a scaling plan definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Integer pageSize, Boolean isDescending, Integer initialSkip) { + public Mono> createWithResponseAsync(String resourceGroupName, String scalingPlanName, + ScalingPlanInner scalingPlan) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -693,32 +818,38 @@ private Mono> listByResourceGroupSinglePageAsync return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (scalingPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); + } + if (scalingPlan == null) { + return Mono.error(new IllegalArgumentException("Parameter scalingPlan is required and cannot be null.")); + } else { + scalingPlan.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, initialSkip, accept, - context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlan, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List scaling plans. + * Create or update a scaling plan. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param scalingPlanName The name of the scaling plan. + * @param scalingPlan Object containing scaling plan 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 scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return represents a scaling plan definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private Mono> createWithResponseAsync(String resourceGroupName, String scalingPlanName, + ScalingPlanInner scalingPlan, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -731,125 +862,88 @@ private Mono> listByResourceGroupSinglePageAsync return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (scalingPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); + } + if (scalingPlan == null) { + return Mono.error(new IllegalArgumentException("Parameter scalingPlan is required and cannot be null.")); + } else { + scalingPlan.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, initialSkip, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List scaling plans. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, scalingPlan, accept, context); } /** - * List scaling plans. + * Create or update a scaling plan. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @param scalingPlan Object containing scaling plan 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 scalingPlanList as paginated response with {@link PagedFlux}. + * @return represents a scaling plan definition on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAsync(String resourceGroupName, String scalingPlanName, + ScalingPlanInner scalingPlan) { + return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlan) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List scaling plans. + * Create or update a scaling plan. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param scalingPlanName The name of the scaling plan. + * @param scalingPlan Object containing scaling plan 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 scalingPlanList as paginated response with {@link PagedFlux}. + * @return represents a scaling plan definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String resourceGroupName, String scalingPlanName, + ScalingPlanInner scalingPlan, Context context) { + return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlan, context).block(); } /** - * List scaling plans. + * Create or update a scaling plan. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @param scalingPlan Object containing scaling plan 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 scalingPlanList as paginated response with {@link PagedIterable}. + * @return represents a scaling plan definition. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, pageSize, isDescending, initialSkip)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ScalingPlanInner create(String resourceGroupName, String scalingPlanName, ScalingPlanInner scalingPlan) { + return createWithResponse(resourceGroupName, scalingPlanName, scalingPlan, Context.NONE).getValue(); } /** - * List scaling plans. + * Update a scaling plan. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context) { - return new PagedIterable<>( - listByResourceGroupAsync(resourceGroupName, pageSize, isDescending, initialSkip, context)); - } - - /** - * List scaling plans in subscription. - * - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param scalingPlanName The name of the scaling plan. + * @param scalingPlan The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return represents a scaling plan definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Integer pageSize, Boolean isDescending, - Integer initialSkip) { + public Mono> updateWithResponseAsync(String resourceGroupName, String scalingPlanName, + ScalingPlanPatch scalingPlan) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -858,30 +952,40 @@ private Mono> listSinglePageAsync(Integer pageSi return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scalingPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); + } + if (scalingPlan != null) { + scalingPlan.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), pageSize, isDescending, initialSkip, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlan, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List scaling plans in subscription. + * Update a scaling plan. * - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @param scalingPlan The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return represents a scaling plan definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Integer pageSize, Boolean isDescending, - Integer initialSkip, Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, String scalingPlanName, + ScalingPlanPatch scalingPlan, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -890,116 +994,86 @@ private Mono> listSinglePageAsync(Integer pageSi return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scalingPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); + } + if (scalingPlan != null) { + scalingPlan.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), pageSize, - isDescending, initialSkip, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, scalingPlan, accept, context); } /** - * List scaling plans in subscription. + * Update a scaling plan. * - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip) { - return new PagedFlux<>(() -> listSinglePageAsync(pageSize, isDescending, initialSkip), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * List scaling plans in subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedFlux}. + * @return represents a scaling plan definition on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedFlux<>(() -> listSinglePageAsync(pageSize, isDescending, initialSkip), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String scalingPlanName) { + final ScalingPlanPatch scalingPlan = null; + return updateWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlan) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List scaling plans in subscription. + * Update a scaling plan. * - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @param scalingPlan The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(pageSize, isDescending, initialSkip, context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * List scaling plans in subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedIterable}. + * @return represents a scaling plan definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedIterable<>(listAsync(pageSize, isDescending, initialSkip)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String scalingPlanName, + ScalingPlanPatch scalingPlan, Context context) { + return updateWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlan, context).block(); } /** - * List scaling plans in subscription. + * Update a scaling plan. * - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedIterable}. + * @return represents a scaling plan definition. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, - Context context) { - return new PagedIterable<>(listAsync(pageSize, isDescending, initialSkip, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ScalingPlanInner update(String resourceGroupName, String scalingPlanName) { + final ScalingPlanPatch scalingPlan = null; + return updateWithResponse(resourceGroupName, scalingPlanName, scalingPlan, Context.NONE).getValue(); } /** - * List scaling plan associated with hostpool. + * Remove a scaling plan. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, - String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + public Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1012,36 +1086,31 @@ private Mono> listByHostPoolSinglePageAsync(Stri 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 (scalingPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scalingPlanName 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, pageSize, isDescending, initialSkip, - accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List scaling plan associated with hostpool. + * Remove a scaling plan. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param scalingPlanName The name of the scaling plan. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, - String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1054,118 +1123,59 @@ private Mono> listByHostPoolSinglePageAsync(Stri 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 (scalingPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scalingPlanName 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, pageSize, isDescending, initialSkip, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List scaling plan associated with 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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, - Integer pageSize, Boolean isDescending, Integer initialSkip) { - return new PagedFlux<>( - () -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), - nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, accept, context); } /** - * List scaling plan associated with hostpool. + * Remove a scaling plan. * * @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 scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedFlux<>( - () -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), - nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String scalingPlanName) { + return deleteWithResponseAsync(resourceGroupName, scalingPlanName).flatMap(ignored -> Mono.empty()); } /** - * List scaling plan associated with hostpool. + * Remove a scaling plan. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param scalingPlanName The name of the scaling plan. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, - isDescending, initialSkip, context), nextLink -> listByHostPoolNextSinglePageAsync(nextLink, context)); - } - - /** - * List scaling plan associated with 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 scalingPlanList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedIterable<>( - listByHostPoolAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String scalingPlanName, Context context) { + return deleteWithResponseAsync(resourceGroupName, scalingPlanName, context).block(); } /** - * List scaling plan associated with hostpool. + * Remove a scaling plan. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedIterable<>( - listByHostPoolAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String scalingPlanName) { + deleteWithResponse(resourceGroupName, scalingPlanName, Context.NONE); } /** @@ -1175,10 +1185,11 @@ public PagedIterable listByHostPool(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of scaling plan definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1189,7 +1200,7 @@ private Mono> listByResourceGroupNextSinglePageA final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1203,10 +1214,11 @@ private Mono> listByResourceGroupNextSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of scaling plan definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1217,7 +1229,7 @@ private Mono> listByResourceGroupNextSinglePageA } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1229,10 +1241,11 @@ private Mono> listByResourceGroupNextSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of scaling plan definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + private Mono> listByHostPoolNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1242,8 +1255,7 @@ private Mono> listBySubscriptionNextSinglePageAs } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .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())); @@ -1257,11 +1269,11 @@ private Mono> listBySubscriptionNextSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of scaling plan definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, - Context context) { + private Mono> listByHostPoolNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1271,7 +1283,7 @@ private Mono> listBySubscriptionNextSinglePageAs } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, 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)); } @@ -1283,10 +1295,11 @@ private Mono> listBySubscriptionNextSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of scaling plan definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolNextSinglePageAsync(String nextLink) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1296,7 +1309,8 @@ private Mono> listByHostPoolNextSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context)) + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1310,10 +1324,12 @@ private Mono> listByHostPoolNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of scaling plan definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolNextSinglePageAsync(String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1323,7 +1339,7 @@ private Mono> listByHostPoolNextSinglePageAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlansImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlansImpl.java index 634b0ea66f7f..0d727814ec1f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlansImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlansImpl.java @@ -27,6 +27,41 @@ public ScalingPlansImpl(ScalingPlansClient innerClient, this.serviceManager = serviceManager; } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); + } + + public PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, + Context context) { + PagedIterable inner = this.serviceClient().list(pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); + } + + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { + PagedIterable inner = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); + } + + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient() + .listByHostPool(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); + } + public Response getByResourceGroupWithResponse(String resourceGroupName, String scalingPlanName, Context context) { Response inner @@ -57,41 +92,6 @@ public void deleteByResourceGroup(String resourceGroupName, String scalingPlanNa this.serviceClient().delete(resourceGroupName, scalingPlanName); } - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, pageSize, isDescending, initialSkip, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); - } - - public PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, - Context context) { - PagedIterable inner = this.serviceClient().list(pageSize, isDescending, initialSkip, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); - } - - public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { - PagedIterable inner = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); - } - - public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context) { - PagedIterable inner = this.serviceClient() - .listByHostPool(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); - } - public ScalingPlan getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == 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..32909fbf63e0 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostConfigurationsClientImpl.java @@ -0,0 +1,950 @@ +// 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" }) + @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("/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" }) + @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("{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); + } + + /** + * 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 list of SessionHostConfiguration definitions 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 list of SessionHostConfiguration definitions 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 list of SessionHostConfiguration definitions 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 list of SessionHostConfiguration definitions 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 list of SessionHostConfiguration definitions 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 list of SessionHostConfiguration definitions 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 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(); + } + + /** + * 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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties 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 Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties 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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of schema for SessionHostConfiguration properties. + */ + @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 Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of schema for SessionHostConfiguration properties. + */ + @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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of schema for SessionHostConfiguration properties. + */ + @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 Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of schema for SessionHostConfiguration properties. + */ + @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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties 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 Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties 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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties. + */ + @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 Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties. + */ + @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 The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties 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 The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties 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 The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of schema for SessionHostConfiguration properties. + */ + @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 schema for SessionHostConfiguration properties. + */ + @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 The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of schema for SessionHostConfiguration properties. + */ + @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 schema for SessionHostConfiguration properties. + */ + @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 The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of schema for SessionHostConfiguration properties. + */ + @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 The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties 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 schema for SessionHostConfiguration properties 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 The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties 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 schema for SessionHostConfiguration properties. + */ + @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 The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionHostConfigurationInner update(String resourceGroupName, String hostPoolName, + SessionHostConfigurationPatch sessionHostConfiguration, Context context) { + return updateAsync(resourceGroupName, hostPoolName, sessionHostConfiguration, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SessionHostConfiguration definitions 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 list of SessionHostConfiguration definitions 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..4fc1f8fdeaec --- /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 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())); + } + + 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 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; + } + } + + 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..851bbc92720b 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 @@ -105,6 +105,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..a0aa38ff776e --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementUpdateStatusImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementUpdateStatusInner; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementUpdateStatusPropertiesInner; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementUpdateOperationStatus; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementUpdateStatus; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementUpdateStatusProperties; +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 Double 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 SessionHostManagementUpdateOperationStatus status() { + return this.innerModel().status(); + } + + public SessionHostManagementUpdateStatusProperties properties() { + SessionHostManagementUpdateStatusPropertiesInner inner = this.innerModel().properties(); + if (inner != null) { + return new SessionHostManagementUpdateStatusPropertiesImpl(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..57dc0a23c6f2 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementsClientImpl.java @@ -0,0 +1,701 @@ +// 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") + @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("/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("{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); + } + + /** + * List SessionHostManagements. + * + * @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 list of SessionHostManagement definitions 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. + * + * @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 list of SessionHostManagement definitions 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. + * + * @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 list of SessionHostManagement definitions 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. + * + * @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 list of SessionHostManagement definitions 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. + * + * @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 list of SessionHostManagement definitions 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. + * + * @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 list of SessionHostManagement definitions 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 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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostManagement properties 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 Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostManagement properties 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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostManagement properties 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 Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostManagement properties 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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostManagement properties. + */ + @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 The properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostManagement properties 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 The properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostManagement properties 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 schema for SessionHostManagement properties 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 The properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostManagement properties 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 schema for SessionHostManagement properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionHostManagementInner update(String resourceGroupName, String hostPoolName) { + final SessionHostManagementPatch sessionHostManagement = null; + return updateWithResponse(resourceGroupName, hostPoolName, sessionHostManagement, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SessionHostManagement definitions 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 list of SessionHostManagement definitions 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..9d8b665ce309 --- /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 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())); + } + + 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; + } + } + + 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..787c5f1ff143 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementsUpdateStatusClientImpl.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 a SessionHostManagementUpdateStatus. + * + * @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 SessionHostManagementUpdateStatus 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 SessionHostManagementUpdateStatus. + * + * @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 SessionHostManagementUpdateStatus 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 SessionHostManagementUpdateStatus. + * + * @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 SessionHostManagementUpdateStatus 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 SessionHostManagementUpdateStatus. + * + * @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 SessionHostManagementUpdateStatus 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 SessionHostManagementUpdateStatus. + * + * @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 SessionHostManagementUpdateStatus. + */ + @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/SessionHostsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsClientImpl.java index b9a03129f802..29c9f54427c5 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 @@ -14,6 +14,7 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -67,24 +68,25 @@ public final class SessionHostsClientImpl implements SessionHostsClient { @ServiceInterface(name = "DesktopVirtualizatio") public interface SessionHostsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> list(@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); + @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, + @QueryParam("initialSkip") Integer initialSkip, @QueryParam("vmPath") String vmPath, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}") - @ExpectedResponses({ 200, 204 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@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, @QueryParam("force") Boolean force, - @HeaderParam("Accept") String accept, Context context); + @PathParam("sessionHostName") String sessionHostname, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}") @@ -98,14 +100,24 @@ Mono> update(@HostParam("$host") String endpoint, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts") - @ExpectedResponses({ 200 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> delete(@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, @QueryParam("force") Boolean force, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/retryProvisioning") + @ExpectedResponses({ 204 }) + @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, - @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); + @PathParam("sessionHostName") String sessionHostname, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -116,19 +128,23 @@ Mono> listNext(@PathParam(value = "nextLink", encoded } /** - * Get a session host. + * List sessionHosts. * * @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 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. - * @return a session host along with {@link Response} on successful completion of {@link Mono}. + * @return list of SessionHost definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName, - String sessionHostname) { + private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, + 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.")); @@ -144,32 +160,35 @@ public Mono> getWithResponseAsync(String resourceGrou 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.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), 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)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get a session host. + * List sessionHosts. * * @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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a session host along with {@link Response} on successful completion of {@link Mono}. + * @return list of SessionHost definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName, - String sessionHostname, Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, + 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.")); @@ -185,82 +204,136 @@ private Mono> getWithResponseAsync(String resourceGro 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.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, hostPoolName, sessionHostname, accept, context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + 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)); } /** - * Get a session host. + * List sessionHosts. * * @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 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. - * @return a session host on successful completion of {@link Mono}. + * @return list of SessionHost definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String hostPoolName, String sessionHostname) { - return getWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, String vmPath) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, vmPath), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Get a session host. + * List sessionHosts. * * @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 list of SessionHost definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String hostPoolName) { + 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, vmPath), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List sessionHosts. + * + * @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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a session host along with {@link Response}. + * @return list of SessionHost definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String hostPoolName, - String sessionHostname, Context context) { - return getWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, String vmPath, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, + initialSkip, vmPath, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Get a session host. + * List sessionHosts. * * @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 session host. + * @return list of SessionHost definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SessionHostInner get(String resourceGroupName, String hostPoolName, String sessionHostname) { - return getWithResponse(resourceGroupName, hostPoolName, sessionHostname, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String hostPoolName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + final String vmPath = null; + return new PagedIterable<>( + listAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, vmPath)); } /** - * Remove a SessionHost. + * List sessionHosts. + * + * @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 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SessionHost definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, String vmPath, Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, vmPath, context)); + } + + /** + * Get a session host. * * @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 force Force flag to force sessionHost deletion even when userSession exists. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return a session host along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, - String sessionHostname, Boolean force) { + public Mono> getWithResponseAsync(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.")); @@ -281,27 +354,27 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St .error(new IllegalArgumentException("Parameter sessionHostname is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, force, accept, context)) + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Remove a SessionHost. + * Get a session host. * * @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 force Force flag to force sessionHost deletion even when userSession exists. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return a session host along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, - String sessionHostname, Boolean force, Context context) { + private Mono> getWithResponseAsync(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.")); @@ -323,12 +396,12 @@ 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, hostPoolName, sessionHostname, force, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, sessionHostname, accept, context); } /** - * Remove a SessionHost. + * Get a session host. * * @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. @@ -336,36 +409,34 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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. + * @return a session host on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String hostPoolName, String sessionHostname) { - final Boolean force = null; - return deleteWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, force) - .flatMap(ignored -> Mono.empty()); + public Mono getAsync(String resourceGroupName, String hostPoolName, String sessionHostname) { + return getWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove a SessionHost. + * Get a session host. * * @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 force Force flag to force sessionHost deletion even when userSession exists. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return a session host along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, - Boolean force, Context context) { - return deleteWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, force, context).block(); + public Response getWithResponse(String resourceGroupName, String hostPoolName, + String sessionHostname, Context context) { + return getWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, context).block(); } /** - * Remove a SessionHost. + * Get a session host. * * @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. @@ -373,11 +444,11 @@ public Response deleteWithResponse(String resourceGroupName, String hostPo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a session host. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String hostPoolName, String sessionHostname) { - final Boolean force = null; - deleteWithResponse(resourceGroupName, hostPoolName, sessionHostname, force, Context.NONE); + public SessionHostInner get(String resourceGroupName, String hostPoolName, String sessionHostname) { + return getWithResponse(resourceGroupName, hostPoolName, sessionHostname, Context.NONE).getValue(); } /** @@ -387,7 +458,7 @@ public void delete(String resourceGroupName, String hostPoolName, String session * @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 force Force flag to update assign, unassign or reassign personal desktop. - * @param sessionHost Object containing SessionHost definitions. + * @param sessionHost The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -433,7 +504,7 @@ public Mono> updateWithResponseAsync(String resourceG * @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 force Force flag to update assign, unassign or reassign personal desktop. - * @param sessionHost Object containing SessionHost definitions. + * @param sessionHost The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -497,7 +568,7 @@ public Mono updateAsync(String resourceGroupName, String hostP * @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 force Force flag to update assign, unassign or reassign personal desktop. - * @param sessionHost Object containing SessionHost definitions. + * @param sessionHost The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -531,21 +602,20 @@ public SessionHostInner update(String resourceGroupName, String hostPoolName, St } /** - * List sessionHosts. + * Remove 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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param sessionHostname The name of the session host within the specified host pool. + * @param force Force flag to force sessionHost deletion even when userSession exists. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sessionHostList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, - Integer pageSize, Boolean isDescending, Integer initialSkip) { + public Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, Boolean force) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -561,33 +631,32 @@ private Mono> listSinglePageAsync(String resourc 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.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, - accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, force, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List sessionHosts. + * Remove 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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param sessionHostname The name of the session host within the specified host pool. + * @param force Force flag to force sessionHost deletion even when userSession exists. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sessionHostList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, Boolean force, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -603,115 +672,197 @@ private Mono> listSinglePageAsync(String resourc 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 - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, sessionHostname, force, accept, context); } /** - * List sessionHosts. + * Remove 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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @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 sessionHostList as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String hostPoolName, String sessionHostname) { + final Boolean force = null; + return deleteWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, force) + .flatMap(ignored -> Mono.empty()); } /** - * List sessionHosts. + * Remove 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 force Force flag to force sessionHost deletion even when userSession exists. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sessionHostList as paginated response with {@link PagedFlux}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String hostPoolName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Boolean force, Context context) { + return deleteWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, force, context).block(); } /** - * List sessionHosts. + * Remove 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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @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 delete(String resourceGroupName, String hostPoolName, String sessionHostname) { + final Boolean force = null; + deleteWithResponse(resourceGroupName, hostPoolName, sessionHostname, force, Context.NONE); + } + + /** + * A synchronous resource action that returns no content. + * + * @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())); + } + + /** + * A synchronous resource action that returns no content. + * + * @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 sessionHostList as paginated response with {@link PagedFlux}. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @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)); + @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); } /** - * List sessionHosts. + * A synchronous resource action that returns no content. * * @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 sessionHostList as paginated response with {@link PagedIterable}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String hostPoolName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedIterable<>(listAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono retryProvisioningAsync(String resourceGroupName, String hostPoolName, String sessionHostname) { + return retryProvisioningWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname) + .flatMap(ignored -> Mono.empty()); } /** - * List sessionHosts. + * A synchronous resource action that returns no content. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @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 sessionHostList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response retryProvisioningWithResponse(String resourceGroupName, String hostPoolName, + String sessionHostname, Context context) { + return retryProvisioningWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, context).block(); + } + + /** + * A synchronous resource action that returns no content. + * + * @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); } /** @@ -721,7 +872,8 @@ public PagedIterable list(String resourceGroupName, String hos * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sessionHostList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of SessionHost definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -747,7 +899,8 @@ private Mono> listNextSinglePageAsync(String nex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sessionHostList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of SessionHost definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context 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..11f8e7b5c04c 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 @@ -28,6 +28,18 @@ public SessionHostsImpl(SessionHostsClient innerClient, this.serviceManager = serviceManager; } + public PagedIterable list(String resourceGroupName, String hostPoolName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, hostPoolName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionHostImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, + 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())); + } + public Response getWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, Context context) { Response inner @@ -49,16 +61,6 @@ public SessionHost get(String resourceGroupName, String hostPoolName, String ses } } - public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, - Boolean force, Context context) { - return this.serviceClient() - .deleteWithResponse(resourceGroupName, hostPoolName, sessionHostname, force, context); - } - - public void delete(String resourceGroupName, String hostPoolName, String sessionHostname) { - this.serviceClient().delete(resourceGroupName, hostPoolName, sessionHostname); - } - public Response updateWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, Boolean force, SessionHostPatch sessionHost, Context context) { Response inner = this.serviceClient() @@ -80,16 +82,24 @@ public SessionHost update(String resourceGroupName, String hostPoolName, String } } - public PagedIterable list(String resourceGroupName, String hostPoolName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, hostPoolName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionHostImpl(inner1, this.manager())); + public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Boolean force, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, hostPoolName, sessionHostname, force, context); } - 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); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionHostImpl(inner1, this.manager())); + public void delete(String resourceGroupName, String hostPoolName, String sessionHostname) { + this.serviceClient().delete(resourceGroupName, hostPoolName, sessionHostname); + } + + 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 SessionHostsClient serviceClient() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemImpl.java index f1feef9d67f6..34405820466f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemImpl.java @@ -7,6 +7,7 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.desktopvirtualization.fluent.models.StartMenuItemInner; import com.azure.resourcemanager.desktopvirtualization.models.StartMenuItem; +import com.azure.resourcemanager.desktopvirtualization.models.StartMenuItemProperties; public final class StartMenuItemImpl implements StartMenuItem { private StartMenuItemInner innerObject; @@ -31,28 +32,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String appAlias() { - return this.innerModel().appAlias(); - } - - public String filePath() { - return this.innerModel().filePath(); + public StartMenuItemProperties properties() { + return this.innerModel().properties(); } - public String commandLineArguments() { - return this.innerModel().commandLineArguments(); - } - - public String iconPath() { - return this.innerModel().iconPath(); - } - - public Integer iconIndex() { - return this.innerModel().iconIndex(); + public SystemData systemData() { + return this.innerModel().systemData(); } public StartMenuItemInner innerModel() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemsClientImpl.java index 181331b5e6ac..99285f0716fa 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemsClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemsClientImpl.java @@ -92,7 +92,8 @@ Mono> listNext(@PathParam(value = "nextLink", encode * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return startMenuItemList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of StartMenuItem definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, @@ -135,7 +136,8 @@ private Mono> listSinglePageAsync(String resou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return startMenuItemList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of StartMenuItem definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, @@ -176,7 +178,7 @@ private Mono> listSinglePageAsync(String resou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return startMenuItemList as paginated response with {@link PagedFlux}. + * @return list of StartMenuItem definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(String resourceGroupName, String applicationGroupName, @@ -194,7 +196,7 @@ public PagedFlux listAsync(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return startMenuItemList as paginated response with {@link PagedFlux}. + * @return list of StartMenuItem definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(String resourceGroupName, String applicationGroupName) { @@ -218,7 +220,7 @@ public PagedFlux listAsync(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return startMenuItemList as paginated response with {@link PagedFlux}. + * @return list of StartMenuItem definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String applicationGroupName, @@ -235,7 +237,7 @@ private PagedFlux listAsync(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return startMenuItemList as paginated response with {@link PagedIterable}. + * @return list of StartMenuItem definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String applicationGroupName) { @@ -258,7 +260,7 @@ public PagedIterable list(String resourceGroupName, String a * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return startMenuItemList as paginated response with {@link PagedIterable}. + * @return list of StartMenuItem definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String applicationGroupName, @@ -274,7 +276,8 @@ public PagedIterable list(String resourceGroupName, String a * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return startMenuItemList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of StartMenuItem definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -300,7 +303,8 @@ private Mono> listNextSinglePageAsync(String n * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return startMenuItemList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of StartMenuItem definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionsClientImpl.java index 683fdb4df164..bbbc5c6f31cd 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionsClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionsClientImpl.java @@ -67,13 +67,13 @@ public final class UserSessionsClientImpl implements UserSessionsClient { @ServiceInterface(name = "DesktopVirtualizatio") public interface UserSessionsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/userSessions") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHostPool(@HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, - @QueryParam("$filter") String filter, @QueryParam("pageSize") Integer pageSize, + @PathParam("sessionHostName") String sessionHostname, @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); @@ -97,17 +97,6 @@ Mono> delete(@HostParam("$host") String endpoint, @QueryParam("ap @PathParam("sessionHostName") String sessionHostname, @PathParam("userSessionId") String userSessionId, @QueryParam("force") Boolean force, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@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, @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/disconnect") @ExpectedResponses({ 200 }) @@ -130,11 +119,14 @@ Mono> sendMessage(@HostParam("$host") String endpoint, Context context); @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/userSessions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHostPoolNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Mono> listByHostPool(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @QueryParam("$filter") String filter, @QueryParam("pageSize") Integer pageSize, + @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -143,6 +135,14 @@ Mono> listByHostPoolNext( @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByHostPoolNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -150,18 +150,19 @@ Mono> listNext(@PathParam(value = "nextLink", encoded * * @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 filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @param sessionHostname The name of the session host within the specified host pool. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of UserSession definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, - String hostPoolName, String filter, Integer pageSize, Boolean isDescending, Integer initialSkip) { + private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -177,11 +178,15 @@ private Mono> listByHostPoolSinglePageAsync(Stri 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.listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, filter, pageSize, isDescending, - initialSkip, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, pageSize, + isDescending, initialSkip, 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())); @@ -192,7 +197,7 @@ private Mono> listByHostPoolSinglePageAsync(Stri * * @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 filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @param sessionHostname The name of the session host within the specified host pool. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -200,12 +205,12 @@ private Mono> listByHostPoolSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of UserSession definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, - String hostPoolName, String filter, Integer pageSize, Boolean isDescending, Integer initialSkip, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -221,11 +226,15 @@ private Mono> listByHostPoolSinglePageAsync(Stri 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 - .listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, hostPoolName, filter, pageSize, isDescending, initialSkip, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, sessionHostname, pageSize, isDescending, initialSkip, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -235,20 +244,20 @@ private Mono> listByHostPoolSinglePageAsync(Stri * * @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 filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @param sessionHostname The name of the session host within the specified host pool. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList as paginated response with {@link PagedFlux}. + * @return list of UserSession definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, String filter, + public PagedFlux listAsync(String resourceGroupName, String hostPoolName, String sessionHostname, Integer pageSize, Boolean isDescending, Integer initialSkip) { - return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, filter, pageSize, - isDescending, initialSkip), nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, hostPoolName, sessionHostname, pageSize, + isDescending, initialSkip), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -256,19 +265,20 @@ public PagedFlux listByHostPoolAsync(String resourceGroupName, * * @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 userSessionList as paginated response with {@link PagedFlux}. + * @return list of UserSession definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName) { - final String filter = null; + public PagedFlux listAsync(String resourceGroupName, String hostPoolName, + String sessionHostname) { final Integer pageSize = null; final Boolean isDescending = null; final Integer initialSkip = null; - return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, filter, pageSize, - isDescending, initialSkip), nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, hostPoolName, sessionHostname, pageSize, + isDescending, initialSkip), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -276,7 +286,7 @@ public PagedFlux listByHostPoolAsync(String resourceGroupName, * * @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 filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @param sessionHostname The name of the session host within the specified host pool. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -284,13 +294,13 @@ public PagedFlux listByHostPoolAsync(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList as paginated response with {@link PagedFlux}. + * @return list of UserSession definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, - String filter, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, filter, pageSize, - isDescending, initialSkip, context), nextLink -> listByHostPoolNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(String resourceGroupName, String hostPoolName, String sessionHostname, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, hostPoolName, sessionHostname, pageSize, + isDescending, initialSkip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -298,19 +308,19 @@ private PagedFlux listByHostPoolAsync(String resourceGroupName * * @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 userSessionList as paginated response with {@link PagedIterable}. + * @return list of UserSession definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { - final String filter = null; + public PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname) { final Integer pageSize = null; final Boolean isDescending = null; final Integer initialSkip = null; return new PagedIterable<>( - listByHostPoolAsync(resourceGroupName, hostPoolName, filter, pageSize, isDescending, initialSkip)); + listAsync(resourceGroupName, hostPoolName, sessionHostname, pageSize, isDescending, initialSkip)); } /** @@ -318,7 +328,7 @@ public PagedIterable listByHostPool(String resourceGroupName, * * @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 filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @param sessionHostname The name of the session host within the specified host pool. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -326,13 +336,13 @@ public PagedIterable listByHostPool(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList as paginated response with {@link PagedIterable}. + * @return list of UserSession definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, String filter, + public PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( - listByHostPoolAsync(resourceGroupName, hostPoolName, filter, pageSize, isDescending, initialSkip, context)); + listAsync(resourceGroupName, hostPoolName, sessionHostname, pageSize, isDescending, initialSkip, context)); } /** @@ -631,22 +641,20 @@ public void delete(String resourceGroupName, String hostPoolName, String session } /** - * List userSessions. + * Disconnect a userSession. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param userSessionId The name of the user session within the specified session host. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, - String sessionHostname, Integer pageSize, Boolean isDescending, Integer initialSkip) { + public Mono> disconnectWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, String userSessionId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -666,34 +674,33 @@ private Mono> listSinglePageAsync(String resourc return Mono .error(new IllegalArgumentException("Parameter sessionHostname is required and cannot be null.")); } + if (userSessionId == null) { + return Mono.error(new IllegalArgumentException("Parameter userSessionId is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, pageSize, - isDescending, initialSkip, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.disconnect(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, userSessionId, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List userSessions. + * Disconnect a userSession. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param userSessionId The name of the user session within the specified session host. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, - String sessionHostname, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private Mono> disconnectWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, String userSessionId, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -713,136 +720,88 @@ private Mono> listSinglePageAsync(String resourc return Mono .error(new IllegalArgumentException("Parameter sessionHostname is required and cannot be null.")); } + if (userSessionId == null) { + return Mono.error(new IllegalArgumentException("Parameter userSessionId is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, hostPoolName, sessionHostname, pageSize, isDescending, initialSkip, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List userSessions. - * - * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String hostPoolName, String sessionHostname, - Integer pageSize, Boolean isDescending, Integer initialSkip) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, hostPoolName, sessionHostname, pageSize, - isDescending, initialSkip), nextLink -> listNextSinglePageAsync(nextLink)); + return service.disconnect(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, userSessionId, accept, + context); } /** - * List userSessions. + * Disconnect a userSession. * * @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 userSessionId The name of the user session within the specified session host. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String hostPoolName, - String sessionHostname) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, hostPoolName, sessionHostname, pageSize, - isDescending, initialSkip), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono disconnectAsync(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId) { + return disconnectWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId) + .flatMap(ignored -> Mono.empty()); } /** - * List userSessions. + * Disconnect a userSession. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param userSessionId The name of the user session within the specified session host. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String hostPoolName, String sessionHostname, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, hostPoolName, sessionHostname, pageSize, - isDescending, initialSkip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List userSessions. - * - * @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 userSessionList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedIterable<>( - listAsync(resourceGroupName, hostPoolName, sessionHostname, pageSize, isDescending, initialSkip)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response disconnectWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, Context context) { + return disconnectWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId, context) + .block(); } /** - * List userSessions. + * Disconnect a userSession. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param userSessionId The name of the user session within the specified session host. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, hostPoolName, sessionHostname, pageSize, isDescending, initialSkip, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void disconnect(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId) { + disconnectWithResponse(resourceGroupName, hostPoolName, sessionHostname, userSessionId, Context.NONE); } /** - * Disconnect a userSession. + * Send a message to a user. * * @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 userSessionId The name of the user session within the specified session host. + * @param sendMessage The sendMessage parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> disconnectWithResponseAsync(String resourceGroupName, String hostPoolName, - String sessionHostname, String userSessionId) { + public Mono> sendMessageWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, String userSessionId, SendMessage sendMessage) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -865,21 +824,25 @@ public Mono> disconnectWithResponseAsync(String resourceGroupName if (userSessionId == null) { return Mono.error(new IllegalArgumentException("Parameter userSessionId is required and cannot be null.")); } + if (sendMessage != null) { + sendMessage.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.disconnect(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.sendMessage(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, userSessionId, - accept, context)) + sendMessage, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Disconnect a userSession. + * Send a message to a user. * * @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 userSessionId The name of the user session within the specified session host. + * @param sendMessage The sendMessage parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -887,8 +850,8 @@ public Mono> disconnectWithResponseAsync(String resourceGroupName * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> disconnectWithResponseAsync(String resourceGroupName, String hostPoolName, - String sessionHostname, String userSessionId, Context context) { + private Mono> sendMessageWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, String userSessionId, SendMessage sendMessage, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -911,15 +874,18 @@ private Mono> disconnectWithResponseAsync(String resourceGroupNam if (userSessionId == null) { return Mono.error(new IllegalArgumentException("Parameter userSessionId is required and cannot be null.")); } + if (sendMessage != null) { + sendMessage.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.disconnect(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, userSessionId, accept, - context); + return service.sendMessage(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, userSessionId, + sendMessage, accept, context); } /** - * Disconnect a userSession. + * Send a message to a user. * * @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. @@ -931,19 +897,21 @@ private Mono> disconnectWithResponseAsync(String resourceGroupNam * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono disconnectAsync(String resourceGroupName, String hostPoolName, String sessionHostname, + public Mono sendMessageAsync(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId) { - return disconnectWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId) - .flatMap(ignored -> Mono.empty()); + final SendMessage sendMessage = null; + return sendMessageWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId, + sendMessage).flatMap(ignored -> Mono.empty()); } /** - * Disconnect a userSession. + * Send a message to a user. * * @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 userSessionId The name of the user session within the specified session host. + * @param sendMessage The sendMessage parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -951,14 +919,14 @@ public Mono disconnectAsync(String resourceGroupName, String hostPoolName, * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response disconnectWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, - String userSessionId, Context context) { - return disconnectWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId, context) - .block(); + public Response sendMessageWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, SendMessage sendMessage, Context context) { + return sendMessageWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId, + sendMessage, context).block(); } /** - * Disconnect a userSession. + * Send a message to a user. * * @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. @@ -969,27 +937,31 @@ public Response disconnectWithResponse(String resourceGroupName, String ho * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void disconnect(String resourceGroupName, String hostPoolName, String sessionHostname, + public void sendMessage(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId) { - disconnectWithResponse(resourceGroupName, hostPoolName, sessionHostname, userSessionId, Context.NONE); + final SendMessage sendMessage = null; + sendMessageWithResponse(resourceGroupName, hostPoolName, sessionHostname, userSessionId, sendMessage, + Context.NONE); } /** - * Send a message to a user. + * A synchronous resource action. * * @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 userSessionId The name of the user session within the specified session host. - * @param sendMessage Object containing message includes title and message body. + * @param filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return list of UserSession definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendMessageWithResponseAsync(String resourceGroupName, String hostPoolName, - String sessionHostname, String userSessionId, SendMessage sendMessage) { + private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, + String hostPoolName, String filter, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1005,41 +977,36 @@ public Mono> sendMessageWithResponseAsync(String resourceGroupNam 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.")); - } - if (userSessionId == null) { - return Mono.error(new IllegalArgumentException("Parameter userSessionId is required and cannot be null.")); - } - if (sendMessage != null) { - sendMessage.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.sendMessage(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, userSessionId, - sendMessage, accept, context)) + .withContext(context -> service.listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, filter, pageSize, isDescending, + initialSkip, 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())); } /** - * Send a message to a user. + * A synchronous resource action. * * @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 userSessionId The name of the user session within the specified session host. - * @param sendMessage Object containing message includes title and message body. + * @param filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return list of UserSession definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> sendMessageWithResponseAsync(String resourceGroupName, String hostPoolName, - String sessionHostname, String userSessionId, SendMessage sendMessage, Context context) { + private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, + String hostPoolName, String filter, Integer pageSize, Boolean isDescending, Integer initialSkip, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1055,81 +1022,118 @@ private Mono> sendMessageWithResponseAsync(String resourceGroupNa 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.")); - } - if (userSessionId == null) { - return Mono.error(new IllegalArgumentException("Parameter userSessionId is required and cannot be null.")); - } - if (sendMessage != null) { - sendMessage.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.sendMessage(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, userSessionId, - sendMessage, accept, context); + return service + .listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, filter, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Send a message to a user. + * A synchronous resource action. * * @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 userSessionId The name of the user session within the specified session host. + * @param filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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. + * @return list of UserSession definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono sendMessageAsync(String resourceGroupName, String hostPoolName, String sessionHostname, - String userSessionId) { - final SendMessage sendMessage = null; - return sendMessageWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId, - sendMessage).flatMap(ignored -> Mono.empty()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip) { + return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, filter, pageSize, + isDescending, initialSkip), nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); } /** - * Send a message to a user. + * A synchronous resource action. * * @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 userSessionId The name of the user session within the specified session host. - * @param sendMessage Object containing message includes title and message body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of UserSession definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName) { + final String filter = null; + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, filter, pageSize, + isDescending, initialSkip), nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); + } + + /** + * A synchronous resource action. + * + * @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 filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return list of UserSession definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendMessageWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, - String userSessionId, SendMessage sendMessage, Context context) { - return sendMessageWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId, - sendMessage, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, + String filter, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, filter, pageSize, + isDescending, initialSkip, context), nextLink -> listByHostPoolNextSinglePageAsync(nextLink, context)); } /** - * Send a message to a user. + * A synchronous resource action. * * @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 userSessionId The name of the user session within the specified session host. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of UserSession definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void sendMessage(String resourceGroupName, String hostPoolName, String sessionHostname, - String userSessionId) { - final SendMessage sendMessage = null; - sendMessageWithResponse(resourceGroupName, hostPoolName, sessionHostname, userSessionId, sendMessage, - Context.NONE); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { + final String filter = null; + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedIterable<>( + listByHostPoolAsync(resourceGroupName, hostPoolName, filter, pageSize, isDescending, initialSkip)); + } + + /** + * A synchronous resource action. + * + * @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 filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of UserSession definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedIterable<>( + listByHostPoolAsync(resourceGroupName, hostPoolName, filter, pageSize, isDescending, initialSkip, context)); } /** @@ -1139,10 +1143,11 @@ public void sendMessage(String resourceGroupName, String hostPoolName, String se * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of UserSession definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1151,8 +1156,7 @@ private Mono> listByHostPoolNextSinglePageAsync( 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)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1166,10 +1170,11 @@ private Mono> listByHostPoolNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of UserSession definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolNextSinglePageAsync(String nextLink, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1179,7 +1184,7 @@ private Mono> listByHostPoolNextSinglePageAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1191,10 +1196,11 @@ private Mono> listByHostPoolNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of UserSession definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listByHostPoolNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1203,7 +1209,8 @@ private Mono> listNextSinglePageAsync(String nex new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + 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())); @@ -1217,10 +1224,11 @@ private Mono> listNextSinglePageAsync(String nex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of UserSession definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listByHostPoolNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1230,7 +1238,7 @@ private Mono> listNextSinglePageAsync(String nex } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, 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/UserSessionsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionsImpl.java index a7e19734e9df..7c24a14bb713 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionsImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionsImpl.java @@ -28,15 +28,16 @@ public UserSessionsImpl(UserSessionsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { - PagedIterable inner = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName); + public PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, hostPoolName, sessionHostname); return ResourceManagerUtils.mapPage(inner, inner1 -> new UserSessionImpl(inner1, this.manager())); } - public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, String filter, + public PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { PagedIterable inner = this.serviceClient() - .listByHostPool(resourceGroupName, hostPoolName, filter, pageSize, isDescending, initialSkip, context); + .list(resourceGroupName, hostPoolName, sessionHostname, pageSize, isDescending, initialSkip, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new UserSessionImpl(inner1, this.manager())); } @@ -73,19 +74,6 @@ public void delete(String resourceGroupName, String hostPoolName, String session this.serviceClient().delete(resourceGroupName, hostPoolName, sessionHostname, userSessionId); } - public PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, hostPoolName, sessionHostname); - return ResourceManagerUtils.mapPage(inner, inner1 -> new UserSessionImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - PagedIterable inner = this.serviceClient() - .list(resourceGroupName, hostPoolName, sessionHostname, pageSize, isDescending, initialSkip, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new UserSessionImpl(inner1, this.manager())); - } - public Response disconnectWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId, Context context) { return this.serviceClient() @@ -109,6 +97,18 @@ public void sendMessage(String resourceGroupName, String hostPoolName, String se this.serviceClient().sendMessage(resourceGroupName, hostPoolName, sessionHostname, userSessionId); } + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { + PagedIterable inner = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UserSessionImpl(inner1, this.manager())); + } + + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient() + .listByHostPool(resourceGroupName, hostPoolName, filter, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UserSessionImpl(inner1, this.manager())); + } + private UserSessionsClient serviceClient() { return this.innerClient; } 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..70231db7f261 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,13 +8,14 @@ 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 com.azure.resourcemanager.desktopvirtualization.models.WorkspacePatchProperties; import java.util.Collections; import java.util.List; import java.util.Map; @@ -49,30 +50,30 @@ public Map tags() { } } - public String managedBy() { - return this.innerModel().managedBy(); - } - - public String kind() { - return this.innerModel().kind(); + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); } public String etag() { return this.innerModel().etag(); } - public ResourceModelWithAllowedPropertySetIdentity identity() { - return this.innerModel().identity(); + public String kind() { + return this.innerModel().kind(); } - public ResourceModelWithAllowedPropertySetSku sku() { - return this.innerModel().sku(); + public String managedBy() { + return this.innerModel().managedBy(); } - public ResourceModelWithAllowedPropertySetPlan plan() { + public Plan plan() { return this.innerModel().plan(); } + public Sku sku() { + return this.innerModel().sku(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -234,8 +235,8 @@ public WorkspaceImpl withTags(Map tags) { } } - public WorkspaceImpl withManagedBy(String managedBy) { - this.innerModel().withManagedBy(managedBy); + public WorkspaceImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); return this; } @@ -244,59 +245,44 @@ public WorkspaceImpl withKind(String kind) { return this; } - public WorkspaceImpl withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { - this.innerModel().withIdentity(identity); + public WorkspaceImpl withManagedBy(String managedBy) { + this.innerModel().withManagedBy(managedBy); return this; } - public WorkspaceImpl withSku(ResourceModelWithAllowedPropertySetSku sku) { - this.innerModel().withSku(sku); + public WorkspaceImpl withPlan(Plan plan) { + this.innerModel().withPlan(plan); return this; } - public WorkspaceImpl withPlan(ResourceModelWithAllowedPropertySetPlan plan) { - this.innerModel().withPlan(plan); + public WorkspaceImpl withSku(Sku sku) { + this.innerModel().withSku(sku); return this; } public WorkspaceImpl withDescription(String description) { - if (isInCreateMode()) { - this.innerModel().withDescription(description); - return this; - } else { - this.updateWorkspace.withDescription(description); - return this; - } + this.innerModel().withDescription(description); + return this; } public WorkspaceImpl withFriendlyName(String friendlyName) { - if (isInCreateMode()) { - this.innerModel().withFriendlyName(friendlyName); - return this; - } else { - this.updateWorkspace.withFriendlyName(friendlyName); - return this; - } + this.innerModel().withFriendlyName(friendlyName); + return this; } public WorkspaceImpl withApplicationGroupReferences(List applicationGroupReferences) { - if (isInCreateMode()) { - this.innerModel().withApplicationGroupReferences(applicationGroupReferences); - return this; - } else { - this.updateWorkspace.withApplicationGroupReferences(applicationGroupReferences); - return this; - } + this.innerModel().withApplicationGroupReferences(applicationGroupReferences); + return this; } public WorkspaceImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { - if (isInCreateMode()) { - this.innerModel().withPublicNetworkAccess(publicNetworkAccess); - return this; - } else { - this.updateWorkspace.withPublicNetworkAccess(publicNetworkAccess); - return this; - } + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + public WorkspaceImpl withProperties(WorkspacePatchProperties properties) { + this.updateWorkspace.withProperties(properties); + return this; } private boolean isInCreateMode() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspacesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspacesClientImpl.java index f123b87de993..57fd655550bc 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspacesClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspacesClientImpl.java @@ -67,6 +67,24 @@ public final class WorkspacesClientImpl implements WorkspacesClient { @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface WorkspacesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/workspaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("pageSize") Integer pageSize, + @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") @ExpectedResponses({ 200 }) @@ -86,15 +104,6 @@ Mono> createOrUpdate(@HostParam("$host") String endpoin @BodyParam("application/json") WorkspaceInner workspace, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") @ExpectedResponses({ 200 }) @@ -106,28 +115,19 @@ Mono> update(@HostParam("$host") String endpoint, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/workspaces") - @ExpectedResponses({ 200 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( + Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); @@ -135,24 +135,134 @@ Mono> listByResourceGroupNext( @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( + Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Get a workspace. + * List workspaces in subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Workspace definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List workspaces in subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Workspace definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List workspaces in subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Workspace definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List workspaces in subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Workspace definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List workspaces in subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Workspace definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List workspaces in subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Workspace definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List workspaces. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a workspace along with {@link Response} on successful completion of {@link Mono}. + * @return list of Workspace definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String workspaceName) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -165,30 +275,32 @@ public Mono> getByResourceGroupWithResponseAsync(String return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, initialSkip, 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 a workspace. + * List workspaces. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a workspace along with {@link Response} on successful completion of {@link Mono}. + * @return list of Workspace definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String workspaceName, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -201,77 +313,124 @@ private Mono> getByResourceGroupWithResponseAsync(Strin return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); + return service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Get a workspace. + * List workspaces. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a workspace on successful completion of {@link Mono}. + * @return list of Workspace definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String workspaceName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, workspaceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Get a workspace. + * List workspaces. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Workspace definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List workspaces. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a workspace along with {@link Response}. + * @return list of Workspace definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, - Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, workspaceName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Get a workspace. + * List workspaces. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a workspace. + * @return list of Workspace definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceInner getByResourceGroup(String resourceGroupName, String workspaceName) { - return getByResourceGroupWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, pageSize, isDescending, initialSkip)); } /** - * Create or update a workspace. + * List workspaces. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Workspace definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + return new PagedIterable<>( + listByResourceGroupAsync(resourceGroupName, pageSize, isDescending, initialSkip, context)); + } + + /** + * Get a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param workspace Object containing Workspace 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 Workspace definition along with {@link Response} on successful completion of {@link Mono}. + * @return a workspace along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, WorkspaceInner workspace) { + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String workspaceName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -287,33 +446,27 @@ public Mono> createOrUpdateWithResponseAsync(String res if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - if (workspace == null) { - return Mono.error(new IllegalArgumentException("Parameter workspace is required and cannot be null.")); - } else { - workspace.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspace, accept, context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update a workspace. + * Get a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param workspace Object containing Workspace 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 Workspace definition along with {@link Response} on successful completion of {@link Mono}. + * @return a workspace along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, WorkspaceInner workspace, Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String workspaceName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -329,81 +482,74 @@ private Mono> createOrUpdateWithResponseAsync(String re if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - if (workspace == null) { - return Mono.error(new IllegalArgumentException("Parameter workspace is required and cannot be null.")); - } else { - workspace.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspace, accept, context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); } /** - * Create or update a workspace. + * Get a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param workspace Object containing Workspace 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 Workspace definition on successful completion of {@link Mono}. + * @return a workspace on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, - WorkspaceInner workspace) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, workspace) + public Mono getByResourceGroupAsync(String resourceGroupName, String workspaceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, workspaceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Create or update a workspace. + * Get a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param workspace Object containing Workspace 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 Workspace definition along with {@link Response}. + * @return a workspace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, - WorkspaceInner workspace, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, workspace, context).block(); + public Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, workspaceName, context).block(); } /** - * Create or update a workspace. + * Get a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param workspace Object containing Workspace 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 Workspace definition. + * @return a workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner workspace) { - return createOrUpdateWithResponse(resourceGroupName, workspaceName, workspace, Context.NONE).getValue(); + public WorkspaceInner getByResourceGroup(String resourceGroupName, String workspaceName) { + return getByResourceGroupWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); } /** - * Remove a workspace. + * Create or update a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. + * @param workspace Object containing Workspace 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 Response} on successful completion of {@link Mono}. + * @return represents a Workspace definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName) { + public Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, WorkspaceInner workspace) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -419,27 +565,33 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } + if (workspace == null) { + return Mono.error(new IllegalArgumentException("Parameter workspace is required and cannot be null.")); + } else { + workspace.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspace, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Remove a workspace. + * Create or update a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. + * @param workspace Object containing Workspace 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 Response} on successful completion of {@link Mono}. + * @return represents a Workspace definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, WorkspaceInner workspace, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -455,55 +607,67 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } + if (workspace == null) { + return Mono.error(new IllegalArgumentException("Parameter workspace is required and cannot be null.")); + } else { + workspace.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspace, accept, context); } /** - * Remove a workspace. + * Create or update a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. + * @param workspace Object containing Workspace 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 A {@link Mono} that completes when a successful response is received. + * @return represents a Workspace definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String workspaceName) { - return deleteWithResponseAsync(resourceGroupName, workspaceName).flatMap(ignored -> Mono.empty()); + public Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + WorkspaceInner workspace) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, workspace) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove a workspace. + * Create or update a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. + * @param workspace Object containing Workspace 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 Response}. + * @return represents a Workspace definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String workspaceName, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, context).block(); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + WorkspaceInner workspace, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, workspace, context).block(); } /** - * Remove a workspace. + * Create or update a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. + * @param workspace Object containing Workspace 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 Workspace definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName) { - deleteWithResponse(resourceGroupName, workspaceName, Context.NONE); + public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner workspace) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, workspace, Context.NONE).getValue(); } /** @@ -511,7 +675,7 @@ public void delete(String resourceGroupName, String workspaceName) { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param workspace Object containing Workspace definitions. + * @param workspace The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -550,7 +714,7 @@ public Mono> updateWithResponseAsync(String resourceGro * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param workspace Object containing Workspace definitions. + * @param workspace The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -606,7 +770,7 @@ public Mono updateAsync(String resourceGroupName, String workspa * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param workspace Object containing Workspace definitions. + * @param workspace The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -636,20 +800,17 @@ public WorkspaceInner update(String resourceGroupName, String workspaceName) { } /** - * List workspaces. + * Remove a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Integer pageSize, Boolean isDescending, Integer initialSkip) { + public Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -662,32 +823,30 @@ private Mono> listByResourceGroupSinglePageAsync(S return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, initialSkip, accept, - context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List workspaces. + * Remove a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -700,217 +859,58 @@ private Mono> listByResourceGroupSinglePageAsync(S return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, initialSkip, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List workspaces. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List workspaces. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List workspaces. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context); } /** - * List workspaces. + * Remove a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList as paginated response with {@link PagedIterable}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, pageSize, isDescending, initialSkip)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String workspaceName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName).flatMap(ignored -> Mono.empty()); } /** - * List workspaces. + * Remove a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context) { - return new PagedIterable<>( - listByResourceGroupAsync(resourceGroupName, pageSize, isDescending, initialSkip, context)); - } - - /** - * List workspaces in subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, context).block(); } /** - * List workspaces in subscription. + * Remove a workspace. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List workspaces in subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * List workspaces in subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * List workspaces in subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List workspaces in subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + public void delete(String resourceGroupName, String workspaceName) { + deleteWithResponse(resourceGroupName, workspaceName, Context.NONE); } /** @@ -920,10 +920,10 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of Workspace definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -934,7 +934,7 @@ private Mono> listByResourceGroupNextSinglePageAsy final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -948,10 +948,10 @@ private Mono> listByResourceGroupNextSinglePageAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of Workspace definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -962,7 +962,7 @@ private Mono> listByResourceGroupNextSinglePageAsy } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -974,10 +974,10 @@ private Mono> listByResourceGroupNextSinglePageAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of Workspace definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -988,7 +988,7 @@ private Mono> listBySubscriptionNextSinglePageAsyn final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1002,10 +1002,10 @@ private Mono> listBySubscriptionNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of Workspace definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1016,7 +1016,7 @@ private Mono> listBySubscriptionNextSinglePageAsyn } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspacesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspacesImpl.java index 526ce4c893cd..cf7e9acf6151 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspacesImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspacesImpl.java @@ -27,6 +27,28 @@ public WorkspacesImpl(WorkspacesClient innerClient, this.serviceManager = serviceManager; } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + } + public Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, Context context) { Response inner @@ -57,28 +79,6 @@ public void deleteByResourceGroup(String resourceGroupName, String workspaceName this.serviceClient().delete(resourceGroupName, workspaceName); } - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, pageSize, isDescending, initialSkip, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); - } - public Workspace getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/package-info.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/package-info.java index fcc669a8bf54..fac0360848a4 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/package-info.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/package-info.java @@ -4,6 +4,6 @@ /** * Package containing the implementations for DesktopVirtualizationApiClient. - * null. + * This Typespec represents the Desktop Virtualization API interfaces. */ package com.azure.resourcemanager.desktopvirtualization.implementation; 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..4c3941ecc4d6 --- /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 the 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..9968c0575bbc --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveSessionHostConfigurationList.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.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.fluent.models.ActiveSessionHostConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * List of ActiveSessionHostConfiguration definitions. + */ +@Fluent +public final class ActiveSessionHostConfigurationList implements JsonSerializable { + /* + * The ActiveSessionHostConfiguration items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ActiveSessionHostConfigurationList class. + */ + public ActiveSessionHostConfigurationList() { + } + + /** + * Get the value property: The ActiveSessionHostConfiguration items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The ActiveSessionHostConfiguration items on this page. + * + * @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: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ActiveSessionHostConfigurationList object itself. + */ + public ActiveSessionHostConfigurationList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ActiveSessionHostConfigurationList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ActiveSessionHostConfigurationList.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of 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 IllegalStateException If the deserialized JSON object was missing any required properties. + * @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..cf88c82db59e --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveSessionHostConfigurations.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ActiveSessionHostConfigurations. + */ +public interface ActiveSessionHostConfigurations { + /** + * Operation to list the ActiveSessionHostConfigurations associated with the 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 list of ActiveSessionHostConfiguration definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); + + /** + * Operation to list the ActiveSessionHostConfigurations associated with the 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 list of ActiveSessionHostConfiguration definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Context context); + + /** + * Get a ActiveSessionHostConfiguration. + * + * @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 ActiveSessionHostConfiguration along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context); + + /** + * Get a ActiveSessionHostConfiguration. + * + * @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 ActiveSessionHostConfiguration. + */ + ActiveSessionHostConfiguration get(String resourceGroupName, String hostPoolName); +} 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..3f483506b072 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 @@ -8,6 +8,7 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.AppAttachPackageInner; +import java.util.List; import java.util.Map; /** @@ -50,18 +51,70 @@ public interface AppAttachPackage { Map tags(); /** - * Gets the properties property: Detailed properties for App Attach Package. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the properties value. + * @return the systemData value. */ - AppAttachPackageProperties properties(); + SystemData systemData(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the provisioningState property: The provisioning state of the App Attach Package. * - * @return the systemData value. + * @return the provisioningState value. */ - SystemData systemData(); + ProvisioningState provisioningState(); + + /** + * Gets the image property: Detailed properties for App Attach Package. + * + * @return the image value. + */ + AppAttachPackageInfoProperties image(); + + /** + * Gets the hostPoolReferences property: List of Hostpool resource Ids. + * + * @return the hostPoolReferences value. + */ + List hostPoolReferences(); + + /** + * Gets the keyVaultUrl property: URL path to certificate name located in keyVault. + * + * @return the keyVaultUrl value. + */ + String keyVaultUrl(); + + /** + * Gets the failHealthCheckOnStagingFailure property: Parameter indicating how the health check should behave if + * this package fails staging. + * + * @return the failHealthCheckOnStagingFailure value. + */ + FailHealthCheckOnStagingFailure failHealthCheckOnStagingFailure(); + + /** + * Gets the packageOwnerName property: Specific name of package owner, is "AppAttach" for native app attach + * packages. + * + * @return the packageOwnerName value. + */ + String packageOwnerName(); + + /** + * Gets the packageLookbackUrl property: Lookback url to third party control plane, is null for native app attach + * packages. + * + * @return the packageLookbackUrl value. + */ + String packageLookbackUrl(); + + /** + * Gets the customData property: Field that can be populated with custom data and filtered on in list GET calls. + * + * @return the customData value. + */ + String customData(); /** * Gets the region of the resource. @@ -95,7 +148,7 @@ public interface AppAttachPackage { * The entirety of the AppAttachPackage definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } /** @@ -139,27 +192,17 @@ interface WithResourceGroup { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ - WithProperties withExistingResourceGroup(String resourceGroupName); - } - - /** - * The stage of the AppAttachPackage definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Detailed properties for App Attach Package. - * - * @param properties Detailed properties for App Attach Package. - * @return the next definition stage. - */ - WithCreate withProperties(AppAttachPackageProperties properties); + WithCreate withExistingResourceGroup(String resourceGroupName); } /** * The stage of the AppAttachPackage definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithTags { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithImage, + DefinitionStages.WithHostPoolReferences, DefinitionStages.WithKeyVaultUrl, + DefinitionStages.WithFailHealthCheckOnStagingFailure, DefinitionStages.WithPackageOwnerName, + DefinitionStages.WithPackageLookbackUrl, DefinitionStages.WithCustomData { /** * Executes the create request. * @@ -188,6 +231,104 @@ interface WithTags { */ WithCreate withTags(Map tags); } + + /** + * The stage of the AppAttachPackage definition allowing to specify image. + */ + interface WithImage { + /** + * Specifies the image property: Detailed properties for App Attach Package. + * + * @param image Detailed properties for App Attach Package. + * @return the next definition stage. + */ + WithCreate withImage(AppAttachPackageInfoProperties image); + } + + /** + * The stage of the AppAttachPackage definition allowing to specify hostPoolReferences. + */ + interface WithHostPoolReferences { + /** + * Specifies the hostPoolReferences property: List of Hostpool resource Ids.. + * + * @param hostPoolReferences List of Hostpool resource Ids. + * @return the next definition stage. + */ + WithCreate withHostPoolReferences(List hostPoolReferences); + } + + /** + * The stage of the AppAttachPackage definition allowing to specify keyVaultUrl. + */ + interface WithKeyVaultUrl { + /** + * Specifies the keyVaultUrl property: URL path to certificate name located in keyVault. + * + * @param keyVaultUrl URL path to certificate name located in keyVault. + * @return the next definition stage. + */ + WithCreate withKeyVaultUrl(String keyVaultUrl); + } + + /** + * The stage of the AppAttachPackage definition allowing to specify failHealthCheckOnStagingFailure. + */ + interface WithFailHealthCheckOnStagingFailure { + /** + * Specifies the failHealthCheckOnStagingFailure property: Parameter indicating how the health check should + * behave if this package fails staging. + * + * @param failHealthCheckOnStagingFailure Parameter indicating how the health check should behave if this + * package fails staging. + * @return the next definition stage. + */ + WithCreate + withFailHealthCheckOnStagingFailure(FailHealthCheckOnStagingFailure failHealthCheckOnStagingFailure); + } + + /** + * The stage of the AppAttachPackage definition allowing to specify packageOwnerName. + */ + interface WithPackageOwnerName { + /** + * Specifies the packageOwnerName property: Specific name of package owner, is "AppAttach" for native app + * attach packages. + * + * @param packageOwnerName Specific name of package owner, is "AppAttach" for native app attach packages. + * @return the next definition stage. + */ + WithCreate withPackageOwnerName(String packageOwnerName); + } + + /** + * The stage of the AppAttachPackage definition allowing to specify packageLookbackUrl. + */ + interface WithPackageLookbackUrl { + /** + * Specifies the packageLookbackUrl property: Lookback url to third party control plane, is null for native + * app attach packages. + * + * @param packageLookbackUrl Lookback url to third party control plane, is null for native app attach + * packages. + * @return the next definition stage. + */ + WithCreate withPackageLookbackUrl(String packageLookbackUrl); + } + + /** + * The stage of the AppAttachPackage definition allowing to specify customData. + */ + interface WithCustomData { + /** + * Specifies the customData property: Field that can be populated with custom data and filtered on in list + * GET calls. + * + * @param customData Field that can be populated with custom data and filtered on in list GET calls. + * @return the next definition stage. + */ + WithCreate withCustomData(String customData); + } } /** @@ -200,7 +341,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 +362,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/AppAttachPackageInfoes.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageInfoes.java index 2a9a9318daed..4b0d9d197269 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageInfoes.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageInfoes.java @@ -16,7 +16,7 @@ public interface AppAttachPackageInfoes { * * @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 importPackageInfoRequest Object containing URI to package image and other optional properties. + * @param importPackageInfoRequest The importPackageInfoRequest parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -31,7 +31,7 @@ PagedIterable importMethod(String resourceGroupName, String ho * * @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 importPackageInfoRequest Object containing URI to package image and other optional properties. + * @param importPackageInfoRequest The importPackageInfoRequest parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageList.java index 208512a65b36..90ffc9f55b6b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageList.java @@ -5,6 +5,7 @@ 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; @@ -14,19 +15,17 @@ import java.util.List; /** - * AppAttachPackageList - * * List of App Attach Package definitions. */ @Fluent public final class AppAttachPackageList implements JsonSerializable { /* - * List of App Attach Package definitions. + * The AppAttachPackage items on this page */ private List value; /* - * Link to the next page of results. + * The link to the next page of items */ private String nextLink; @@ -37,7 +36,7 @@ public AppAttachPackageList() { } /** - * Get the value property: List of App Attach Package definitions. + * Get the value property: The AppAttachPackage items on this page. * * @return the value value. */ @@ -46,7 +45,7 @@ public List value() { } /** - * Set the value property: List of App Attach Package definitions. + * Set the value property: The AppAttachPackage items on this page. * * @param value the value value to set. * @return the AppAttachPackageList object itself. @@ -57,7 +56,7 @@ public AppAttachPackageList withValue(List value) { } /** - * Get the nextLink property: Link to the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,17 +64,33 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AppAttachPackageList object itself. + */ + public AppAttachPackageList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model AppAttachPackageList")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(AppAttachPackageList.class); + /** * {@inheritDoc} */ @@ -83,6 +98,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -92,6 +108,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of AppAttachPackageList 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 AppAttachPackageList. */ public static AppAttachPackageList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackagePatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackagePatch.java index 3ea0a89f04ed..d6ea574c7286 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackagePatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackagePatch.java @@ -11,12 +11,18 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.Map; /** * Schema for updatable App Attach Package properties. */ @Fluent public final class AppAttachPackagePatch extends ProxyResource { + /* + * tags to be updated + */ + private Map 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..626e84fe06ac 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 @@ -37,6 +37,16 @@ public final class AppAttachPackagePatchProperties implements JsonSerializable getByResourceGroupWithResponse(String resourceGroupName, String appAttachPackageName, - Context context); + PagedIterable list(); /** - * Get an app attach package. + * List App Attach packages in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and 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 an app attach package. + * @return list of App Attach Package definitions as paginated response with {@link PagedIterable}. */ - AppAttachPackage getByResourceGroup(String resourceGroupName, String appAttachPackageName); + PagedIterable list(String filter, Context context); /** - * Remove an App Attach Package. + * List App Attach packages in resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the 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}. + * @return list of App Attach Package definitions as paginated response with {@link PagedIterable}. */ - Response deleteByResourceGroupWithResponse(String resourceGroupName, String appAttachPackageName, - Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Remove an App Attach Package. + * List App Attach packages in resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appAttachPackageName The name of the App Attach package. + * @param filter OData filter expression. Valid properties for filtering are package name and 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 list of App Attach Package definitions as paginated response with {@link PagedIterable}. */ - void deleteByResourceGroup(String resourceGroupName, String appAttachPackageName); + PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context); /** - * List App Attach packages in resource group. + * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList as paginated response with {@link PagedIterable}. + * @return an app attach package along with {@link Response}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + Response getByResourceGroupWithResponse(String resourceGroupName, String appAttachPackageName, + Context context); /** - * List App Attach packages in resource group. + * Get an app attach package. * * @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 context The context to associate with this operation. + * @param appAttachPackageName The name of the 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 appAttachPackageList as paginated response with {@link PagedIterable}. + * @return an app attach package. */ - PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context); + AppAttachPackage getByResourceGroup(String resourceGroupName, String appAttachPackageName); /** - * List App Attach packages in subscription. + * 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 force Allows force delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return appAttachPackageList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - PagedIterable list(); + Response deleteWithResponse(String resourceGroupName, String appAttachPackageName, Boolean force, + Context context); /** - * List App Attach packages in subscription. + * Remove an App Attach Package. * - * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and resource - * group. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the 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 appAttachPackageList as paginated response with {@link PagedIterable}. */ - PagedIterable list(String filter, Context context); + void delete(String resourceGroupName, String appAttachPackageName); /** * Get an app attach package. @@ -146,13 +147,14 @@ Response deleteByResourceGroupWithResponse(String resourceGroupName, Strin * Remove an App Attach Package. * * @param id the resource ID. + * @param force Allows force delete. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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/Application.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Application.java index d1b8b553ffe9..92398317731c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Application.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Application.java @@ -7,7 +7,6 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationInner; -import java.util.Map; /** * An immutable client-side representation of Application. @@ -371,11 +370,7 @@ interface WithIconIndex { /** * The template for Application update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithDescription, UpdateStages.WithFriendlyName, - UpdateStages.WithFilePath, UpdateStages.WithCommandLineSetting, UpdateStages.WithCommandLineArguments, - UpdateStages.WithShowInPortal, UpdateStages.WithIconPath, UpdateStages.WithIconIndex, - UpdateStages.WithMsixPackageFamilyName, UpdateStages.WithMsixPackageApplicationId, - UpdateStages.WithApplicationType { + interface Update extends UpdateStages.WithProperties { /** * Executes the update request. * @@ -397,165 +392,16 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithDescription, Up */ interface UpdateStages { /** - * The stage of the Application update allowing to specify tags. + * The stage of the Application update allowing to specify properties. */ - interface WithTags { + interface WithProperties { /** - * Specifies the tags property: tags to be updated. + * Specifies the properties property: Detailed properties for Application. * - * @param tags tags to be updated. + * @param properties Detailed properties for Application. * @return the next definition stage. */ - Update withTags(Map tags); - } - - /** - * The stage of the Application update allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: Description of Application.. - * - * @param description Description of Application. - * @return the next definition stage. - */ - Update withDescription(String description); - } - - /** - * The stage of the Application update allowing to specify friendlyName. - */ - interface WithFriendlyName { - /** - * Specifies the friendlyName property: Friendly name of Application.. - * - * @param friendlyName Friendly name of Application. - * @return the next definition stage. - */ - Update withFriendlyName(String friendlyName); - } - - /** - * The stage of the Application update allowing to specify filePath. - */ - interface WithFilePath { - /** - * Specifies the filePath property: Specifies a path for the executable file for the application.. - * - * @param filePath Specifies a path for the executable file for the application. - * @return the next definition stage. - */ - Update withFilePath(String filePath); - } - - /** - * The stage of the Application update allowing to specify commandLineSetting. - */ - interface WithCommandLineSetting { - /** - * Specifies the commandLineSetting property: Specifies whether this published application can be launched - * with command line arguments provided by the client, command line arguments specified at publish time, or - * no command line arguments at all.. - * - * @param commandLineSetting Specifies whether this published application can be launched with command line - * arguments provided by the client, command line arguments specified at publish time, or no command line - * arguments at all. - * @return the next definition stage. - */ - Update withCommandLineSetting(CommandLineSetting commandLineSetting); - } - - /** - * The stage of the Application update allowing to specify commandLineArguments. - */ - interface WithCommandLineArguments { - /** - * Specifies the commandLineArguments property: Command Line Arguments for Application.. - * - * @param commandLineArguments Command Line Arguments for Application. - * @return the next definition stage. - */ - Update withCommandLineArguments(String commandLineArguments); - } - - /** - * The stage of the Application update allowing to specify showInPortal. - */ - interface WithShowInPortal { - /** - * Specifies the showInPortal property: Specifies whether to show the RemoteApp program in the RD Web Access - * server.. - * - * @param showInPortal Specifies whether to show the RemoteApp program in the RD Web Access server. - * @return the next definition stage. - */ - Update withShowInPortal(Boolean showInPortal); - } - - /** - * The stage of the Application update allowing to specify iconPath. - */ - interface WithIconPath { - /** - * Specifies the iconPath property: Path to icon.. - * - * @param iconPath Path to icon. - * @return the next definition stage. - */ - Update withIconPath(String iconPath); - } - - /** - * The stage of the Application update allowing to specify iconIndex. - */ - interface WithIconIndex { - /** - * Specifies the iconIndex property: Index of the icon.. - * - * @param iconIndex Index of the icon. - * @return the next definition stage. - */ - Update withIconIndex(Integer iconIndex); - } - - /** - * The stage of the Application update allowing to specify msixPackageFamilyName. - */ - interface WithMsixPackageFamilyName { - /** - * Specifies the msixPackageFamilyName property: Specifies the package family name for MSIX applications. - * - * @param msixPackageFamilyName Specifies the package family name for MSIX applications. - * @return the next definition stage. - */ - Update withMsixPackageFamilyName(String msixPackageFamilyName); - } - - /** - * The stage of the Application update allowing to specify msixPackageApplicationId. - */ - interface WithMsixPackageApplicationId { - /** - * Specifies the msixPackageApplicationId property: Specifies the package application Id for MSIX - * applications. - * - * @param msixPackageApplicationId Specifies the package application Id for MSIX applications. - * @return the next definition stage. - */ - Update withMsixPackageApplicationId(String msixPackageApplicationId); - } - - /** - * The stage of the Application update allowing to specify applicationType. - */ - interface WithApplicationType { - /** - * Specifies the applicationType property: Resource Type of Application.. - * - * @param applicationType Resource Type of Application. - * @return the next definition stage. - */ - Update withApplicationType(RemoteApplicationType applicationType); + Update withProperties(ApplicationPatchProperties properties); } } 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..e33aa750593e 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 @@ -50,17 +50,25 @@ public interface ApplicationGroup { Map tags(); /** - * Gets the managedBy property: The fully qualified resource ID of the resource that manages this resource. - * Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment - * will not delete the resource if it is removed from the template since it is managed by another resource. + * Gets the identity property: The managed service identities assigned to this resource. * - * @return the managedBy value. + * @return the identity value. */ - String managedBy(); + ManagedServiceIdentity identity(); + + /** + * Gets the etag property: If etag is provided in the response body, it may also be provided as a header per the + * normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. + * HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), + * and If-Range (section 14.27) header fields. + * + * @return the etag value. + */ + String etag(); /** * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of - * the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must * validate and persist this value. * * @return the kind value. @@ -68,35 +76,27 @@ public interface ApplicationGroup { String kind(); /** - * Gets the etag property: The etag field is *not* required. If it is provided in the response body, it must also be - * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from - * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), - * If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + * Gets the managedBy property: The fully qualified resource ID of the resource that manages this resource. + * Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment + * will not delete the resource if it is removed from the template since it is managed by another resource. * - * @return the etag value. + * @return the managedBy value. */ - String etag(); + String managedBy(); /** - * Gets the identity property: The identity property. + * Gets the plan property: Details of the resource plan. * - * @return the identity value. + * @return the plan value. */ - ResourceModelWithAllowedPropertySetIdentity identity(); + Plan plan(); /** - * Gets the sku property: The sku property. + * Gets the sku property: The SKU (Stock Keeping Unit) assigned to this resource. * * @return the sku value. */ - ResourceModelWithAllowedPropertySetSku sku(); - - /** - * Gets the plan property: The plan property. - * - * @return the plan value. - */ - ResourceModelWithAllowedPropertySetPlan plan(); + Sku sku(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -272,8 +272,8 @@ interface WithApplicationGroupType { * resource to be created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithTags, DefinitionStages.WithManagedBy, DefinitionStages.WithKind, - DefinitionStages.WithIdentity, DefinitionStages.WithSku, DefinitionStages.WithPlan, + extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithKind, + DefinitionStages.WithManagedBy, DefinitionStages.WithPlan, DefinitionStages.WithSku, DefinitionStages.WithDescription, DefinitionStages.WithFriendlyName, DefinitionStages.WithShowInFeed { /** * Executes the create request. @@ -305,21 +305,16 @@ interface WithTags { } /** - * The stage of the ApplicationGroup definition allowing to specify managedBy. + * The stage of the ApplicationGroup definition allowing to specify identity. */ - interface WithManagedBy { + interface WithIdentity { /** - * Specifies the managedBy property: The fully qualified resource ID of the resource that manages this - * resource. Indicates if this resource is managed by another Azure resource. If this is present, complete - * mode deployment will not delete the resource if it is removed from the template since it is managed by - * another resource.. + * Specifies the identity property: The managed service identities assigned to this resource.. * - * @param managedBy The fully qualified resource ID of the resource that manages this resource. Indicates if - * this resource is managed by another Azure resource. If this is present, complete mode deployment will not - * delete the resource if it is removed from the template since it is managed by another resource. + * @param identity The managed service identities assigned to this resource. * @return the next definition stage. */ - WithCreate withManagedBy(String managedBy); + WithCreate withIdentity(ManagedServiceIdentity identity); } /** @@ -328,11 +323,11 @@ interface WithManagedBy { interface WithKind { /** * Specifies the kind property: Metadata used by portal/tooling/etc to render different UX experiences for - * resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the + * resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the * resource provider must validate and persist this value.. * * @param kind Metadata used by portal/tooling/etc to render different UX experiences for resources of the - * same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must * validate and persist this value. * @return the next definition stage. */ @@ -340,42 +335,47 @@ interface WithKind { } /** - * The stage of the ApplicationGroup definition allowing to specify identity. + * The stage of the ApplicationGroup definition allowing to specify managedBy. */ - interface WithIdentity { + interface WithManagedBy { /** - * Specifies the identity property: The identity property.. + * Specifies the managedBy property: The fully qualified resource ID of the resource that manages this + * resource. Indicates if this resource is managed by another Azure resource. If this is present, complete + * mode deployment will not delete the resource if it is removed from the template since it is managed by + * another resource.. * - * @param identity The identity property. + * @param managedBy The fully qualified resource ID of the resource that manages this resource. Indicates if + * this resource is managed by another Azure resource. If this is present, complete mode deployment will not + * delete the resource if it is removed from the template since it is managed by another resource. * @return the next definition stage. */ - WithCreate withIdentity(ResourceModelWithAllowedPropertySetIdentity identity); + WithCreate withManagedBy(String managedBy); } /** - * The stage of the ApplicationGroup definition allowing to specify sku. + * The stage of the ApplicationGroup definition allowing to specify plan. */ - interface WithSku { + interface WithPlan { /** - * Specifies the sku property: The sku property.. + * Specifies the plan property: Details of the resource plan.. * - * @param sku The sku property. + * @param plan Details of the resource plan. * @return the next definition stage. */ - WithCreate withSku(ResourceModelWithAllowedPropertySetSku sku); + WithCreate withPlan(Plan plan); } /** - * The stage of the ApplicationGroup definition allowing to specify plan. + * The stage of the ApplicationGroup definition allowing to specify sku. */ - interface WithPlan { + interface WithSku { /** - * Specifies the plan property: The plan property.. + * Specifies the sku property: The SKU (Stock Keeping Unit) assigned to this resource.. * - * @param plan The plan property. + * @param sku The SKU (Stock Keeping Unit) assigned to this resource. * @return the next definition stage. */ - WithCreate withPlan(ResourceModelWithAllowedPropertySetPlan plan); + WithCreate withSku(Sku sku); } /** @@ -429,8 +429,7 @@ interface WithShowInFeed { /** * The template for ApplicationGroup update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithDescription, UpdateStages.WithFriendlyName, - UpdateStages.WithShowInFeed { + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { /** * Executes the update request. * @@ -465,43 +464,16 @@ interface WithTags { } /** - * The stage of the ApplicationGroup update allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: Description of ApplicationGroup.. - * - * @param description Description of ApplicationGroup. - * @return the next definition stage. - */ - Update withDescription(String description); - } - - /** - * The stage of the ApplicationGroup update allowing to specify friendlyName. + * The stage of the ApplicationGroup update allowing to specify properties. */ - interface WithFriendlyName { + interface WithProperties { /** - * Specifies the friendlyName property: Friendly name of ApplicationGroup.. + * Specifies the properties property: ApplicationGroup properties that can be patched.. * - * @param friendlyName Friendly name of ApplicationGroup. - * @return the next definition stage. - */ - Update withFriendlyName(String friendlyName); - } - - /** - * The stage of the ApplicationGroup update allowing to specify showInFeed. - */ - interface WithShowInFeed { - /** - * Specifies the showInFeed property: Boolean representing whether the applicationGroup is show in the - * feed.. - * - * @param showInFeed Boolean representing whether the applicationGroup is show in the feed. + * @param properties ApplicationGroup properties that can be patched. * @return the next definition stage. */ - Update withShowInFeed(Boolean showInFeed); + Update withProperties(ApplicationGroupPatchProperties properties); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupList.java index d4b7297c2a71..81bfa59879a4 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupList.java @@ -5,6 +5,7 @@ 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; @@ -14,19 +15,17 @@ import java.util.List; /** - * ApplicationGroupList - * * List of ApplicationGroup definitions. */ @Fluent public final class ApplicationGroupList implements JsonSerializable { /* - * List of ApplicationGroup definitions. + * The ApplicationGroup items on this page */ private List value; /* - * Link to the next page of results. + * The link to the next page of items */ private String nextLink; @@ -37,7 +36,7 @@ public ApplicationGroupList() { } /** - * Get the value property: List of ApplicationGroup definitions. + * Get the value property: The ApplicationGroup items on this page. * * @return the value value. */ @@ -46,7 +45,7 @@ public List value() { } /** - * Set the value property: List of ApplicationGroup definitions. + * Set the value property: The ApplicationGroup items on this page. * * @param value the value value to set. * @return the ApplicationGroupList object itself. @@ -57,7 +56,7 @@ public ApplicationGroupList withValue(List value) { } /** - * Get the nextLink property: Link to the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,17 +64,33 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ApplicationGroupList object itself. + */ + public ApplicationGroupList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ApplicationGroupList")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(ApplicationGroupList.class); + /** * {@inheritDoc} */ @@ -83,6 +98,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -92,6 +108,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ApplicationGroupList 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 ApplicationGroupList. */ public static ApplicationGroupList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupPatch.java index 77ebddb82534..b27bf3e9a3d2 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupPatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupPatch.java @@ -10,7 +10,6 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationGroupPatchProperties; import java.io.IOException; import java.util.Map; @@ -27,7 +26,7 @@ public final class ApplicationGroupPatch extends ProxyResource { /* * ApplicationGroup properties that can be patched. */ - private ApplicationGroupPatchProperties innerProperties; + private ApplicationGroupPatchProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -76,12 +75,23 @@ public ApplicationGroupPatch withTags(Map tags) { } /** - * Get the innerProperties property: ApplicationGroup properties that can be patched. + * Get the properties property: ApplicationGroup properties that can be patched. * - * @return the innerProperties value. + * @return the properties value. */ - private ApplicationGroupPatchProperties innerProperties() { - return this.innerProperties; + public ApplicationGroupPatchProperties properties() { + return this.properties; + } + + /** + * Set the properties property: ApplicationGroup properties that can be patched. + * + * @param properties the properties value to set. + * @return the ApplicationGroupPatch object itself. + */ + public ApplicationGroupPatch withProperties(ApplicationGroupPatchProperties properties) { + this.properties = properties; + return this; } /** @@ -123,83 +133,14 @@ public String id() { return this.id; } - /** - * Get the description property: Description of ApplicationGroup. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Description of ApplicationGroup. - * - * @param description the description value to set. - * @return the ApplicationGroupPatch object itself. - */ - public ApplicationGroupPatch withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGroupPatchProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the friendlyName property: Friendly name of ApplicationGroup. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); - } - - /** - * Set the friendlyName property: Friendly name of ApplicationGroup. - * - * @param friendlyName the friendlyName value to set. - * @return the ApplicationGroupPatch object itself. - */ - public ApplicationGroupPatch withFriendlyName(String friendlyName) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGroupPatchProperties(); - } - this.innerProperties().withFriendlyName(friendlyName); - return this; - } - - /** - * Get the showInFeed property: Boolean representing whether the applicationGroup is show in the feed. - * - * @return the showInFeed value. - */ - public Boolean showInFeed() { - return this.innerProperties() == null ? null : this.innerProperties().showInFeed(); - } - - /** - * Set the showInFeed property: Boolean representing whether the applicationGroup is show in the feed. - * - * @param showInFeed the showInFeed value to set. - * @return the ApplicationGroupPatch object itself. - */ - public ApplicationGroupPatch withShowInFeed(Boolean showInFeed) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGroupPatchProperties(); - } - this.innerProperties().withShowInFeed(showInFeed); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -210,7 +151,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -240,8 +181,7 @@ public static ApplicationGroupPatch fromJson(JsonReader jsonReader) throws IOExc Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedApplicationGroupPatch.tags = tags; } else if ("properties".equals(fieldName)) { - deserializedApplicationGroupPatch.innerProperties - = ApplicationGroupPatchProperties.fromJson(reader); + deserializedApplicationGroupPatch.properties = ApplicationGroupPatchProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedApplicationGroupPatch.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupPatchProperties.java similarity index 98% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupPatchProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupPatchProperties.java index 1fe5dfd70fef..2121ddbc4b66 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupPatchProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupPatchProperties.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.desktopvirtualization.fluent.models; +package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroups.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroups.java index 60a00401b56e..d6b44ad65832 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroups.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroups.java @@ -13,104 +13,104 @@ */ public interface ApplicationGroups { /** - * Get an application group. + * List applicationGroups in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application 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 an application group along with {@link Response}. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String applicationGroupName, - Context context); + PagedIterable list(); /** - * Get an application group. + * List applicationGroups in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application group. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. */ - ApplicationGroup getByResourceGroup(String resourceGroupName, String applicationGroupName); + PagedIterable list(String filter, Context context); /** - * Remove an applicationGroup. + * List applicationGroups. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application 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 {@link Response}. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. */ - Response deleteByResourceGroupWithResponse(String resourceGroupName, String applicationGroupName, - Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Remove an applicationGroup. + * List applicationGroups. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationGroupName The name of the application group. + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. */ - void deleteByResourceGroup(String resourceGroupName, String applicationGroupName); + PagedIterable listByResourceGroup(String resourceGroupName, String filter, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** - * List applicationGroups. + * Get an application group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 applicationGroupList as paginated response with {@link PagedIterable}. + * @return an application group along with {@link Response}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + Response getByResourceGroupWithResponse(String resourceGroupName, String applicationGroupName, + Context context); /** - * List applicationGroups. + * Get an application group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param applicationGroupName The name of the application 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 applicationGroupList as paginated response with {@link PagedIterable}. + * @return an application group. */ - PagedIterable listByResourceGroup(String resourceGroupName, String filter, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context); + ApplicationGroup getByResourceGroup(String resourceGroupName, String applicationGroupName); /** - * List applicationGroups in subscription. + * Remove an applicationGroup. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 applicationGroupList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - PagedIterable list(); + Response deleteByResourceGroupWithResponse(String resourceGroupName, String applicationGroupName, + Context context); /** - * List applicationGroups in subscription. + * Remove an applicationGroup. * - * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 applicationGroupList as paginated response with {@link PagedIterable}. */ - PagedIterable list(String filter, Context context); + void deleteByResourceGroup(String resourceGroupName, String applicationGroupName); /** * Get an application group. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationList.java index 92ec800a9eae..83ed8837408b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationList.java @@ -5,6 +5,7 @@ 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; @@ -14,19 +15,17 @@ import java.util.List; /** - * ApplicationList - * * List of Application definitions. */ @Fluent public final class ApplicationList implements JsonSerializable { /* - * List of Application definitions. + * The Application items on this page */ private List value; /* - * Link to the next page of results. + * The link to the next page of items */ private String nextLink; @@ -37,7 +36,7 @@ public ApplicationList() { } /** - * Get the value property: List of Application definitions. + * Get the value property: The Application items on this page. * * @return the value value. */ @@ -46,7 +45,7 @@ public List value() { } /** - * Set the value property: List of Application definitions. + * Set the value property: The Application items on this page. * * @param value the value value to set. * @return the ApplicationList object itself. @@ -57,7 +56,7 @@ public ApplicationList withValue(List value) { } /** - * Get the nextLink property: Link to the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,17 +64,33 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ApplicationList object itself. + */ + public ApplicationList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ApplicationList")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(ApplicationList.class); + /** * {@inheritDoc} */ @@ -83,6 +98,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -92,6 +108,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ApplicationList 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 ApplicationList. */ public static ApplicationList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationPatch.java index b92fc5eee5af..44840e1a94be 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationPatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationPatch.java @@ -9,24 +9,17 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationPatchProperties; import java.io.IOException; -import java.util.Map; /** * Application properties that can be patched. */ @Fluent public final class ApplicationPatch implements JsonSerializable { - /* - * tags to be updated - */ - private Map tags; - /* * Detailed properties for Application */ - private ApplicationPatchProperties innerProperties; + private ApplicationPatchProperties properties; /** * Creates an instance of ApplicationPatch class. @@ -35,288 +28,22 @@ public ApplicationPatch() { } /** - * 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 ApplicationPatch object itself. - */ - public ApplicationPatch withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the innerProperties property: Detailed properties for Application. - * - * @return the innerProperties value. - */ - private ApplicationPatchProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the description property: Description of Application. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Description of Application. - * - * @param description the description value to set. - * @return the ApplicationPatch object itself. - */ - public ApplicationPatch withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationPatchProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the friendlyName property: Friendly name of Application. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); - } - - /** - * Set the friendlyName property: Friendly name of Application. + * Get the properties property: Detailed properties for Application. * - * @param friendlyName the friendlyName value to set. - * @return the ApplicationPatch object itself. - */ - public ApplicationPatch withFriendlyName(String friendlyName) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationPatchProperties(); - } - this.innerProperties().withFriendlyName(friendlyName); - return this; - } - - /** - * Get the filePath property: Specifies a path for the executable file for the application. - * - * @return the filePath value. - */ - public String filePath() { - return this.innerProperties() == null ? null : this.innerProperties().filePath(); - } - - /** - * Set the filePath property: Specifies a path for the executable file for the application. - * - * @param filePath the filePath value to set. - * @return the ApplicationPatch object itself. - */ - public ApplicationPatch withFilePath(String filePath) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationPatchProperties(); - } - this.innerProperties().withFilePath(filePath); - return this; - } - - /** - * Get the commandLineSetting property: Specifies whether this published application can be launched with command - * line arguments provided by the client, command line arguments specified at publish time, or no command line - * arguments at all. - * - * @return the commandLineSetting value. + * @return the properties value. */ - public CommandLineSetting commandLineSetting() { - return this.innerProperties() == null ? null : this.innerProperties().commandLineSetting(); + public ApplicationPatchProperties properties() { + return this.properties; } /** - * Set the commandLineSetting property: Specifies whether this published application can be launched with command - * line arguments provided by the client, command line arguments specified at publish time, or no command line - * arguments at all. + * Set the properties property: Detailed properties for Application. * - * @param commandLineSetting the commandLineSetting value to set. + * @param properties the properties value to set. * @return the ApplicationPatch object itself. */ - public ApplicationPatch withCommandLineSetting(CommandLineSetting commandLineSetting) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationPatchProperties(); - } - this.innerProperties().withCommandLineSetting(commandLineSetting); - return this; - } - - /** - * Get the commandLineArguments property: Command Line Arguments for Application. - * - * @return the commandLineArguments value. - */ - public String commandLineArguments() { - return this.innerProperties() == null ? null : this.innerProperties().commandLineArguments(); - } - - /** - * Set the commandLineArguments property: Command Line Arguments for Application. - * - * @param commandLineArguments the commandLineArguments value to set. - * @return the ApplicationPatch object itself. - */ - public ApplicationPatch withCommandLineArguments(String commandLineArguments) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationPatchProperties(); - } - this.innerProperties().withCommandLineArguments(commandLineArguments); - return this; - } - - /** - * Get the showInPortal property: Specifies whether to show the RemoteApp program in the RD Web Access server. - * - * @return the showInPortal value. - */ - public Boolean showInPortal() { - return this.innerProperties() == null ? null : this.innerProperties().showInPortal(); - } - - /** - * Set the showInPortal property: Specifies whether to show the RemoteApp program in the RD Web Access server. - * - * @param showInPortal the showInPortal value to set. - * @return the ApplicationPatch object itself. - */ - public ApplicationPatch withShowInPortal(Boolean showInPortal) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationPatchProperties(); - } - this.innerProperties().withShowInPortal(showInPortal); - return this; - } - - /** - * Get the iconPath property: Path to icon. - * - * @return the iconPath value. - */ - public String iconPath() { - return this.innerProperties() == null ? null : this.innerProperties().iconPath(); - } - - /** - * Set the iconPath property: Path to icon. - * - * @param iconPath the iconPath value to set. - * @return the ApplicationPatch object itself. - */ - public ApplicationPatch withIconPath(String iconPath) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationPatchProperties(); - } - this.innerProperties().withIconPath(iconPath); - return this; - } - - /** - * Get the iconIndex property: Index of the icon. - * - * @return the iconIndex value. - */ - public Integer iconIndex() { - return this.innerProperties() == null ? null : this.innerProperties().iconIndex(); - } - - /** - * Set the iconIndex property: Index of the icon. - * - * @param iconIndex the iconIndex value to set. - * @return the ApplicationPatch object itself. - */ - public ApplicationPatch withIconIndex(Integer iconIndex) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationPatchProperties(); - } - this.innerProperties().withIconIndex(iconIndex); - return this; - } - - /** - * Get the msixPackageFamilyName property: Specifies the package family name for MSIX applications. - * - * @return the msixPackageFamilyName value. - */ - public String msixPackageFamilyName() { - return this.innerProperties() == null ? null : this.innerProperties().msixPackageFamilyName(); - } - - /** - * Set the msixPackageFamilyName property: Specifies the package family name for MSIX applications. - * - * @param msixPackageFamilyName the msixPackageFamilyName value to set. - * @return the ApplicationPatch object itself. - */ - public ApplicationPatch withMsixPackageFamilyName(String msixPackageFamilyName) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationPatchProperties(); - } - this.innerProperties().withMsixPackageFamilyName(msixPackageFamilyName); - return this; - } - - /** - * Get the msixPackageApplicationId property: Specifies the package application Id for MSIX applications. - * - * @return the msixPackageApplicationId value. - */ - public String msixPackageApplicationId() { - return this.innerProperties() == null ? null : this.innerProperties().msixPackageApplicationId(); - } - - /** - * Set the msixPackageApplicationId property: Specifies the package application Id for MSIX applications. - * - * @param msixPackageApplicationId the msixPackageApplicationId value to set. - * @return the ApplicationPatch object itself. - */ - public ApplicationPatch withMsixPackageApplicationId(String msixPackageApplicationId) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationPatchProperties(); - } - this.innerProperties().withMsixPackageApplicationId(msixPackageApplicationId); - return this; - } - - /** - * Get the applicationType property: Resource Type of Application. - * - * @return the applicationType value. - */ - public RemoteApplicationType applicationType() { - return this.innerProperties() == null ? null : this.innerProperties().applicationType(); - } - - /** - * Set the applicationType property: Resource Type of Application. - * - * @param applicationType the applicationType value to set. - * @return the ApplicationPatch object itself. - */ - public ApplicationPatch withApplicationType(RemoteApplicationType applicationType) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationPatchProperties(); - } - this.innerProperties().withApplicationType(applicationType); + public ApplicationPatch withProperties(ApplicationPatchProperties properties) { + this.properties = properties; return this; } @@ -326,8 +53,8 @@ public ApplicationPatch withApplicationType(RemoteApplicationType applicationTyp * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -337,8 +64,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.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -357,11 +83,8 @@ public static ApplicationPatch fromJson(JsonReader jsonReader) throws IOExceptio String fieldName = reader.getFieldName(); reader.nextToken(); - if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedApplicationPatch.tags = tags; - } else if ("properties".equals(fieldName)) { - deserializedApplicationPatch.innerProperties = ApplicationPatchProperties.fromJson(reader); + if ("properties".equals(fieldName)) { + deserializedApplicationPatch.properties = ApplicationPatchProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationPatchProperties.java similarity index 98% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationPatchProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationPatchProperties.java index af072a7d7b8d..c22833a99f47 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationPatchProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationPatchProperties.java @@ -2,15 +2,13 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.desktopvirtualization.fluent.models; +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.models.CommandLineSetting; -import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; import java.io.IOException; /** diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Applications.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Applications.java index 4806df3eaea6..6f283390a21d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Applications.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Applications.java @@ -13,35 +13,36 @@ */ public interface Applications { /** - * Get an application. + * List applications. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param applicationName The name of the application within the specified application 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 an application along with {@link Response}. + * @return list of Application definitions as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String resourceGroupName, String applicationGroupName, String applicationName, - Context context); + PagedIterable list(String resourceGroupName, String applicationGroupName); /** - * Get an application. + * List applications. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param applicationName The name of the application within the specified application group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application. + * @return list of Application definitions as paginated response with {@link PagedIterable}. */ - Application get(String resourceGroupName, String applicationGroupName, String applicationName); + PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** - * Remove an application. + * Get an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -50,13 +51,13 @@ Response getWithResponse(String resourceGroupName, String applicati * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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}. + * @return an application along with {@link Response}. */ - Response deleteWithResponse(String resourceGroupName, String applicationGroupName, String applicationName, + Response getWithResponse(String resourceGroupName, String applicationGroupName, String applicationName, Context context); /** - * Remove an application. + * Get an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -64,37 +65,36 @@ Response deleteWithResponse(String resourceGroupName, String applicationGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an application. */ - void delete(String resourceGroupName, String applicationGroupName, String applicationName); + Application get(String resourceGroupName, String applicationGroupName, String applicationName); /** - * List applications. + * Remove an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. + * @param applicationName The name of the application within the specified application 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 applicationList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - PagedIterable list(String resourceGroupName, String applicationGroupName); + Response deleteWithResponse(String resourceGroupName, String applicationGroupName, String applicationName, + Context context); /** - * List applications. + * Remove an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param applicationName The name of the application within the specified application 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 applicationList as paginated response with {@link PagedIterable}. */ - PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context); + void delete(String resourceGroupName, String applicationGroupName, String applicationName); /** * Get an application. 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..1b22598e3a73 --- /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 actions on a session host update. + * + * @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 The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 actions on a session host update. + * + * @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 The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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/CustomInfoPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CustomInfoPatchProperties.java new file mode 100644 index 000000000000..4fc9ff081fcd --- /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 image. + */ + private String resourceId; + + /** + * Creates an instance of CustomInfoPatchProperties class. + */ + public CustomInfoPatchProperties() { + } + + /** + * Get the resourceId property: The resource ID of the image. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource ID of the 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..cc3f121190cf --- /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 image. + */ + private String resourceId; + + /** + * Creates an instance of CustomInfoProperties class. + */ + public CustomInfoProperties() { + } + + /** + * Get the resourceId property: The resource ID of the image. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource ID of the 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/DayOfWeek.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DayOfWeek.java index afd20bacaede..a112b2d4c5fb 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DayOfWeek.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DayOfWeek.java @@ -5,7 +5,7 @@ package com.azure.resourcemanager.desktopvirtualization.models; /** - * Day of the week. + * Day of the week. Modeled as string. */ public enum DayOfWeek { /** diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopList.java index 80eb5ddd846a..8ec8ec4c78cd 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopList.java @@ -5,6 +5,7 @@ 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; @@ -14,19 +15,17 @@ import java.util.List; /** - * DesktopList - * * List of Desktop definitions. */ @Fluent public final class DesktopList implements JsonSerializable { /* - * List of Desktop definitions. + * The Desktop items on this page */ private List value; /* - * Link to the next page of results. + * The link to the next page of items */ private String nextLink; @@ -37,7 +36,7 @@ public DesktopList() { } /** - * Get the value property: List of Desktop definitions. + * Get the value property: The Desktop items on this page. * * @return the value value. */ @@ -46,7 +45,7 @@ public List value() { } /** - * Set the value property: List of Desktop definitions. + * Set the value property: The Desktop items on this page. * * @param value the value value to set. * @return the DesktopList object itself. @@ -57,7 +56,7 @@ public DesktopList withValue(List value) { } /** - * Get the nextLink property: Link to the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,17 +64,33 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the DesktopList object itself. + */ + public DesktopList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model DesktopList")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(DesktopList.class); + /** * {@inheritDoc} */ @@ -83,6 +98,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -92,6 +108,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of DesktopList 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 DesktopList. */ public static DesktopList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopPatch.java index 14b44f746a26..1c1d25eff6bc 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopPatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopPatch.java @@ -9,24 +9,17 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.DesktopPatchProperties; import java.io.IOException; -import java.util.Map; /** * Desktop properties that can be patched. */ @Fluent public final class DesktopPatch implements JsonSerializable { - /* - * tags to be updated - */ - private Map tags; - /* * Detailed properties for Desktop */ - private DesktopPatchProperties innerProperties; + private DesktopPatchProperties properties; /** * Creates an instance of DesktopPatch class. @@ -35,77 +28,22 @@ public DesktopPatch() { } /** - * 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 DesktopPatch object itself. - */ - public DesktopPatch withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the innerProperties property: Detailed properties for Desktop. - * - * @return the innerProperties value. - */ - private DesktopPatchProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the description property: Description of Desktop. + * Get the properties property: Detailed properties for Desktop. * - * @return the description value. + * @return the properties value. */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); + public DesktopPatchProperties properties() { + return this.properties; } /** - * Set the description property: Description of Desktop. + * Set the properties property: Detailed properties for Desktop. * - * @param description the description value to set. + * @param properties the properties value to set. * @return the DesktopPatch object itself. */ - public DesktopPatch withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new DesktopPatchProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the friendlyName property: Friendly name of Desktop. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); - } - - /** - * Set the friendlyName property: Friendly name of Desktop. - * - * @param friendlyName the friendlyName value to set. - * @return the DesktopPatch object itself. - */ - public DesktopPatch withFriendlyName(String friendlyName) { - if (this.innerProperties() == null) { - this.innerProperties = new DesktopPatchProperties(); - } - this.innerProperties().withFriendlyName(friendlyName); + public DesktopPatch withProperties(DesktopPatchProperties properties) { + this.properties = properties; return this; } @@ -115,8 +53,8 @@ public DesktopPatch withFriendlyName(String friendlyName) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -126,8 +64,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.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -146,11 +83,8 @@ public static DesktopPatch fromJson(JsonReader jsonReader) throws IOException { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedDesktopPatch.tags = tags; - } else if ("properties".equals(fieldName)) { - deserializedDesktopPatch.innerProperties = DesktopPatchProperties.fromJson(reader); + if ("properties".equals(fieldName)) { + deserializedDesktopPatch.properties = DesktopPatchProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopPatchProperties.java similarity index 98% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopPatchProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopPatchProperties.java index 43518a5e4f94..37685cceda2e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopPatchProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopPatchProperties.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.desktopvirtualization.fluent.models; +package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Desktops.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Desktops.java index 7392e7f52f5f..7b927f8afa35 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Desktops.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Desktops.java @@ -13,51 +13,51 @@ */ public interface Desktops { /** - * Get a desktop. + * List desktops. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param desktopName The name of the desktop within the specified desktop 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 desktop along with {@link Response}. + * @return list of Desktop definitions as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String resourceGroupName, String applicationGroupName, String desktopName, - Context context); + PagedIterable list(String resourceGroupName, String applicationGroupName); /** - * Get a desktop. + * List desktops. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param desktopName The name of the desktop within the specified desktop group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a desktop. + * @return list of Desktop definitions as paginated response with {@link PagedIterable}. */ - Desktop get(String resourceGroupName, String applicationGroupName, String desktopName); + PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** - * Update a desktop. + * Get a desktop. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param desktopName The name of the desktop within the specified desktop group. - * @param desktop Object containing Desktop 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 schema for Desktop properties along with {@link Response}. + * @return a desktop along with {@link Response}. */ - Response updateWithResponse(String resourceGroupName, String applicationGroupName, String desktopName, - DesktopPatch desktop, Context context); + Response getWithResponse(String resourceGroupName, String applicationGroupName, String desktopName, + Context context); /** - * Update a desktop. + * Get a desktop. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -65,36 +65,36 @@ Response updateWithResponse(String resourceGroupName, String applicatio * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema for Desktop properties. + * @return a desktop. */ - Desktop update(String resourceGroupName, String applicationGroupName, String desktopName); + Desktop get(String resourceGroupName, String applicationGroupName, String desktopName); /** - * List desktops. + * Update a desktop. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. + * @param desktopName The name of the desktop within the specified desktop group. + * @param desktop The resource properties to be updated. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return desktopList as paginated response with {@link PagedIterable}. + * @return schema for Desktop properties along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String applicationGroupName); + Response updateWithResponse(String resourceGroupName, String applicationGroupName, String desktopName, + DesktopPatch desktop, Context context); /** - * List desktops. + * Update a desktop. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param desktopName The name of the desktop within the specified desktop 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 desktopList as paginated response with {@link PagedIterable}. + * @return schema for Desktop properties. */ - PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context); + Desktop update(String resourceGroupName, String applicationGroupName, String desktopName); } 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..57b49ddf65c2 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DirectUdp.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; + +/** + * Direct UDP Connection Settings. + */ +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..e5f4a4f15fe3 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 @@ -6,8 +6,6 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ExpandMsixImageInner; -import java.time.OffsetDateTime; -import java.util.List; /** * An immutable client-side representation of ExpandMsixImage. @@ -35,117 +33,18 @@ public interface ExpandMsixImage { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the packageAlias property: Alias of MSIX Package. - * - * @return the packageAlias value. - */ - String packageAlias(); - - /** - * Gets the imagePath property: VHD/CIM image path on Network Share. - * - * @return the imagePath value. - */ - String imagePath(); - - /** - * Gets the packageName property: Package Name from appxmanifest.xml. - * - * @return the packageName value. - */ - String packageName(); - - /** - * Gets the packageFamilyName property: Package Family Name from appxmanifest.xml. Contains Package Name and - * Publisher name. - * - * @return the packageFamilyName value. - */ - String packageFamilyName(); - - /** - * Gets the packageFullName property: Package Full Name from appxmanifest.xml. - * - * @return the packageFullName value. - */ - String packageFullName(); - - /** - * Gets the displayName property: User friendly Name to be displayed in the portal. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the packageRelativePath property: Relative Path to the package inside the image. + * Gets the properties property: Detailed properties for ExpandMsixImage. * - * @return the packageRelativePath value. + * @return the properties value. */ - String packageRelativePath(); + ExpandMsixImageProperties properties(); /** - * Gets the isRegularRegistration property: Specifies how to register Package in feed. - * - * @return the isRegularRegistration value. - */ - Boolean isRegularRegistration(); - - /** - * Gets the isActive property: Make this version of the package the active one across the hostpool. - * - * @return the isActive value. - */ - Boolean isActive(); - - /** - * Gets the packageDependencies property: List of package dependencies. - * - * @return the packageDependencies value. - */ - List packageDependencies(); - - /** - * Gets the version property: Package version found in the appxmanifest.xml. - * - * @return the version value. - */ - String version(); - - /** - * Gets the lastUpdated property: Date Package was last updated, found in the appxmanifest.xml. - * - * @return the lastUpdated value. - */ - OffsetDateTime lastUpdated(); - - /** - * Gets the packageApplications property: List of package applications. - * - * @return the packageApplications value. - */ - List packageApplications(); - - /** - * Gets the certificateName property: Certificate name found in the appxmanifest.xml. - * - * @return the certificateName value. - */ - String certificateName(); - - /** - * Gets the certificateExpiry property: Date certificate expires, found in the appxmanifest.xml. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the certificateExpiry value. + * @return the systemData value. */ - OffsetDateTime certificateExpiry(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.ExpandMsixImageInner object. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImageList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImageList.java index a6cfdf37f5f9..66881ceb2154 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImageList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImageList.java @@ -5,6 +5,7 @@ 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; @@ -14,19 +15,17 @@ import java.util.List; /** - * ExpandMsixImageList - * * List of MSIX package properties retrieved from MSIX Image expansion. */ @Fluent public final class ExpandMsixImageList implements JsonSerializable { /* - * List of MSIX package properties from give MSIX Image. + * The ExpandMsixImage items on this page */ private List value; /* - * Link to the next page of results. + * The link to the next page of items */ private String nextLink; @@ -37,7 +36,7 @@ public ExpandMsixImageList() { } /** - * Get the value property: List of MSIX package properties from give MSIX Image. + * Get the value property: The ExpandMsixImage items on this page. * * @return the value value. */ @@ -46,7 +45,7 @@ public List value() { } /** - * Set the value property: List of MSIX package properties from give MSIX Image. + * Set the value property: The ExpandMsixImage items on this page. * * @param value the value value to set. * @return the ExpandMsixImageList object itself. @@ -57,7 +56,7 @@ public ExpandMsixImageList withValue(List value) { } /** - * Get the nextLink property: Link to the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,17 +64,33 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ExpandMsixImageList object itself. + */ + public ExpandMsixImageList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ExpandMsixImageList")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(ExpandMsixImageList.class); + /** * {@inheritDoc} */ @@ -83,6 +98,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -92,6 +108,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ExpandMsixImageList 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 ExpandMsixImageList. */ public static ExpandMsixImageList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ExpandMsixImageProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImageProperties.java similarity index 98% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ExpandMsixImageProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImageProperties.java index c9304c1e42e8..6c39b2bea891 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ExpandMsixImageProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImageProperties.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.desktopvirtualization.fluent.models; +package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; @@ -10,8 +10,6 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; import java.io.IOException; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; 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..9e621af3922f 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 @@ -53,17 +53,25 @@ public interface HostPool { Map tags(); /** - * Gets the managedBy property: The fully qualified resource ID of the resource that manages this resource. - * Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment - * will not delete the resource if it is removed from the template since it is managed by another resource. + * Gets the identity property: The managed service identities assigned to this resource. * - * @return the managedBy value. + * @return the identity value. */ - String managedBy(); + ManagedServiceIdentity identity(); + + /** + * Gets the etag property: If etag is provided in the response body, it may also be provided as a header per the + * normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. + * HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), + * and If-Range (section 14.27) header fields. + * + * @return the etag value. + */ + String etag(); /** * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of - * the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must * validate and persist this value. * * @return the kind value. @@ -71,35 +79,27 @@ public interface HostPool { String kind(); /** - * Gets the etag property: The etag field is *not* required. If it is provided in the response body, it must also be - * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from - * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), - * If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + * Gets the managedBy property: The fully qualified resource ID of the resource that manages this resource. + * Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment + * will not delete the resource if it is removed from the template since it is managed by another resource. * - * @return the etag value. + * @return the managedBy value. */ - String etag(); + String managedBy(); /** - * Gets the identity property: The identity property. + * Gets the plan property: Details of the resource plan. * - * @return the identity value. + * @return the plan value. */ - ResourceModelWithAllowedPropertySetIdentity identity(); + Plan plan(); /** - * Gets the sku property: The sku property. + * Gets the sku property: The SKU (Stock Keeping Unit) assigned to this resource. * * @return the sku value. */ - ResourceModelWithAllowedPropertySetSku sku(); - - /** - * Gets the plan property: The plan property. - * - * @return the plan value. - */ - ResourceModelWithAllowedPropertySetPlan plan(); + Sku sku(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -281,6 +281,54 @@ 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 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 region of the resource. * @@ -406,16 +454,17 @@ interface WithPreferredAppGroupType { * The stage of the HostPool definition which contains all the minimum required properties for the resource to * be created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithManagedBy, - DefinitionStages.WithKind, DefinitionStages.WithIdentity, DefinitionStages.WithSku, - DefinitionStages.WithPlan, DefinitionStages.WithFriendlyName, DefinitionStages.WithDescription, + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithKind, DefinitionStages.WithManagedBy, DefinitionStages.WithPlan, + DefinitionStages.WithSku, DefinitionStages.WithFriendlyName, DefinitionStages.WithDescription, DefinitionStages.WithPersonalDesktopAssignmentType, DefinitionStages.WithCustomRdpProperty, DefinitionStages.WithMaxSessionLimit, DefinitionStages.WithRing, DefinitionStages.WithValidationEnvironment, DefinitionStages.WithRegistrationInfo, DefinitionStages.WithVmTemplate, DefinitionStages.WithSsoadfsAuthority, DefinitionStages.WithSsoClientId, DefinitionStages.WithSsoClientSecretKeyVaultPath, DefinitionStages.WithSsoSecretType, DefinitionStages.WithStartVMOnConnect, DefinitionStages.WithPublicNetworkAccess, - DefinitionStages.WithAgentUpdate { + DefinitionStages.WithAgentUpdate, DefinitionStages.WithManagedPrivateUdp, DefinitionStages.WithDirectUdp, + DefinitionStages.WithPublicUdp, DefinitionStages.WithRelayUdp, DefinitionStages.WithManagementType { /** * Executes the create request. * @@ -446,21 +495,16 @@ interface WithTags { } /** - * The stage of the HostPool definition allowing to specify managedBy. + * The stage of the HostPool definition allowing to specify identity. */ - interface WithManagedBy { + interface WithIdentity { /** - * Specifies the managedBy property: The fully qualified resource ID of the resource that manages this - * resource. Indicates if this resource is managed by another Azure resource. If this is present, complete - * mode deployment will not delete the resource if it is removed from the template since it is managed by - * another resource.. + * Specifies the identity property: The managed service identities assigned to this resource.. * - * @param managedBy The fully qualified resource ID of the resource that manages this resource. Indicates if - * this resource is managed by another Azure resource. If this is present, complete mode deployment will not - * delete the resource if it is removed from the template since it is managed by another resource. + * @param identity The managed service identities assigned to this resource. * @return the next definition stage. */ - WithCreate withManagedBy(String managedBy); + WithCreate withIdentity(ManagedServiceIdentity identity); } /** @@ -469,11 +513,11 @@ interface WithManagedBy { interface WithKind { /** * Specifies the kind property: Metadata used by portal/tooling/etc to render different UX experiences for - * resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the + * resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the * resource provider must validate and persist this value.. * * @param kind Metadata used by portal/tooling/etc to render different UX experiences for resources of the - * same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must * validate and persist this value. * @return the next definition stage. */ @@ -481,42 +525,47 @@ interface WithKind { } /** - * The stage of the HostPool definition allowing to specify identity. + * The stage of the HostPool definition allowing to specify managedBy. */ - interface WithIdentity { + interface WithManagedBy { /** - * Specifies the identity property: The identity property.. + * Specifies the managedBy property: The fully qualified resource ID of the resource that manages this + * resource. Indicates if this resource is managed by another Azure resource. If this is present, complete + * mode deployment will not delete the resource if it is removed from the template since it is managed by + * another resource.. * - * @param identity The identity property. + * @param managedBy The fully qualified resource ID of the resource that manages this resource. Indicates if + * this resource is managed by another Azure resource. If this is present, complete mode deployment will not + * delete the resource if it is removed from the template since it is managed by another resource. * @return the next definition stage. */ - WithCreate withIdentity(ResourceModelWithAllowedPropertySetIdentity identity); + WithCreate withManagedBy(String managedBy); } /** - * The stage of the HostPool definition allowing to specify sku. + * The stage of the HostPool definition allowing to specify plan. */ - interface WithSku { + interface WithPlan { /** - * Specifies the sku property: The sku property.. + * Specifies the plan property: Details of the resource plan.. * - * @param sku The sku property. + * @param plan Details of the resource plan. * @return the next definition stage. */ - WithCreate withSku(ResourceModelWithAllowedPropertySetSku sku); + WithCreate withPlan(Plan plan); } /** - * The stage of the HostPool definition allowing to specify plan. + * The stage of the HostPool definition allowing to specify sku. */ - interface WithPlan { + interface WithSku { /** - * Specifies the plan property: The plan property.. + * Specifies the sku property: The SKU (Stock Keeping Unit) assigned to this resource.. * - * @param plan The plan property. + * @param sku The SKU (Stock Keeping Unit) assigned to this resource. * @return the next definition stage. */ - WithCreate withPlan(ResourceModelWithAllowedPropertySetPlan plan); + WithCreate withSku(Sku sku); } /** @@ -733,298 +782,154 @@ interface WithAgentUpdate { */ WithCreate withAgentUpdate(AgentUpdateProperties agentUpdate); } - } - - /** - * Begins update for the HostPool resource. - * - * @return the stage of resource update. - */ - HostPool.Update update(); - - /** - * The template for HostPool update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithFriendlyName, UpdateStages.WithDescription, - UpdateStages.WithCustomRdpProperty, UpdateStages.WithMaxSessionLimit, - UpdateStages.WithPersonalDesktopAssignmentType, UpdateStages.WithLoadBalancerType, UpdateStages.WithRing, - UpdateStages.WithValidationEnvironment, UpdateStages.WithRegistrationInfo, UpdateStages.WithVmTemplate, - UpdateStages.WithSsoadfsAuthority, UpdateStages.WithSsoClientId, UpdateStages.WithSsoClientSecretKeyVaultPath, - UpdateStages.WithSsoSecretType, UpdateStages.WithPreferredAppGroupType, UpdateStages.WithStartVMOnConnect, - UpdateStages.WithPublicNetworkAccess, UpdateStages.WithAgentUpdate { - /** - * Executes the update request. - * - * @return the updated resource. - */ - HostPool apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - HostPool apply(Context context); - } - - /** - * The HostPool update stages. - */ - interface UpdateStages { - /** - * The stage of the HostPool 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 HostPool update allowing to specify friendlyName. + * The stage of the HostPool definition allowing to specify managedPrivateUdp. */ - interface WithFriendlyName { + interface WithManagedPrivateUdp { /** - * Specifies the friendlyName property: Friendly name of HostPool.. + * 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 friendlyName Friendly name of HostPool. + * @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 withFriendlyName(String friendlyName); + WithCreate withManagedPrivateUdp(ManagedPrivateUdp managedPrivateUdp); } /** - * The stage of the HostPool update allowing to specify description. + * The stage of the HostPool definition allowing to specify directUdp. */ - interface WithDescription { + interface WithDirectUdp { /** - * Specifies the description property: Description of HostPool.. + * 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 description Description of HostPool. + * @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 withDescription(String description); + WithCreate withDirectUdp(DirectUdp directUdp); } /** - * The stage of the HostPool update allowing to specify customRdpProperty. + * The stage of the HostPool definition allowing to specify publicUdp. */ - interface WithCustomRdpProperty { + interface WithPublicUdp { /** - * Specifies the customRdpProperty property: Custom rdp property of HostPool.. + * 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 customRdpProperty Custom rdp property of HostPool. + * @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 withCustomRdpProperty(String customRdpProperty); + WithCreate withPublicUdp(PublicUdp publicUdp); } /** - * The stage of the HostPool update allowing to specify maxSessionLimit. + * The stage of the HostPool definition allowing to specify relayUdp. */ - interface WithMaxSessionLimit { + interface WithRelayUdp { /** - * Specifies the maxSessionLimit property: The max session limit of HostPool.. + * 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 maxSessionLimit The max session limit of HostPool. + * @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 withMaxSessionLimit(Integer maxSessionLimit); + WithCreate withRelayUdp(RelayUdp relayUdp); } /** - * The stage of the HostPool update allowing to specify personalDesktopAssignmentType. + * The stage of the HostPool definition allowing to specify managementType. */ - interface WithPersonalDesktopAssignmentType { + interface WithManagementType { /** - * Specifies the personalDesktopAssignmentType property: PersonalDesktopAssignment type for HostPool.. + * Specifies the managementType property: The type of management for this hostpool, Automated or Standard. + * The default value is Automated.. * - * @param personalDesktopAssignmentType PersonalDesktopAssignment type for HostPool. + * @param managementType The type of management for this hostpool, Automated or Standard. The default value + * is Automated. * @return the next definition stage. */ - Update withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType personalDesktopAssignmentType); - } - - /** - * The stage of the HostPool update allowing to specify loadBalancerType. - */ - interface WithLoadBalancerType { - /** - * Specifies the loadBalancerType property: The type of the load balancer.. - * - * @param loadBalancerType The type of the load balancer. - * @return the next definition stage. - */ - Update withLoadBalancerType(LoadBalancerType loadBalancerType); - } - - /** - * The stage of the HostPool update allowing to specify ring. - */ - interface WithRing { - /** - * Specifies the ring property: The ring number of HostPool.. - * - * @param ring The ring number of HostPool. - * @return the next definition stage. - */ - Update withRing(Integer ring); - } - - /** - * The stage of the HostPool update allowing to specify validationEnvironment. - */ - interface WithValidationEnvironment { - /** - * Specifies the validationEnvironment property: Is validation environment.. - * - * @param validationEnvironment Is validation environment. - * @return the next definition stage. - */ - Update withValidationEnvironment(Boolean validationEnvironment); - } - - /** - * The stage of the HostPool update allowing to specify registrationInfo. - */ - interface WithRegistrationInfo { - /** - * Specifies the registrationInfo property: The registration info of HostPool.. - * - * @param registrationInfo The registration info of HostPool. - * @return the next definition stage. - */ - Update withRegistrationInfo(RegistrationInfoPatch registrationInfo); - } - - /** - * The stage of the HostPool update allowing to specify vmTemplate. - */ - interface WithVmTemplate { - /** - * Specifies the vmTemplate property: VM template for sessionhosts configuration within hostpool.. - * - * @param vmTemplate VM template for sessionhosts configuration within hostpool. - * @return the next definition stage. - */ - Update withVmTemplate(String vmTemplate); - } - - /** - * The stage of the HostPool update allowing to specify ssoadfsAuthority. - */ - interface WithSsoadfsAuthority { - /** - * Specifies the ssoadfsAuthority property: URL to customer ADFS server for signing WVD SSO certificates.. - * - * @param ssoadfsAuthority URL to customer ADFS server for signing WVD SSO certificates. - * @return the next definition stage. - */ - Update withSsoadfsAuthority(String ssoadfsAuthority); - } - - /** - * The stage of the HostPool update allowing to specify ssoClientId. - */ - interface WithSsoClientId { - /** - * Specifies the ssoClientId property: ClientId for the registered Relying Party used to issue WVD SSO - * certificates.. - * - * @param ssoClientId ClientId for the registered Relying Party used to issue WVD SSO certificates. - * @return the next definition stage. - */ - Update withSsoClientId(String ssoClientId); - } - - /** - * The stage of the HostPool update allowing to specify ssoClientSecretKeyVaultPath. - */ - interface WithSsoClientSecretKeyVaultPath { - /** - * Specifies the ssoClientSecretKeyVaultPath property: Path to Azure KeyVault storing the secret used for - * communication to ADFS.. - * - * @param ssoClientSecretKeyVaultPath Path to Azure KeyVault storing the secret used for communication to - * ADFS. - * @return the next definition stage. - */ - Update withSsoClientSecretKeyVaultPath(String ssoClientSecretKeyVaultPath); + WithCreate withManagementType(ManagementType managementType); } + } - /** - * The stage of the HostPool update allowing to specify ssoSecretType. - */ - interface WithSsoSecretType { - /** - * Specifies the ssoSecretType property: The type of single sign on Secret Type.. - * - * @param ssoSecretType The type of single sign on Secret Type. - * @return the next definition stage. - */ - Update withSsoSecretType(SsoSecretType ssoSecretType); - } + /** + * Begins update for the HostPool resource. + * + * @return the stage of resource update. + */ + HostPool.Update update(); + /** + * The template for HostPool update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { /** - * The stage of the HostPool update allowing to specify preferredAppGroupType. + * Executes the update request. + * + * @return the updated resource. */ - interface WithPreferredAppGroupType { - /** - * Specifies the preferredAppGroupType property: The type of preferred application group type, default to - * Desktop Application Group. - * - * @param preferredAppGroupType The type of preferred application group type, default to Desktop Application - * Group. - * @return the next definition stage. - */ - Update withPreferredAppGroupType(PreferredAppGroupType preferredAppGroupType); - } + HostPool apply(); /** - * The stage of the HostPool update allowing to specify startVMOnConnect. + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. */ - interface WithStartVMOnConnect { - /** - * Specifies the startVMOnConnect property: The flag to turn on/off StartVMOnConnect feature.. - * - * @param startVMOnConnect The flag to turn on/off StartVMOnConnect feature. - * @return the next definition stage. - */ - Update withStartVMOnConnect(Boolean startVMOnConnect); - } + HostPool apply(Context context); + } + /** + * The HostPool update stages. + */ + interface UpdateStages { /** - * The stage of the HostPool update allowing to specify publicNetworkAccess. + * The stage of the HostPool update allowing to specify tags. */ - interface WithPublicNetworkAccess { + interface WithTags { /** - * Specifies the publicNetworkAccess property: Enabled to allow this resource to be access from the public - * network. + * Specifies the tags property: tags to be updated. * - * @param publicNetworkAccess Enabled to allow this resource to be access from the public network. + * @param tags tags to be updated. * @return the next definition stage. */ - Update withPublicNetworkAccess(HostpoolPublicNetworkAccess publicNetworkAccess); + Update withTags(Map tags); } /** - * The stage of the HostPool update allowing to specify agentUpdate. + * The stage of the HostPool update allowing to specify properties. */ - interface WithAgentUpdate { + interface WithProperties { /** - * Specifies the agentUpdate property: The session host configuration for updating agent, monitoring agent, - * and stack component.. + * Specifies the properties property: HostPool properties that can be patched.. * - * @param agentUpdate The session host configuration for updating agent, monitoring agent, and stack - * component. + * @param properties HostPool properties that can be patched. * @return the next definition stage. */ - Update withAgentUpdate(AgentUpdatePatchProperties agentUpdate); + Update withProperties(HostPoolPatchProperties properties); } } @@ -1044,42 +949,42 @@ interface WithAgentUpdate { HostPool refresh(Context context); /** - * Registration token of the host pool. + * Operation to list the RegistrationTokens associated with the HostPool. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 RegistrationInfo definition along with {@link Response}. + * @return list of RegistrationToken definitions along with {@link Response}. */ - Response retrieveRegistrationTokenWithResponse(Context context); + Response listRegistrationTokensWithResponse(Context context); /** - * Registration token of the host pool. + * Operation to list the RegistrationTokens associated with the HostPool. * * @throws com.azure.core.management.exception.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 RegistrationInfo definition. + * @return list of RegistrationToken definitions. */ - RegistrationInfo retrieveRegistrationToken(); + RegistrationTokenList listRegistrationTokens(); /** - * Operation to list the RegistrationTokens associated with the HostPool. + * Registration token of the 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 registrationTokenList along with {@link Response}. + * @return represents a RegistrationInfo definition along with {@link Response}. */ - Response listRegistrationTokensWithResponse(Context context); + Response retrieveRegistrationTokenWithResponse(Context context); /** - * Operation to list the RegistrationTokens associated with the HostPool. + * Registration token of the host pool. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return registrationTokenList. + * @return represents a RegistrationInfo definition. */ - RegistrationTokenList listRegistrationTokens(); + RegistrationInfo retrieveRegistrationToken(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolList.java index 16238b8f04aa..f16930d7c4dc 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolList.java @@ -5,6 +5,7 @@ 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; @@ -14,19 +15,17 @@ import java.util.List; /** - * HostPoolList - * * List of HostPool definitions. */ @Fluent public final class HostPoolList implements JsonSerializable { /* - * List of HostPool definitions. + * The HostPool items on this page */ private List value; /* - * Link to the next page of results. + * The link to the next page of items */ private String nextLink; @@ -37,7 +36,7 @@ public HostPoolList() { } /** - * Get the value property: List of HostPool definitions. + * Get the value property: The HostPool items on this page. * * @return the value value. */ @@ -46,7 +45,7 @@ public List value() { } /** - * Set the value property: List of HostPool definitions. + * Set the value property: The HostPool items on this page. * * @param value the value value to set. * @return the HostPoolList object itself. @@ -57,7 +56,7 @@ public HostPoolList withValue(List value) { } /** - * Get the nextLink property: Link to the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,17 +64,33 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the HostPoolList object itself. + */ + public HostPoolList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model HostPoolList")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(HostPoolList.class); + /** * {@inheritDoc} */ @@ -83,6 +98,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -92,6 +108,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of HostPoolList 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 HostPoolList. */ public static HostPoolList fromJson(JsonReader jsonReader) throws IOException { 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..bb0d6f00146f 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 @@ -10,7 +10,6 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.HostPoolPatchProperties; import java.io.IOException; import java.util.Map; @@ -27,7 +26,7 @@ public final class HostPoolPatch extends ProxyResource { /* * HostPool properties that can be patched. */ - private HostPoolPatchProperties innerProperties; + private HostPoolPatchProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -76,12 +75,23 @@ public HostPoolPatch withTags(Map tags) { } /** - * Get the innerProperties property: HostPool properties that can be patched. + * Get the properties property: HostPool properties that can be patched. * - * @return the innerProperties value. + * @return the properties value. */ - private HostPoolPatchProperties innerProperties() { - return this.innerProperties; + public HostPoolPatchProperties properties() { + return this.properties; + } + + /** + * Set the properties property: HostPool properties that can be patched. + * + * @param properties the properties value to set. + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withProperties(HostPoolPatchProperties properties) { + this.properties = properties; + return this; } /** @@ -123,435 +133,14 @@ public String id() { return this.id; } - /** - * Get the friendlyName property: Friendly name of HostPool. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); - } - - /** - * Set the friendlyName property: Friendly name of HostPool. - * - * @param friendlyName the friendlyName value to set. - * @return the HostPoolPatch object itself. - */ - public HostPoolPatch withFriendlyName(String friendlyName) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPatchProperties(); - } - this.innerProperties().withFriendlyName(friendlyName); - return this; - } - - /** - * Get the description property: Description of HostPool. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Description of HostPool. - * - * @param description the description value to set. - * @return the HostPoolPatch object itself. - */ - public HostPoolPatch withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPatchProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the customRdpProperty property: Custom rdp property of HostPool. - * - * @return the customRdpProperty value. - */ - public String customRdpProperty() { - return this.innerProperties() == null ? null : this.innerProperties().customRdpProperty(); - } - - /** - * Set the customRdpProperty property: Custom rdp property of HostPool. - * - * @param customRdpProperty the customRdpProperty value to set. - * @return the HostPoolPatch object itself. - */ - public HostPoolPatch withCustomRdpProperty(String customRdpProperty) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPatchProperties(); - } - this.innerProperties().withCustomRdpProperty(customRdpProperty); - return this; - } - - /** - * Get the maxSessionLimit property: The max session limit of HostPool. - * - * @return the maxSessionLimit value. - */ - public Integer maxSessionLimit() { - return this.innerProperties() == null ? null : this.innerProperties().maxSessionLimit(); - } - - /** - * Set the maxSessionLimit property: The max session limit of HostPool. - * - * @param maxSessionLimit the maxSessionLimit value to set. - * @return the HostPoolPatch object itself. - */ - public HostPoolPatch withMaxSessionLimit(Integer maxSessionLimit) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPatchProperties(); - } - this.innerProperties().withMaxSessionLimit(maxSessionLimit); - return this; - } - - /** - * Get the personalDesktopAssignmentType property: PersonalDesktopAssignment type for HostPool. - * - * @return the personalDesktopAssignmentType value. - */ - public PersonalDesktopAssignmentType personalDesktopAssignmentType() { - return this.innerProperties() == null ? null : this.innerProperties().personalDesktopAssignmentType(); - } - - /** - * Set the personalDesktopAssignmentType property: PersonalDesktopAssignment type for HostPool. - * - * @param personalDesktopAssignmentType the personalDesktopAssignmentType value to set. - * @return the HostPoolPatch object itself. - */ - public HostPoolPatch - withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType personalDesktopAssignmentType) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPatchProperties(); - } - this.innerProperties().withPersonalDesktopAssignmentType(personalDesktopAssignmentType); - return this; - } - - /** - * Get the loadBalancerType property: The type of the load balancer. - * - * @return the loadBalancerType value. - */ - public LoadBalancerType loadBalancerType() { - return this.innerProperties() == null ? null : this.innerProperties().loadBalancerType(); - } - - /** - * Set the loadBalancerType property: The type of the load balancer. - * - * @param loadBalancerType the loadBalancerType value to set. - * @return the HostPoolPatch object itself. - */ - public HostPoolPatch withLoadBalancerType(LoadBalancerType loadBalancerType) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPatchProperties(); - } - this.innerProperties().withLoadBalancerType(loadBalancerType); - return this; - } - - /** - * Get the ring property: The ring number of HostPool. - * - * @return the ring value. - */ - public Integer ring() { - return this.innerProperties() == null ? null : this.innerProperties().ring(); - } - - /** - * Set the ring property: The ring number of HostPool. - * - * @param ring the ring value to set. - * @return the HostPoolPatch object itself. - */ - public HostPoolPatch withRing(Integer ring) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPatchProperties(); - } - this.innerProperties().withRing(ring); - return this; - } - - /** - * Get the validationEnvironment property: Is validation environment. - * - * @return the validationEnvironment value. - */ - public Boolean validationEnvironment() { - return this.innerProperties() == null ? null : this.innerProperties().validationEnvironment(); - } - - /** - * Set the validationEnvironment property: Is validation environment. - * - * @param validationEnvironment the validationEnvironment value to set. - * @return the HostPoolPatch object itself. - */ - public HostPoolPatch withValidationEnvironment(Boolean validationEnvironment) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPatchProperties(); - } - this.innerProperties().withValidationEnvironment(validationEnvironment); - return this; - } - - /** - * Get the registrationInfo property: The registration info of HostPool. - * - * @return the registrationInfo value. - */ - public RegistrationInfoPatch registrationInfo() { - return this.innerProperties() == null ? null : this.innerProperties().registrationInfo(); - } - - /** - * Set the registrationInfo property: The registration info of HostPool. - * - * @param registrationInfo the registrationInfo value to set. - * @return the HostPoolPatch object itself. - */ - public HostPoolPatch withRegistrationInfo(RegistrationInfoPatch registrationInfo) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPatchProperties(); - } - this.innerProperties().withRegistrationInfo(registrationInfo); - return this; - } - - /** - * Get the vmTemplate property: VM template for sessionhosts configuration within hostpool. - * - * @return the vmTemplate value. - */ - public String vmTemplate() { - return this.innerProperties() == null ? null : this.innerProperties().vmTemplate(); - } - - /** - * Set the vmTemplate property: VM template for sessionhosts configuration within hostpool. - * - * @param vmTemplate the vmTemplate value to set. - * @return the HostPoolPatch object itself. - */ - public HostPoolPatch withVmTemplate(String vmTemplate) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPatchProperties(); - } - this.innerProperties().withVmTemplate(vmTemplate); - return this; - } - - /** - * Get the ssoadfsAuthority property: URL to customer ADFS server for signing WVD SSO certificates. - * - * @return the ssoadfsAuthority value. - */ - public String ssoadfsAuthority() { - return this.innerProperties() == null ? null : this.innerProperties().ssoadfsAuthority(); - } - - /** - * Set the ssoadfsAuthority property: URL to customer ADFS server for signing WVD SSO certificates. - * - * @param ssoadfsAuthority the ssoadfsAuthority value to set. - * @return the HostPoolPatch object itself. - */ - public HostPoolPatch withSsoadfsAuthority(String ssoadfsAuthority) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPatchProperties(); - } - this.innerProperties().withSsoadfsAuthority(ssoadfsAuthority); - return this; - } - - /** - * Get the ssoClientId property: ClientId for the registered Relying Party used to issue WVD SSO certificates. - * - * @return the ssoClientId value. - */ - public String ssoClientId() { - return this.innerProperties() == null ? null : this.innerProperties().ssoClientId(); - } - - /** - * Set the ssoClientId property: ClientId for the registered Relying Party used to issue WVD SSO certificates. - * - * @param ssoClientId the ssoClientId value to set. - * @return the HostPoolPatch object itself. - */ - public HostPoolPatch withSsoClientId(String ssoClientId) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPatchProperties(); - } - this.innerProperties().withSsoClientId(ssoClientId); - return this; - } - - /** - * Get the ssoClientSecretKeyVaultPath property: Path to Azure KeyVault storing the secret used for communication to - * ADFS. - * - * @return the ssoClientSecretKeyVaultPath value. - */ - public String ssoClientSecretKeyVaultPath() { - return this.innerProperties() == null ? null : this.innerProperties().ssoClientSecretKeyVaultPath(); - } - - /** - * Set the ssoClientSecretKeyVaultPath property: Path to Azure KeyVault storing the secret used for communication to - * ADFS. - * - * @param ssoClientSecretKeyVaultPath the ssoClientSecretKeyVaultPath value to set. - * @return the HostPoolPatch object itself. - */ - public HostPoolPatch withSsoClientSecretKeyVaultPath(String ssoClientSecretKeyVaultPath) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPatchProperties(); - } - this.innerProperties().withSsoClientSecretKeyVaultPath(ssoClientSecretKeyVaultPath); - return this; - } - - /** - * Get the ssoSecretType property: The type of single sign on Secret Type. - * - * @return the ssoSecretType value. - */ - public SsoSecretType ssoSecretType() { - return this.innerProperties() == null ? null : this.innerProperties().ssoSecretType(); - } - - /** - * Set the ssoSecretType property: The type of single sign on Secret Type. - * - * @param ssoSecretType the ssoSecretType value to set. - * @return the HostPoolPatch object itself. - */ - public HostPoolPatch withSsoSecretType(SsoSecretType ssoSecretType) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPatchProperties(); - } - this.innerProperties().withSsoSecretType(ssoSecretType); - return this; - } - - /** - * Get the preferredAppGroupType property: The type of preferred application group type, default to Desktop - * Application Group. - * - * @return the preferredAppGroupType value. - */ - public PreferredAppGroupType preferredAppGroupType() { - return this.innerProperties() == null ? null : this.innerProperties().preferredAppGroupType(); - } - - /** - * Set the preferredAppGroupType property: The type of preferred application group type, default to Desktop - * Application Group. - * - * @param preferredAppGroupType the preferredAppGroupType value to set. - * @return the HostPoolPatch object itself. - */ - public HostPoolPatch withPreferredAppGroupType(PreferredAppGroupType preferredAppGroupType) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPatchProperties(); - } - this.innerProperties().withPreferredAppGroupType(preferredAppGroupType); - return this; - } - - /** - * Get the startVMOnConnect property: The flag to turn on/off StartVMOnConnect feature. - * - * @return the startVMOnConnect value. - */ - public Boolean startVMOnConnect() { - return this.innerProperties() == null ? null : this.innerProperties().startVMOnConnect(); - } - - /** - * Set the startVMOnConnect property: The flag to turn on/off StartVMOnConnect feature. - * - * @param startVMOnConnect the startVMOnConnect value to set. - * @return the HostPoolPatch object itself. - */ - public HostPoolPatch withStartVMOnConnect(Boolean startVMOnConnect) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPatchProperties(); - } - this.innerProperties().withStartVMOnConnect(startVMOnConnect); - return this; - } - - /** - * Get the publicNetworkAccess property: Enabled to allow this resource to be access from the public network. - * - * @return the publicNetworkAccess value. - */ - public HostpoolPublicNetworkAccess publicNetworkAccess() { - return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); - } - - /** - * Set the publicNetworkAccess property: Enabled to allow this resource to be access from the public network. - * - * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the HostPoolPatch object itself. - */ - public HostPoolPatch withPublicNetworkAccess(HostpoolPublicNetworkAccess publicNetworkAccess) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPatchProperties(); - } - this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); - return this; - } - - /** - * Get the agentUpdate property: The session host configuration for updating agent, monitoring agent, and stack - * component. - * - * @return the agentUpdate value. - */ - public AgentUpdatePatchProperties agentUpdate() { - return this.innerProperties() == null ? null : this.innerProperties().agentUpdate(); - } - - /** - * Set the agentUpdate property: The session host configuration for updating agent, monitoring agent, and stack - * component. - * - * @param agentUpdate the agentUpdate value to set. - * @return the HostPoolPatch object itself. - */ - public HostPoolPatch withAgentUpdate(AgentUpdatePatchProperties agentUpdate) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPatchProperties(); - } - this.innerProperties().withAgentUpdate(agentUpdate); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -562,7 +151,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -592,7 +181,7 @@ public static HostPoolPatch fromJson(JsonReader jsonReader) throws IOException { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedHostPoolPatch.tags = tags; } else if ("properties".equals(fieldName)) { - deserializedHostPoolPatch.innerProperties = HostPoolPatchProperties.fromJson(reader); + deserializedHostPoolPatch.properties = HostPoolPatchProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedHostPoolPatch.systemData = SystemData.fromJson(reader); } else { 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/models/HostPoolPatchProperties.java similarity index 72% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolPatchProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolPatchProperties.java index 170daf5df4b8..a6992650f679 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/models/HostPoolPatchProperties.java @@ -2,20 +2,13 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.desktopvirtualization.fluent.models; +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.models.AgentUpdatePatchProperties; -import com.azure.resourcemanager.desktopvirtualization.models.HostpoolPublicNetworkAccess; -import com.azure.resourcemanager.desktopvirtualization.models.LoadBalancerType; -import com.azure.resourcemanager.desktopvirtualization.models.PersonalDesktopAssignmentType; -import com.azure.resourcemanager.desktopvirtualization.models.PreferredAppGroupType; -import com.azure.resourcemanager.desktopvirtualization.models.RegistrationInfoPatch; -import com.azure.resourcemanager.desktopvirtualization.models.SsoSecretType; import java.io.IOException; /** @@ -113,6 +106,38 @@ public final class HostPoolPatchProperties implements JsonSerializable 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 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 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..d728659d5f27 --- /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. Default value is an empty string. + */ + 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. 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 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..30c667ca0d29 --- /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; + +/** + * Object containing control action for hostpool update. + */ +@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/HostPools.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPools.java index c76eb279bfe3..a76e65022641 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPools.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPools.java @@ -13,107 +13,107 @@ */ public interface HostPools { /** - * Get a host pool. + * List hostPools in subscription. * - * @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 host pool along with {@link Response}. + * @return list of HostPool definitions as paginated response with {@link PagedIterable}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String hostPoolName, Context context); + PagedIterable list(); /** - * Get a host pool. + * List hostPools in subscription. * - * @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 pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a host pool. + * @return list of HostPool definitions as paginated response with {@link PagedIterable}. */ - HostPool getByResourceGroup(String resourceGroupName, String hostPoolName); + PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** - * Remove a host pool. + * List hostPools. * * @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 force Force flag to delete sessionHost. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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}. + * @return list of HostPool definitions as paginated response with {@link PagedIterable}. */ - Response deleteWithResponse(String resourceGroupName, String hostPoolName, Boolean force, Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Remove a host pool. + * List hostPools. * * @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 pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HostPool definitions as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String hostPoolName); + PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, + Integer initialSkip, Context context); /** - * List hostPools. + * Get a host pool. * * @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 hostPoolList as paginated response with {@link PagedIterable}. + * @return a host pool along with {@link Response}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + Response getByResourceGroupWithResponse(String resourceGroupName, String hostPoolName, Context context); /** - * List hostPools. + * Get a host pool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @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 hostPoolList as paginated response with {@link PagedIterable}. + * @return a host pool. */ - PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, - Integer initialSkip, Context context); + HostPool getByResourceGroup(String resourceGroupName, String hostPoolName); /** - * List hostPools in subscription. + * Remove a host pool. * + * @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 force Force flag to delete sessionHost. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hostPoolList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - PagedIterable list(); + Response deleteWithResponse(String resourceGroupName, String hostPoolName, Boolean force, Context context); /** - * List hostPools in subscription. + * Remove a host pool. * - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @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 hostPoolList as paginated response with {@link PagedIterable}. */ - PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + void delete(String resourceGroupName, String hostPoolName); /** - * Registration token of the host pool. + * Operation to list the RegistrationTokens associated with the 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. @@ -121,25 +121,25 @@ PagedIterable listByResourceGroup(String resourceGroupName, Integer pa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 RegistrationInfo definition along with {@link Response}. + * @return list of RegistrationToken definitions along with {@link Response}. */ - Response retrieveRegistrationTokenWithResponse(String resourceGroupName, String hostPoolName, + Response listRegistrationTokensWithResponse(String resourceGroupName, String hostPoolName, Context context); /** - * Registration token of the host pool. + * Operation to list the RegistrationTokens associated with the 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 represents a RegistrationInfo definition. + * @return list of RegistrationToken definitions. */ - RegistrationInfo retrieveRegistrationToken(String resourceGroupName, String hostPoolName); + RegistrationTokenList listRegistrationTokens(String resourceGroupName, String hostPoolName); /** - * Operation to list the RegistrationTokens associated with the HostPool. + * Registration token of the host pool. * * @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. @@ -147,22 +147,22 @@ Response retrieveRegistrationTokenWithResponse(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return registrationTokenList along with {@link Response}. + * @return represents a RegistrationInfo definition along with {@link Response}. */ - Response listRegistrationTokensWithResponse(String resourceGroupName, String hostPoolName, + Response retrieveRegistrationTokenWithResponse(String resourceGroupName, String hostPoolName, Context context); /** - * Operation to list the RegistrationTokens associated with the HostPool. + * Registration token of the host pool. * * @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 registrationTokenList. + * @return represents a RegistrationInfo definition. */ - RegistrationTokenList listRegistrationTokens(String resourceGroupName, String hostPoolName); + RegistrationInfo retrieveRegistrationToken(String resourceGroupName, String hostPoolName); /** * Get a host pool. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostpoolPublicNetworkAccess.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostpoolPublicNetworkAccess.java index 6f4676aaf0c9..92886d060af0 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostpoolPublicNetworkAccess.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostpoolPublicNetworkAccess.java @@ -8,8 +8,7 @@ import java.util.Collection; /** - * Enabled allows this resource to be accessed from both public and private networks, Disabled allows this resource to - * only be accessed via private endpoints. + * Enabled to allow this resource to be access from the public network. */ public final class HostpoolPublicNetworkAccess extends ExpandableStringEnum { /** 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..a23dcda218b4 --- /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 type; + + /* + * 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 type property: The type of image session hosts use in the hostpool. + * + * @return the type value. + */ + public Type type() { + return this.type; + } + + /** + * Set the type property: The type of image session hosts use in the hostpool. + * + * @param type the type value to set. + * @return the ImageInfoPatchProperties object itself. + */ + public ImageInfoPatchProperties withType(Type type) { + this.type = type; + 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.type == null ? null : this.type.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.type = 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..a6a3422a4d4e --- /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 type; + + /* + * 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 type property: The type of image session hosts use in the hostpool. + * + * @return the type value. + */ + public Type type() { + return this.type; + } + + /** + * Set the type property: The type of image session hosts use in the hostpool. + * + * @param type the type value to set. + * @return the ImageInfoProperties object itself. + */ + public ImageInfoProperties withType(Type type) { + this.type = type; + 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 (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type 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.type == null ? null : this.type.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.type = 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..185ace53bdbb --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/InitiateSessionHostUpdates.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 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 The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..cf5cffbd9306 --- /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 the hostpool. + */ +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..e65d69ad3423 --- /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 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 version of the image. + * + * @return the exactVersion value. + */ + public String exactVersion() { + return this.exactVersion; + } + + /** + * Set the exactVersion property: The 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..b38f41371fa6 --- /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 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 version of the image. + * + * @return the exactVersion value. + */ + public String exactVersion() { + return this.exactVersion; + } + + /** + * Set the exactVersion property: The 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/MsixImages.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixImages.java index 1ebc9780d610..c96439e69686 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixImages.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixImages.java @@ -13,28 +13,32 @@ public interface MsixImages { /** * Expands and Lists MSIX packages in an Image, given the Image Path. + * This action uses incorrect Msix casing intentionally to match the previous APIs. * * @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 msixImageUri Object containing URI to MSIX Image. + * @param msixImageUri The msixImageUri parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expandMsixImageList as paginated response with {@link PagedIterable}. + * @return list of MSIX package properties retrieved from MSIX Image expansion as paginated response with + * {@link PagedIterable}. */ PagedIterable expand(String resourceGroupName, String hostPoolName, MsixImageUri msixImageUri); /** * Expands and Lists MSIX packages in an Image, given the Image Path. + * This action uses incorrect Msix casing intentionally to match the previous APIs. * * @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 msixImageUri Object containing URI to MSIX Image. + * @param msixImageUri The msixImageUri parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expandMsixImageList as paginated response with {@link PagedIterable}. + * @return list of MSIX package properties retrieved from MSIX Image expansion as paginated response with + * {@link PagedIterable}. */ PagedIterable expand(String resourceGroupName, String hostPoolName, MsixImageUri msixImageUri, Context context); 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..b84f89e78901 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 @@ -208,7 +208,7 @@ interface WithImagePath { */ interface WithPackageName { /** - * Specifies the packageName property: Package Name from appxmanifest.xml. . + * Specifies the packageName property: Package Name from appxmanifest.xml.. * * @param packageName Package Name from appxmanifest.xml. * @return the next definition stage. @@ -222,7 +222,7 @@ interface WithPackageName { interface WithPackageFamilyName { /** * Specifies the packageFamilyName property: Package Family Name from appxmanifest.xml. Contains Package - * Name and Publisher name. . + * Name and Publisher name.. * * @param packageFamilyName Package Family Name from appxmanifest.xml. Contains Package Name and Publisher * name. @@ -236,7 +236,7 @@ interface WithPackageFamilyName { */ interface WithDisplayName { /** - * Specifies the displayName property: User friendly Name to be displayed in the portal. . + * Specifies the displayName property: User friendly Name to be displayed in the portal.. * * @param displayName User friendly Name to be displayed in the portal. * @return the next definition stage. @@ -249,7 +249,7 @@ interface WithDisplayName { */ interface WithPackageRelativePath { /** - * Specifies the packageRelativePath property: Relative Path to the package inside the image. . + * Specifies the packageRelativePath property: Relative Path to the package inside the image.. * * @param packageRelativePath Relative Path to the package inside the image. * @return the next definition stage. @@ -275,7 +275,7 @@ interface WithIsRegularRegistration { */ interface WithIsActive { /** - * Specifies the isActive property: Make this version of the package the active one across the hostpool. . + * Specifies the isActive property: Make this version of the package the active one across the hostpool.. * * @param isActive Make this version of the package the active one across the hostpool. * @return the next definition stage. @@ -288,7 +288,7 @@ interface WithIsActive { */ interface WithPackageDependencies { /** - * Specifies the packageDependencies property: List of package dependencies. . + * Specifies the packageDependencies property: List of package dependencies.. * * @param packageDependencies List of package dependencies. * @return the next definition stage. @@ -301,7 +301,7 @@ 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. * @return the next definition stage. @@ -314,7 +314,7 @@ interface WithVersion { */ interface WithLastUpdated { /** - * Specifies the lastUpdated property: Date Package was last updated, found in the appxmanifest.xml. . + * Specifies the lastUpdated property: Date Package was last updated, found in the appxmanifest.xml.. * * @param lastUpdated Date Package was last updated, found in the appxmanifest.xml. * @return the next definition stage. @@ -327,7 +327,7 @@ interface WithLastUpdated { */ interface WithPackageApplications { /** - * Specifies the packageApplications property: List of package applications. . + * Specifies the packageApplications property: List of package applications.. * * @param packageApplications List of package applications. * @return the next definition stage. @@ -346,8 +346,7 @@ interface WithPackageApplications { /** * The template for MsixPackage update. */ - interface Update - extends UpdateStages.WithIsActive, UpdateStages.WithIsRegularRegistration, UpdateStages.WithDisplayName { + interface Update extends UpdateStages.WithProperties { /** * Executes the update request. * @@ -369,42 +368,16 @@ interface Update */ interface UpdateStages { /** - * The stage of the MsixPackage update allowing to specify isActive. + * The stage of the MsixPackage update allowing to specify properties. */ - interface WithIsActive { - /** - * Specifies the isActive property: Set a version of the package to be active across hostpool. . - * - * @param isActive Set a version of the package to be active across hostpool. - * @return the next definition stage. - */ - Update withIsActive(Boolean isActive); - } - - /** - * The stage of the MsixPackage update allowing to specify isRegularRegistration. - */ - interface WithIsRegularRegistration { - /** - * Specifies the isRegularRegistration property: Set Registration mode. Regular or Delayed.. - * - * @param isRegularRegistration Set Registration mode. Regular or Delayed. - * @return the next definition stage. - */ - Update withIsRegularRegistration(Boolean isRegularRegistration); - } - - /** - * The stage of the MsixPackage update allowing to specify displayName. - */ - interface WithDisplayName { + interface WithProperties { /** - * Specifies the displayName property: Display name for MSIX Package.. + * Specifies the properties property: Detailed properties for MSIX Package. * - * @param displayName Display name for MSIX Package. + * @param properties Detailed properties for MSIX Package. * @return the next definition stage. */ - Update withDisplayName(String displayName); + Update withProperties(MsixPackagePatchProperties properties); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageList.java index ab50d938508c..704cd1a31be3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageList.java @@ -5,6 +5,7 @@ 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; @@ -14,19 +15,17 @@ import java.util.List; /** - * MsixPackageList - * * List of MSIX Package definitions. */ @Fluent public final class MsixPackageList implements JsonSerializable { /* - * List of MSIX Package definitions. + * The MSIXPackage items on this page */ private List value; /* - * Link to the next page of results. + * The link to the next page of items */ private String nextLink; @@ -37,7 +36,7 @@ public MsixPackageList() { } /** - * Get the value property: List of MSIX Package definitions. + * Get the value property: The MSIXPackage items on this page. * * @return the value value. */ @@ -46,7 +45,7 @@ public List value() { } /** - * Set the value property: List of MSIX Package definitions. + * Set the value property: The MSIXPackage items on this page. * * @param value the value value to set. * @return the MsixPackageList object itself. @@ -57,7 +56,7 @@ public MsixPackageList withValue(List value) { } /** - * Get the nextLink property: Link to the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,17 +64,33 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the MsixPackageList object itself. + */ + public MsixPackageList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model MsixPackageList")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(MsixPackageList.class); + /** * {@inheritDoc} */ @@ -83,6 +98,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -92,6 +108,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of MsixPackageList 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 MsixPackageList. */ public static MsixPackageList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackagePatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackagePatch.java index c4e8e7957a2f..606e246ba22b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackagePatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackagePatch.java @@ -10,7 +10,6 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.MsixPackagePatchProperties; import java.io.IOException; /** @@ -21,7 +20,7 @@ public final class MsixPackagePatch extends ProxyResource { /* * Detailed properties for MSIX Package */ - private MsixPackagePatchProperties innerProperties; + private MsixPackagePatchProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -50,12 +49,23 @@ public MsixPackagePatch() { } /** - * Get the innerProperties property: Detailed properties for MSIX Package. + * Get the properties property: Detailed properties for MSIX Package. * - * @return the innerProperties value. + * @return the properties value. */ - private MsixPackagePatchProperties innerProperties() { - return this.innerProperties; + public MsixPackagePatchProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Detailed properties for MSIX Package. + * + * @param properties the properties value to set. + * @return the MsixPackagePatch object itself. + */ + public MsixPackagePatch withProperties(MsixPackagePatchProperties properties) { + this.properties = properties; + return this; } /** @@ -97,83 +107,14 @@ public String id() { return this.id; } - /** - * Get the isActive property: Set a version of the package to be active across hostpool. - * - * @return the isActive value. - */ - public Boolean isActive() { - return this.innerProperties() == null ? null : this.innerProperties().isActive(); - } - - /** - * Set the isActive property: Set a version of the package to be active across hostpool. - * - * @param isActive the isActive value to set. - * @return the MsixPackagePatch object itself. - */ - public MsixPackagePatch withIsActive(Boolean isActive) { - if (this.innerProperties() == null) { - this.innerProperties = new MsixPackagePatchProperties(); - } - this.innerProperties().withIsActive(isActive); - return this; - } - - /** - * Get the isRegularRegistration property: Set Registration mode. Regular or Delayed. - * - * @return the isRegularRegistration value. - */ - public Boolean isRegularRegistration() { - return this.innerProperties() == null ? null : this.innerProperties().isRegularRegistration(); - } - - /** - * Set the isRegularRegistration property: Set Registration mode. Regular or Delayed. - * - * @param isRegularRegistration the isRegularRegistration value to set. - * @return the MsixPackagePatch object itself. - */ - public MsixPackagePatch withIsRegularRegistration(Boolean isRegularRegistration) { - if (this.innerProperties() == null) { - this.innerProperties = new MsixPackagePatchProperties(); - } - this.innerProperties().withIsRegularRegistration(isRegularRegistration); - return this; - } - - /** - * Get the displayName property: Display name for MSIX Package. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: Display name for MSIX Package. - * - * @param displayName the displayName value to set. - * @return the MsixPackagePatch object itself. - */ - public MsixPackagePatch withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new MsixPackagePatchProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -183,7 +124,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -210,7 +151,7 @@ public static MsixPackagePatch fromJson(JsonReader jsonReader) throws IOExceptio } else if ("type".equals(fieldName)) { deserializedMsixPackagePatch.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedMsixPackagePatch.innerProperties = MsixPackagePatchProperties.fromJson(reader); + deserializedMsixPackagePatch.properties = MsixPackagePatchProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedMsixPackagePatch.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackagePatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackagePatchProperties.java similarity index 98% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackagePatchProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackagePatchProperties.java index d08a5b947167..a263c2c72109 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackagePatchProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackagePatchProperties.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.desktopvirtualization.fluent.models; +package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackages.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackages.java index 4cce380cfb45..e13a38795bf4 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackages.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackages.java @@ -13,35 +13,36 @@ */ public interface MsixPackages { /** - * Get a msixpackage. + * List MSIX packages in 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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a msixpackage along with {@link Response}. + * @return list of MSIX Package definitions as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String resourceGroupName, String hostPoolName, String msixPackageFullName, - Context context); + PagedIterable list(String resourceGroupName, String hostPoolName); /** - * Get a msixpackage. + * List MSIX packages in 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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a msixpackage. + * @return list of MSIX Package definitions as paginated response with {@link PagedIterable}. */ - MsixPackage get(String resourceGroupName, String hostPoolName, String msixPackageFullName); + PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** - * Remove an MSIX Package. + * Get a msixpackage. * * @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. @@ -50,13 +51,13 @@ Response getWithResponse(String resourceGroupName, String hostPoolN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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}. + * @return a msixpackage along with {@link Response}. */ - Response deleteWithResponse(String resourceGroupName, String hostPoolName, String msixPackageFullName, + Response getWithResponse(String resourceGroupName, String hostPoolName, String msixPackageFullName, Context context); /** - * Remove an MSIX Package. + * Get a msixpackage. * * @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. @@ -64,37 +65,36 @@ Response deleteWithResponse(String resourceGroupName, String hostPoolName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a msixpackage. */ - void delete(String resourceGroupName, String hostPoolName, String msixPackageFullName); + MsixPackage get(String resourceGroupName, String hostPoolName, String msixPackageFullName); /** - * List MSIX packages in hostpool. + * Remove an MSIX Package. * * @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 msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return msixPackageList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - PagedIterable list(String resourceGroupName, String hostPoolName); + Response deleteWithResponse(String resourceGroupName, String hostPoolName, String msixPackageFullName, + Context context); /** - * List MSIX packages in hostpool. + * Remove an MSIX Package. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return msixPackageList as paginated response with {@link PagedIterable}. */ - PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context); + void delete(String resourceGroupName, String hostPoolName, String msixPackageFullName); /** * Get a msixpackage. 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/Operations.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Operations.java index 85aae6082c58..57bd440d79d5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Operations.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Operations.java @@ -12,22 +12,24 @@ */ public interface Operations { /** - * List all of the available operations the Desktop Virtualization resource provider supports. + * List the operations for the provider. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** - * List all of the available operations the Desktop Virtualization resource provider supports. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/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/PrivateEndpointConnection.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnection.java index 40b8a7b0bdf3..f16b13a56e04 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnection.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnection.java @@ -12,17 +12,16 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionProperties; import java.io.IOException; -import java.util.List; /** * The private endpoint connection resource. */ @Fluent -public class PrivateEndpointConnection extends ProxyResource { +public final class PrivateEndpointConnection extends ProxyResource { /* * Resource properties. */ - private PrivateEndpointConnectionProperties innerProperties; + private PrivateEndpointConnectionProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -51,22 +50,22 @@ public PrivateEndpointConnection() { } /** - * Get the innerProperties property: Resource properties. + * Get the properties property: Resource properties. * - * @return the innerProperties value. + * @return the properties value. */ - private PrivateEndpointConnectionProperties innerProperties() { - return this.innerProperties; + public PrivateEndpointConnectionProperties properties() { + return this.properties; } /** - * Set the innerProperties property: Resource properties. + * Set the properties property: Resource properties. * - * @param innerProperties the innerProperties value to set. + * @param properties the properties value to set. * @return the PrivateEndpointConnection object itself. */ - PrivateEndpointConnection withInnerProperties(PrivateEndpointConnectionProperties innerProperties) { - this.innerProperties = innerProperties; + public PrivateEndpointConnection withProperties(PrivateEndpointConnectionProperties properties) { + this.properties = properties; return this; } @@ -79,17 +78,6 @@ public SystemData systemData() { return this.systemData; } - /** - * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @param systemData the systemData value to set. - * @return the PrivateEndpointConnection object itself. - */ - PrivateEndpointConnection withSystemData(SystemData systemData) { - this.systemData = systemData; - return this; - } - /** * Get the type property: The type of the resource. * @@ -120,81 +108,14 @@ public String id() { return this.id; } - /** - * Get the groupIds property: The group ids for the private endpoint resource. - * - * @return the groupIds value. - */ - public List groupIds() { - return this.innerProperties() == null ? null : this.innerProperties().groupIds(); - } - - /** - * Get the privateEndpoint property: The private endpoint resource. - * - * @return the privateEndpoint value. - */ - public PrivateEndpoint privateEndpoint() { - return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); - } - - /** - * Set the privateEndpoint property: The private endpoint resource. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the PrivateEndpointConnection object itself. - */ - public PrivateEndpointConnection withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateEndpointConnectionProperties(); - } - this.innerProperties().withPrivateEndpoint(privateEndpoint); - return this; - } - - /** - * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @return the privateLinkServiceConnectionState value. - */ - public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); - } - - /** - * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. - * @return the PrivateEndpointConnection object itself. - */ - public PrivateEndpointConnection - withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateEndpointConnectionProperties(); - } - this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the private endpoint connection resource. - * - * @return the provisioningState value. - */ - public PrivateEndpointConnectionProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -204,7 +125,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -231,7 +152,7 @@ public static PrivateEndpointConnection fromJson(JsonReader jsonReader) throws I } else if ("type".equals(fieldName)) { deserializedPrivateEndpointConnection.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedPrivateEndpointConnection.innerProperties + deserializedPrivateEndpointConnection.properties = PrivateEndpointConnectionProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedPrivateEndpointConnection.systemData = SystemData.fromJson(reader); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionListResultWithSystemData.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionListResultWithSystemData.java index 93861715e483..82241ee223c4 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionListResultWithSystemData.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionListResultWithSystemData.java @@ -5,6 +5,7 @@ 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; @@ -14,18 +15,18 @@ import java.util.List; /** - * List of private endpoint connection associated with the specified storage account. + * List of private endpoint connection associated with the specified HostPool. */ @Fluent public final class PrivateEndpointConnectionListResultWithSystemData implements JsonSerializable { /* - * Array of private endpoint connections + * The PrivateEndpointConnectionWithSystemData items on this page */ private List value; /* - * Link to the next page of results. + * The link to the next page of items */ private String nextLink; @@ -36,7 +37,7 @@ public PrivateEndpointConnectionListResultWithSystemData() { } /** - * Get the value property: Array of private endpoint connections. + * Get the value property: The PrivateEndpointConnectionWithSystemData items on this page. * * @return the value value. */ @@ -45,7 +46,7 @@ public List value() { } /** - * Set the value property: Array of private endpoint connections. + * Set the value property: The PrivateEndpointConnectionWithSystemData items on this page. * * @param value the value value to set. * @return the PrivateEndpointConnectionListResultWithSystemData object itself. @@ -57,7 +58,7 @@ public List value() { } /** - * Get the nextLink property: Link to the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,17 +66,35 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the PrivateEndpointConnectionListResultWithSystemData object itself. + */ + public PrivateEndpointConnectionListResultWithSystemData withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model PrivateEndpointConnectionListResultWithSystemData")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER + = new ClientLogger(PrivateEndpointConnectionListResultWithSystemData.class); + /** * {@inheritDoc} */ @@ -83,6 +102,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -92,6 +112,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of PrivateEndpointConnectionListResultWithSystemData 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 PrivateEndpointConnectionListResultWithSystemData. */ public static PrivateEndpointConnectionListResultWithSystemData fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnections.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnections.java index 9089fca12c53..a0ab0b2c9ddf 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnections.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnections.java @@ -7,257 +7,242 @@ 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.PrivateEndpointConnectionWithSystemDataInner; /** * Resource collection API of PrivateEndpointConnections. */ public interface PrivateEndpointConnections { /** - * List private endpoint connections. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @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 list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * @return a PrivateEndpointConnectionWithSystemData as paginated response with {@link PagedIterable}. */ - PagedIterable listByWorkspace(String resourceGroupName, - String workspaceName); + PagedIterable listByHostPool(String resourceGroupName, + String hostPoolName); /** - * List private endpoint connections. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * @return a PrivateEndpointConnectionWithSystemData as paginated response with {@link PagedIterable}. */ - PagedIterable listByWorkspace(String resourceGroupName, - String workspaceName, Context context); + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection along with {@link Response}. + * @return a PrivateEndpointConnectionWithSystemData along with {@link Response}. */ - Response getByWorkspaceWithResponse(String resourceGroupName, - String workspaceName, String privateEndpointConnectionName, Context context); + Response getByHostPoolWithResponse(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, Context context); /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return a PrivateEndpointConnectionWithSystemData. */ - PrivateEndpointConnectionWithSystemData getByWorkspace(String resourceGroupName, String workspaceName, + PrivateEndpointConnectionWithSystemData getByHostPool(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName); /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the Private Endpoint Connection resource along with {@link Response}. */ - Response deleteByWorkspaceWithResponse(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName, Context context); + Response updateByHostPoolWithResponse(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection, Context context); /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. */ - void deleteByWorkspace(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + PrivateEndpointConnectionWithSystemData updateByHostPool(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName, PrivateEndpointConnectionWithSystemDataInner connection); /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response}. + * @return the {@link Response}. */ - Response updateByWorkspaceWithResponse(String resourceGroupName, - String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnection connection, - Context context); + Response deleteByHostPoolWithResponse(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName, Context context); /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. */ - PrivateEndpointConnectionWithSystemData updateByWorkspace(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName, PrivateEndpointConnection connection); + void deleteByHostPool(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName); /** - * List private endpoint connections associated with hostpool. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * @return a PrivateEndpointConnectionWithSystemData as paginated response with {@link PagedIterable}. */ - PagedIterable listByHostPool(String resourceGroupName, - String hostPoolName); + PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName); /** - * List private endpoint connections associated with hostpool. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. + * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * @return a PrivateEndpointConnectionWithSystemData as paginated response with {@link PagedIterable}. */ - PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName, Context context); /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection along with {@link Response}. + * @return a PrivateEndpointConnectionWithSystemData along with {@link Response}. */ - Response getByHostPoolWithResponse(String resourceGroupName, - String hostPoolName, String privateEndpointConnectionName, Context context); + Response getByWorkspaceWithResponse(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, Context context); /** - * Get a private endpoint connection. + * Get a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return a PrivateEndpointConnectionWithSystemData. */ - PrivateEndpointConnectionWithSystemData getByHostPool(String resourceGroupName, String hostPoolName, + PrivateEndpointConnectionWithSystemData getByWorkspace(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the Private Endpoint Connection resource along with {@link Response}. */ - Response deleteByHostPoolWithResponse(String resourceGroupName, String hostPoolName, - String privateEndpointConnectionName, Context context); + Response updateByWorkspaceWithResponse(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection, Context context); /** - * Remove a connection. + * Create a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. + * @param connection Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. */ - void deleteByHostPool(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName); + PrivateEndpointConnectionWithSystemData updateByWorkspace(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionWithSystemDataInner connection); /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response}. + * @return the {@link Response}. */ - Response updateByHostPoolWithResponse(String resourceGroupName, - String hostPoolName, String privateEndpointConnectionName, PrivateEndpointConnection connection, - Context context); + Response deleteByWorkspaceWithResponse(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, Context context); /** - * Approve or reject a private endpoint connection. + * Delete a PrivateEndpointConnectionWithSystemData. * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param connection Object containing the updated connection. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name parameter for private endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. */ - PrivateEndpointConnectionWithSystemData updateByHostPool(String resourceGroupName, String hostPoolName, - String privateEndpointConnectionName, PrivateEndpointConnection connection); + void deleteByWorkspace(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResource.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResource.java index 7244a9030ea3..0e9a42db89be 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResource.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResource.java @@ -6,7 +6,6 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateLinkResourceInner; -import java.util.List; /** * An immutable client-side representation of PrivateLinkResource. @@ -34,32 +33,18 @@ public interface PrivateLinkResource { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the groupId property: The private link resource group id. + * Gets the properties property: Resource properties. * - * @return the groupId value. + * @return the properties value. */ - String groupId(); + PrivateLinkResourceProperties properties(); /** - * Gets the requiredMembers property: The private link resource required member names. - * - * @return the requiredMembers value. - */ - List requiredMembers(); - - /** - * Gets the requiredZoneNames property: The private link resource Private link DNS zone name. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the requiredZoneNames value. + * @return the systemData value. */ - List requiredZoneNames(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateLinkResourceInner object. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResourceListResult.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResourceListResult.java index acfe449dc07e..ae0bfb2ef03e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResourceListResult.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResourceListResult.java @@ -5,6 +5,7 @@ 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; @@ -19,12 +20,12 @@ @Fluent public final class PrivateLinkResourceListResult implements JsonSerializable { /* - * Array of private link resources + * The PrivateLinkResource items on this page */ private List value; /* - * Link to the next page of results. + * The link to the next page of items */ private String nextLink; @@ -35,7 +36,7 @@ public PrivateLinkResourceListResult() { } /** - * Get the value property: Array of private link resources. + * Get the value property: The PrivateLinkResource items on this page. * * @return the value value. */ @@ -44,7 +45,7 @@ public List value() { } /** - * Set the value property: Array of private link resources. + * Set the value property: The PrivateLinkResource items on this page. * * @param value the value value to set. * @return the PrivateLinkResourceListResult object itself. @@ -55,7 +56,7 @@ public PrivateLinkResourceListResult withValue(List va } /** - * Get the nextLink property: Link to the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,17 +64,34 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the PrivateLinkResourceListResult object itself. + */ + public PrivateLinkResourceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model PrivateLinkResourceListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourceListResult.class); + /** * {@inheritDoc} */ @@ -81,6 +99,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -90,6 +109,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of PrivateLinkResourceListResult 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 PrivateLinkResourceListResult. */ public static PrivateLinkResourceListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateLinkResourceProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResourceProperties.java similarity index 98% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateLinkResourceProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResourceProperties.java index 301b26108ac8..3c1f188caf94 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateLinkResourceProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResourceProperties.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.desktopvirtualization.fluent.models; +package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResources.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResources.java index e76f746ceb9c..fdd1d832c2ba 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResources.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResources.java @@ -12,22 +12,22 @@ */ public interface PrivateLinkResources { /** - * List the private link resources available for this workspace. + * List the private link resources available for this hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @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 list of private link resources as paginated response with {@link PagedIterable}. */ - PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); /** - * List the private link resources available for this workspace. + * List the private link resources available for this hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -37,26 +37,26 @@ public interface PrivateLinkResources { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of private link resources as paginated response with {@link PagedIterable}. */ - PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Integer pageSize, + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** - * List the private link resources available for this hostpool. + * List the private link resources available for this workspace. * * @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 workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of private link resources as paginated response with {@link PagedIterable}. */ - PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); /** - * List the private link resources available for this hostpool. + * List the private link resources available for this workspace. * * @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 workspaceName The name of the workspace. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -66,6 +66,6 @@ PagedIterable listByWorkspace(String resourceGroupName, Str * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of private link resources as paginated response with {@link PagedIterable}. */ - PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, Integer pageSize, + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); } 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/PublicNetworkAccess.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PublicNetworkAccess.java index f7ad10939287..e35bb1742457 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PublicNetworkAccess.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PublicNetworkAccess.java @@ -8,8 +8,7 @@ import java.util.Collection; /** - * Enabled allows this resource to be accessed from both public and private networks, Disabled allows this resource to - * only be accessed via private endpoints. + * Enabled to allow this resource to be access from the public network. */ public final class PublicNetworkAccess extends ExpandableStringEnum { /** 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..aa6b07f7f390 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PublicUdp.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; + +/** + * Public UDP Connection Settings. + */ +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/RelayUdp.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RelayUdp.java new file mode 100644 index 000000000000..c34870561840 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RelayUdp.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; + +/** + * Relay UDP Connection Settings. + */ +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 deleted file mode 100644 index 9aedb9b65aec..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySet.java +++ /dev/null @@ -1,373 +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.management.Resource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.Map; - -/** - * The resource model definition containing the full set of allowed properties for a resource. Except properties bag, - * there cannot be a top level property outside of this set. - */ -@Fluent -public class ResourceModelWithAllowedPropertySet extends Resource { - /* - * The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed - * by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is - * removed from the template since it is managed by another resource. - */ - private String managedBy; - - /* - * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. - * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist - * this value. - */ - private String kind; - - /* - * The etag field is *not* required. If it is provided in the response body, it must also be provided as a header - * per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested - * resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section - * 14.26), and If-Range (section 14.27) header fields. - */ - private String etag; - - /* - * The identity property. - */ - private ResourceModelWithAllowedPropertySetIdentity identity; - - /* - * The sku property. - */ - private ResourceModelWithAllowedPropertySetSku sku; - - /* - * The plan property. - */ - private ResourceModelWithAllowedPropertySetPlan plan; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of ResourceModelWithAllowedPropertySet class. - */ - public ResourceModelWithAllowedPropertySet() { - } - - /** - * Get the managedBy property: The fully qualified resource ID of the resource that manages this resource. Indicates - * if this resource is managed by another Azure resource. If this is present, complete mode deployment will not - * delete the resource if it is removed from the template since it is managed by another resource. - * - * @return the managedBy value. - */ - public String managedBy() { - return this.managedBy; - } - - /** - * Set the managedBy property: The fully qualified resource ID of the resource that manages this resource. Indicates - * if this resource is managed by another Azure resource. If this is present, complete mode deployment will not - * delete the resource if it is removed from the template since it is managed by another resource. - * - * @param managedBy the managedBy value to set. - * @return the ResourceModelWithAllowedPropertySet object itself. - */ - public ResourceModelWithAllowedPropertySet withManagedBy(String managedBy) { - this.managedBy = managedBy; - return this; - } - - /** - * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of - * the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must - * validate and persist this value. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of - * the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must - * validate and persist this value. - * - * @param kind the kind value to set. - * @return the ResourceModelWithAllowedPropertySet object itself. - */ - public ResourceModelWithAllowedPropertySet withKind(String kind) { - this.kind = kind; - return this; - } - - /** - * Get the etag property: The etag field is *not* required. If it is provided in the response body, it must also be - * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from - * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), - * If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: The etag field is *not* required. If it is provided in the response body, it must also be - * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from - * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), - * If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - * - * @param etag the etag value to set. - * @return the ResourceModelWithAllowedPropertySet object itself. - */ - ResourceModelWithAllowedPropertySet withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the identity property: The identity property. - * - * @return the identity value. - */ - public ResourceModelWithAllowedPropertySetIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: The identity property. - * - * @param identity the identity value to set. - * @return the ResourceModelWithAllowedPropertySet object itself. - */ - public ResourceModelWithAllowedPropertySet withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the sku property: The sku property. - * - * @return the sku value. - */ - public ResourceModelWithAllowedPropertySetSku sku() { - return this.sku; - } - - /** - * Set the sku property: The sku property. - * - * @param sku the sku value to set. - * @return the ResourceModelWithAllowedPropertySet object itself. - */ - public ResourceModelWithAllowedPropertySet withSku(ResourceModelWithAllowedPropertySetSku sku) { - this.sku = sku; - return this; - } - - /** - * Get the plan property: The plan property. - * - * @return the plan value. - */ - public ResourceModelWithAllowedPropertySetPlan plan() { - return this.plan; - } - - /** - * Set the plan property: The plan property. - * - * @param plan the plan value to set. - * @return the ResourceModelWithAllowedPropertySet object itself. - */ - public ResourceModelWithAllowedPropertySet withPlan(ResourceModelWithAllowedPropertySetPlan plan) { - this.plan = plan; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @param systemData the systemData value to set. - * @return the ResourceModelWithAllowedPropertySet object itself. - */ - ResourceModelWithAllowedPropertySet withSystemData(SystemData systemData) { - this.systemData = systemData; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public ResourceModelWithAllowedPropertySet withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ResourceModelWithAllowedPropertySet withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - if (sku() != null) { - sku().validate(); - } - if (plan() != null) { - plan().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("managedBy", this.managedBy); - jsonWriter.writeStringField("kind", this.kind); - jsonWriter.writeJsonField("identity", this.identity); - jsonWriter.writeJsonField("sku", this.sku); - jsonWriter.writeJsonField("plan", this.plan); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceModelWithAllowedPropertySet from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceModelWithAllowedPropertySet 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 ResourceModelWithAllowedPropertySet. - */ - public static ResourceModelWithAllowedPropertySet fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceModelWithAllowedPropertySet deserializedResourceModelWithAllowedPropertySet - = new ResourceModelWithAllowedPropertySet(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySet.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySet.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySet.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySet.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedResourceModelWithAllowedPropertySet.withTags(tags); - } else if ("managedBy".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySet.managedBy = reader.getString(); - } else if ("kind".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySet.kind = reader.getString(); - } else if ("etag".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySet.etag = reader.getString(); - } else if ("identity".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySet.identity - = ResourceModelWithAllowedPropertySetIdentity.fromJson(reader); - } else if ("sku".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySet.sku - = ResourceModelWithAllowedPropertySetSku.fromJson(reader); - } else if ("plan".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySet.plan - = ResourceModelWithAllowedPropertySetPlan.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedResourceModelWithAllowedPropertySet.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedResourceModelWithAllowedPropertySet; - }); - } -} 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/ResourceProviderOperationList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperationList.java deleted file mode 100644 index 023b8106aa55..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperationList.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.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.ResourceProviderOperationInner; -import java.io.IOException; -import java.util.List; - -/** - * Result of the request to list operations. - */ -@Fluent -public final class ResourceProviderOperationList implements JsonSerializable { - /* - * List of operations supported by this resource provider. - */ - private List value; - - /* - * Link to the next page of results. - */ - private String nextLink; - - /** - * Creates an instance of ResourceProviderOperationList class. - */ - public ResourceProviderOperationList() { - } - - /** - * Get the value property: List of operations supported by this resource provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of operations supported by this resource provider. - * - * @param value the value value to set. - * @return the ResourceProviderOperationList object itself. - */ - public ResourceProviderOperationList 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 ResourceProviderOperationList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceProviderOperationList 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 ResourceProviderOperationList. - */ - public static ResourceProviderOperationList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceProviderOperationList deserializedResourceProviderOperationList - = new ResourceProviderOperationList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ResourceProviderOperationInner.fromJson(reader1)); - deserializedResourceProviderOperationList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedResourceProviderOperationList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedResourceProviderOperationList; - }); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperationListResult.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperationListResult.java new file mode 100644 index 000000000000..958f89394e8b --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperationListResult.java @@ -0,0 +1,139 @@ +// 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 com.azure.resourcemanager.desktopvirtualization.fluent.models.ResourceProviderOperationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Fluent +public final class ResourceProviderOperationListResult + implements JsonSerializable { + /* + * The ResourceProviderOperation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ResourceProviderOperationListResult class. + */ + public ResourceProviderOperationListResult() { + } + + /** + * Get the value property: The ResourceProviderOperation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The ResourceProviderOperation items on this page. + * + * @param value the value value to set. + * @return the ResourceProviderOperationListResult object itself. + */ + public ResourceProviderOperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ResourceProviderOperationListResult object itself. + */ + public ResourceProviderOperationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ResourceProviderOperationListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceProviderOperationListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceProviderOperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceProviderOperationListResult 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 ResourceProviderOperationListResult. + */ + public static ResourceProviderOperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceProviderOperationListResult deserializedResourceProviderOperationListResult + = new ResourceProviderOperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ResourceProviderOperationInner.fromJson(reader1)); + deserializedResourceProviderOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedResourceProviderOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceProviderOperationListResult; + }); + } +} 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 tags(); /** - * Gets the managedBy property: The fully qualified resource ID of the resource that manages this resource. - * Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment - * will not delete the resource if it is removed from the template since it is managed by another resource. + * Gets the identity property: The managed service identities assigned to this resource. * - * @return the managedBy value. + * @return the identity value. */ - String managedBy(); + ManagedServiceIdentity identity(); + + /** + * Gets the etag property: If etag is provided in the response body, it may also be provided as a header per the + * normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. + * HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), + * and If-Range (section 14.27) header fields. + * + * @return the etag value. + */ + String etag(); /** * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of - * the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must * validate and persist this value. * * @return the kind value. @@ -69,35 +77,27 @@ public interface ScalingPlan { String kind(); /** - * Gets the etag property: The etag field is *not* required. If it is provided in the response body, it must also be - * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from - * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), - * If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + * Gets the managedBy property: The fully qualified resource ID of the resource that manages this resource. + * Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment + * will not delete the resource if it is removed from the template since it is managed by another resource. * - * @return the etag value. + * @return the managedBy value. */ - String etag(); + String managedBy(); /** - * Gets the identity property: The identity property. + * Gets the plan property: Details of the resource plan. * - * @return the identity value. + * @return the plan value. */ - ResourceModelWithAllowedPropertySetIdentity identity(); + Plan plan(); /** - * Gets the sku property: The sku property. + * Gets the sku property: The SKU (Stock Keeping Unit) assigned to this resource. * * @return the sku value. */ - ResourceModelWithAllowedPropertySetSku sku(); - - /** - * Gets the plan property: The plan property. - * - * @return the plan value. - */ - ResourceModelWithAllowedPropertySetPlan plan(); + Sku sku(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -259,8 +259,8 @@ interface WithTimeZone { * to be created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithTags, DefinitionStages.WithManagedBy, DefinitionStages.WithKind, - DefinitionStages.WithIdentity, DefinitionStages.WithSku, DefinitionStages.WithPlan, + extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithKind, + DefinitionStages.WithManagedBy, DefinitionStages.WithPlan, DefinitionStages.WithSku, DefinitionStages.WithDescription, DefinitionStages.WithFriendlyName, DefinitionStages.WithHostPoolType, DefinitionStages.WithExclusionTag, DefinitionStages.WithSchedules, DefinitionStages.WithHostPoolReferences { /** @@ -293,21 +293,16 @@ interface WithTags { } /** - * The stage of the ScalingPlan definition allowing to specify managedBy. + * The stage of the ScalingPlan definition allowing to specify identity. */ - interface WithManagedBy { + interface WithIdentity { /** - * Specifies the managedBy property: The fully qualified resource ID of the resource that manages this - * resource. Indicates if this resource is managed by another Azure resource. If this is present, complete - * mode deployment will not delete the resource if it is removed from the template since it is managed by - * another resource.. + * Specifies the identity property: The managed service identities assigned to this resource.. * - * @param managedBy The fully qualified resource ID of the resource that manages this resource. Indicates if - * this resource is managed by another Azure resource. If this is present, complete mode deployment will not - * delete the resource if it is removed from the template since it is managed by another resource. + * @param identity The managed service identities assigned to this resource. * @return the next definition stage. */ - WithCreate withManagedBy(String managedBy); + WithCreate withIdentity(ManagedServiceIdentity identity); } /** @@ -316,11 +311,11 @@ interface WithManagedBy { interface WithKind { /** * Specifies the kind property: Metadata used by portal/tooling/etc to render different UX experiences for - * resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the + * resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the * resource provider must validate and persist this value.. * * @param kind Metadata used by portal/tooling/etc to render different UX experiences for resources of the - * same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must * validate and persist this value. * @return the next definition stage. */ @@ -328,42 +323,47 @@ interface WithKind { } /** - * The stage of the ScalingPlan definition allowing to specify identity. + * The stage of the ScalingPlan definition allowing to specify managedBy. */ - interface WithIdentity { + interface WithManagedBy { /** - * Specifies the identity property: The identity property.. + * Specifies the managedBy property: The fully qualified resource ID of the resource that manages this + * resource. Indicates if this resource is managed by another Azure resource. If this is present, complete + * mode deployment will not delete the resource if it is removed from the template since it is managed by + * another resource.. * - * @param identity The identity property. + * @param managedBy The fully qualified resource ID of the resource that manages this resource. Indicates if + * this resource is managed by another Azure resource. If this is present, complete mode deployment will not + * delete the resource if it is removed from the template since it is managed by another resource. * @return the next definition stage. */ - WithCreate withIdentity(ResourceModelWithAllowedPropertySetIdentity identity); + WithCreate withManagedBy(String managedBy); } /** - * The stage of the ScalingPlan definition allowing to specify sku. + * The stage of the ScalingPlan definition allowing to specify plan. */ - interface WithSku { + interface WithPlan { /** - * Specifies the sku property: The sku property.. + * Specifies the plan property: Details of the resource plan.. * - * @param sku The sku property. + * @param plan Details of the resource plan. * @return the next definition stage. */ - WithCreate withSku(ResourceModelWithAllowedPropertySetSku sku); + WithCreate withPlan(Plan plan); } /** - * The stage of the ScalingPlan definition allowing to specify plan. + * The stage of the ScalingPlan definition allowing to specify sku. */ - interface WithPlan { + interface WithSku { /** - * Specifies the plan property: The plan property.. + * Specifies the sku property: The SKU (Stock Keeping Unit) assigned to this resource.. * - * @param plan The plan property. + * @param sku The SKU (Stock Keeping Unit) assigned to this resource. * @return the next definition stage. */ - WithCreate withPlan(ResourceModelWithAllowedPropertySetPlan plan); + WithCreate withSku(Sku sku); } /** @@ -455,9 +455,7 @@ interface WithHostPoolReferences { /** * The template for ScalingPlan update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithDescription, UpdateStages.WithFriendlyName, - UpdateStages.WithTimeZone, UpdateStages.WithExclusionTag, UpdateStages.WithSchedules, - UpdateStages.WithHostPoolReferences { + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { /** * Executes the update request. * @@ -492,81 +490,16 @@ interface WithTags { } /** - * The stage of the ScalingPlan update allowing to specify description. + * The stage of the ScalingPlan update allowing to specify properties. */ - interface WithDescription { + interface WithProperties { /** - * Specifies the description property: Description of scaling plan.. + * Specifies the properties property: Detailed properties for scaling plan. * - * @param description Description of scaling plan. - * @return the next definition stage. - */ - Update withDescription(String description); - } - - /** - * The stage of the ScalingPlan update allowing to specify friendlyName. - */ - interface WithFriendlyName { - /** - * Specifies the friendlyName property: User friendly name of scaling plan.. - * - * @param friendlyName User friendly name of scaling plan. - * @return the next definition stage. - */ - Update withFriendlyName(String friendlyName); - } - - /** - * The stage of the ScalingPlan update allowing to specify timeZone. - */ - interface WithTimeZone { - /** - * Specifies the timeZone property: Timezone of the scaling plan.. - * - * @param timeZone Timezone of the scaling plan. - * @return the next definition stage. - */ - Update withTimeZone(String timeZone); - } - - /** - * The stage of the ScalingPlan update allowing to specify exclusionTag. - */ - interface WithExclusionTag { - /** - * Specifies the exclusionTag property: Exclusion tag for scaling plan.. - * - * @param exclusionTag Exclusion tag for scaling plan. - * @return the next definition stage. - */ - Update withExclusionTag(String exclusionTag); - } - - /** - * The stage of the ScalingPlan update allowing to specify schedules. - */ - interface WithSchedules { - /** - * Specifies the schedules property: List of ScalingSchedule definitions.. - * - * @param schedules List of ScalingSchedule definitions. - * @return the next definition stage. - */ - Update withSchedules(List schedules); - } - - /** - * The stage of the ScalingPlan update allowing to specify hostPoolReferences. - */ - interface WithHostPoolReferences { - /** - * Specifies the hostPoolReferences property: List of ScalingHostPoolReference definitions.. - * - * @param hostPoolReferences List of ScalingHostPoolReference definitions. + * @param properties Detailed properties for scaling plan. * @return the next definition stage. */ - Update withHostPoolReferences(List hostPoolReferences); + Update withProperties(ScalingPlanPatchProperties properties); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanList.java index 94766566782e..0b280a74f04a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanList.java @@ -5,6 +5,7 @@ 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; @@ -14,19 +15,17 @@ import java.util.List; /** - * ScalingPlanList - * * List of scaling plan definitions. */ @Fluent public final class ScalingPlanList implements JsonSerializable { /* - * List of scaling plan definitions. + * The ScalingPlan items on this page */ private List value; /* - * Link to the next page of results. + * The link to the next page of items */ private String nextLink; @@ -37,7 +36,7 @@ public ScalingPlanList() { } /** - * Get the value property: List of scaling plan definitions. + * Get the value property: The ScalingPlan items on this page. * * @return the value value. */ @@ -46,7 +45,7 @@ public List value() { } /** - * Set the value property: List of scaling plan definitions. + * Set the value property: The ScalingPlan items on this page. * * @param value the value value to set. * @return the ScalingPlanList object itself. @@ -57,7 +56,7 @@ public ScalingPlanList withValue(List value) { } /** - * Get the nextLink property: Link to the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,17 +64,33 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ScalingPlanList object itself. + */ + public ScalingPlanList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ScalingPlanList")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(ScalingPlanList.class); + /** * {@inheritDoc} */ @@ -83,6 +98,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -92,6 +108,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ScalingPlanList 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 ScalingPlanList. */ public static ScalingPlanList fromJson(JsonReader jsonReader) throws IOException { 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..31982ec1c89e 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 @@ -9,9 +9,7 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPatchProperties; import java.io.IOException; -import java.util.List; import java.util.Map; /** @@ -27,7 +25,7 @@ public final class ScalingPlanPatch implements JsonSerializable tags) { } /** - * Get the innerProperties property: Detailed properties for scaling plan. + * Get the properties property: Detailed properties for scaling plan. * - * @return the innerProperties value. + * @return the properties value. */ - private ScalingPlanPatchProperties innerProperties() { - return this.innerProperties; + public ScalingPlanPatchProperties properties() { + return this.properties; } /** - * Get the description property: Description of scaling plan. + * Set the properties property: Detailed properties for scaling plan. * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Description of scaling plan. - * - * @param description the description value to set. - * @return the ScalingPlanPatch object itself. - */ - public ScalingPlanPatch withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPatchProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the friendlyName property: User friendly name of scaling plan. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); - } - - /** - * Set the friendlyName property: User friendly name of scaling plan. - * - * @param friendlyName the friendlyName value to set. + * @param properties the properties value to set. * @return the ScalingPlanPatch object itself. */ - public ScalingPlanPatch withFriendlyName(String friendlyName) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPatchProperties(); - } - this.innerProperties().withFriendlyName(friendlyName); - return this; - } - - /** - * Get the timeZone property: Timezone of the scaling plan. - * - * @return the timeZone value. - */ - public String timeZone() { - return this.innerProperties() == null ? null : this.innerProperties().timeZone(); - } - - /** - * Set the timeZone property: Timezone of the scaling plan. - * - * @param timeZone the timeZone value to set. - * @return the ScalingPlanPatch object itself. - */ - public ScalingPlanPatch withTimeZone(String timeZone) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPatchProperties(); - } - this.innerProperties().withTimeZone(timeZone); - return this; - } - - /** - * Get the exclusionTag property: Exclusion tag for scaling plan. - * - * @return the exclusionTag value. - */ - public String exclusionTag() { - return this.innerProperties() == null ? null : this.innerProperties().exclusionTag(); - } - - /** - * Set the exclusionTag property: Exclusion tag for scaling plan. - * - * @param exclusionTag the exclusionTag value to set. - * @return the ScalingPlanPatch object itself. - */ - public ScalingPlanPatch withExclusionTag(String exclusionTag) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPatchProperties(); - } - this.innerProperties().withExclusionTag(exclusionTag); - return this; - } - - /** - * Get the schedules property: List of ScalingSchedule definitions. - * - * @return the schedules value. - */ - public List schedules() { - return this.innerProperties() == null ? null : this.innerProperties().schedules(); - } - - /** - * Set the schedules property: List of ScalingSchedule definitions. - * - * @param schedules the schedules value to set. - * @return the ScalingPlanPatch object itself. - */ - public ScalingPlanPatch withSchedules(List schedules) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPatchProperties(); - } - this.innerProperties().withSchedules(schedules); - return this; - } - - /** - * Get the hostPoolReferences property: List of ScalingHostPoolReference definitions. - * - * @return the hostPoolReferences value. - */ - public List hostPoolReferences() { - return this.innerProperties() == null ? null : this.innerProperties().hostPoolReferences(); - } - - /** - * Set the hostPoolReferences property: List of ScalingHostPoolReference definitions. - * - * @param hostPoolReferences the hostPoolReferences value to set. - * @return the ScalingPlanPatch object itself. - */ - public ScalingPlanPatch withHostPoolReferences(List hostPoolReferences) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPatchProperties(); - } - this.innerProperties().withHostPoolReferences(hostPoolReferences); + public ScalingPlanPatch withProperties(ScalingPlanPatchProperties properties) { + this.properties = properties; return this; } @@ -208,8 +79,8 @@ public ScalingPlanPatch withHostPoolReferences(List ho * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -220,7 +91,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -243,7 +114,7 @@ public static ScalingPlanPatch fromJson(JsonReader jsonReader) throws IOExceptio Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedScalingPlanPatch.tags = tags; } else if ("properties".equals(fieldName)) { - deserializedScalingPlanPatch.innerProperties = ScalingPlanPatchProperties.fromJson(reader); + deserializedScalingPlanPatch.properties = ScalingPlanPatchProperties.fromJson(reader); } else { reader.skipChildren(); } 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/models/ScalingPlanPatchProperties.java similarity index 97% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPatchProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPatchProperties.java index ee719f82bc8f..0cde6c5663e9 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/models/ScalingPlanPatchProperties.java @@ -2,15 +2,13 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.desktopvirtualization.fluent.models; +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.models.ScalingHostPoolReference; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingSchedule; import java.io.IOException; import java.util.List; 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..830895b80680 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. + */ + 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 withRampUpStartTime(Time rampUpStartTime); + 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. */ @@ -703,19 +702,7 @@ interface WithOffPeakMinutesToWaitOnLogoff { /** * The template for ScalingPlanPersonalSchedule update. */ - interface Update extends UpdateStages.WithDaysOfWeek, UpdateStages.WithRampUpStartTime, - UpdateStages.WithRampUpAutoStartHosts, UpdateStages.WithRampUpStartVMOnConnect, - UpdateStages.WithRampUpActionOnDisconnect, UpdateStages.WithRampUpMinutesToWaitOnDisconnect, - UpdateStages.WithRampUpActionOnLogoff, UpdateStages.WithRampUpMinutesToWaitOnLogoff, - UpdateStages.WithPeakStartTime, UpdateStages.WithPeakStartVMOnConnect, UpdateStages.WithPeakActionOnDisconnect, - UpdateStages.WithPeakMinutesToWaitOnDisconnect, UpdateStages.WithPeakActionOnLogoff, - UpdateStages.WithPeakMinutesToWaitOnLogoff, UpdateStages.WithRampDownStartTime, - UpdateStages.WithRampDownStartVMOnConnect, UpdateStages.WithRampDownActionOnDisconnect, - UpdateStages.WithRampDownMinutesToWaitOnDisconnect, UpdateStages.WithRampDownActionOnLogoff, - UpdateStages.WithRampDownMinutesToWaitOnLogoff, UpdateStages.WithOffPeakStartTime, - UpdateStages.WithOffPeakStartVMOnConnect, UpdateStages.WithOffPeakActionOnDisconnect, - UpdateStages.WithOffPeakMinutesToWaitOnDisconnect, UpdateStages.WithOffPeakActionOnLogoff, - UpdateStages.WithOffPeakMinutesToWaitOnLogoff { + interface Update extends UpdateStages.WithProperties { /** * Executes the update request. * @@ -737,376 +724,16 @@ interface Update extends UpdateStages.WithDaysOfWeek, UpdateStages.WithRampUpSta */ interface UpdateStages { /** - * The stage of the ScalingPlanPersonalSchedule update 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. - */ - Update withDaysOfWeek(List daysOfWeek); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update 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. - */ - Update withRampUpStartTime(Time rampUpStartTime); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampUpAutoStartHosts. + * The stage of the ScalingPlanPersonalSchedule update allowing to specify properties. */ - interface WithRampUpAutoStartHosts { + interface WithProperties { /** - * Specifies the rampUpAutoStartHosts property: The desired startup behavior during the ramp up period for - * personal vms in the hostpool.. + * Specifies the properties property: Detailed properties for ScalingPlanPersonalSchedule. * - * @param rampUpAutoStartHosts The desired startup behavior during the ramp up period for personal vms in - * the hostpool. - * @return the next definition stage. - */ - Update withRampUpAutoStartHosts(StartupBehavior rampUpAutoStartHosts); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampUpStartVMOnConnect. - */ - interface WithRampUpStartVMOnConnect { - /** - * Specifies 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 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 next definition stage. - */ - Update withRampUpStartVMOnConnect(SetStartVMOnConnect rampUpStartVMOnConnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampUpActionOnDisconnect. - */ - interface WithRampUpActionOnDisconnect { - /** - * Specifies the rampUpActionOnDisconnect property: Action to be taken after a user disconnect during the - * ramp up period.. - * - * @param rampUpActionOnDisconnect Action to be taken after a user disconnect during the ramp up period. - * @return the next definition stage. - */ - Update withRampUpActionOnDisconnect(SessionHandlingOperation rampUpActionOnDisconnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampUpMinutesToWaitOnDisconnect. - */ - interface WithRampUpMinutesToWaitOnDisconnect { - /** - * Specifies 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 time in minutes to wait before performing the desired session - * handling action when a user disconnects during the ramp up period. - * @return the next definition stage. - */ - Update withRampUpMinutesToWaitOnDisconnect(Integer rampUpMinutesToWaitOnDisconnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampUpActionOnLogoff. - */ - interface WithRampUpActionOnLogoff { - /** - * Specifies the rampUpActionOnLogoff property: Action to be taken after a logoff during the ramp up - * period.. - * - * @param rampUpActionOnLogoff Action to be taken after a logoff during the ramp up period. - * @return the next definition stage. - */ - Update withRampUpActionOnLogoff(SessionHandlingOperation rampUpActionOnLogoff); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampUpMinutesToWaitOnLogoff. - */ - interface WithRampUpMinutesToWaitOnLogoff { - /** - * Specifies 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 time in minutes to wait before performing the desired session - * handling action when a user logs off during the ramp up period. - * @return the next definition stage. - */ - Update withRampUpMinutesToWaitOnLogoff(Integer rampUpMinutesToWaitOnLogoff); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update 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. - */ - Update withPeakStartTime(Time peakStartTime); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify peakStartVMOnConnect. - */ - interface WithPeakStartVMOnConnect { - /** - * Specifies the peakStartVMOnConnect property: The desired configuration of Start VM On Connect for the - * hostpool during the peak phase.. - * - * @param peakStartVMOnConnect The desired configuration of Start VM On Connect for the hostpool during the - * peak phase. - * @return the next definition stage. - */ - Update withPeakStartVMOnConnect(SetStartVMOnConnect peakStartVMOnConnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify peakActionOnDisconnect. - */ - interface WithPeakActionOnDisconnect { - /** - * Specifies the peakActionOnDisconnect property: Action to be taken after a user disconnect during the peak - * period.. - * - * @param peakActionOnDisconnect Action to be taken after a user disconnect during the peak period. - * @return the next definition stage. - */ - Update withPeakActionOnDisconnect(SessionHandlingOperation peakActionOnDisconnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify peakMinutesToWaitOnDisconnect. - */ - interface WithPeakMinutesToWaitOnDisconnect { - /** - * Specifies 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 time in minutes to wait before performing the desired session - * handling action when a user disconnects during the peak period. - * @return the next definition stage. - */ - Update withPeakMinutesToWaitOnDisconnect(Integer peakMinutesToWaitOnDisconnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify peakActionOnLogoff. - */ - interface WithPeakActionOnLogoff { - /** - * Specifies the peakActionOnLogoff property: Action to be taken after a logoff during the peak period.. - * - * @param peakActionOnLogoff Action to be taken after a logoff during the peak period. - * @return the next definition stage. - */ - Update withPeakActionOnLogoff(SessionHandlingOperation peakActionOnLogoff); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify peakMinutesToWaitOnLogoff. - */ - interface WithPeakMinutesToWaitOnLogoff { - /** - * Specifies 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 time in minutes to wait before performing the desired session - * handling action when a user logs off during the peak period. - * @return the next definition stage. - */ - Update withPeakMinutesToWaitOnLogoff(Integer peakMinutesToWaitOnLogoff); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update 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. - */ - Update withRampDownStartTime(Time rampDownStartTime); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampDownStartVMOnConnect. - */ - interface WithRampDownStartVMOnConnect { - /** - * Specifies the rampDownStartVMOnConnect property: The desired configuration of Start VM On Connect for the - * hostpool during the ramp down phase.. - * - * @param rampDownStartVMOnConnect The desired configuration of Start VM On Connect for the hostpool during - * the ramp down phase. - * @return the next definition stage. - */ - Update withRampDownStartVMOnConnect(SetStartVMOnConnect rampDownStartVMOnConnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampDownActionOnDisconnect. - */ - interface WithRampDownActionOnDisconnect { - /** - * Specifies the rampDownActionOnDisconnect property: Action to be taken after a user disconnect during the - * ramp down period.. - * - * @param rampDownActionOnDisconnect Action to be taken after a user disconnect during the ramp down period. - * @return the next definition stage. - */ - Update withRampDownActionOnDisconnect(SessionHandlingOperation rampDownActionOnDisconnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampDownMinutesToWaitOnDisconnect. - */ - interface WithRampDownMinutesToWaitOnDisconnect { - /** - * Specifies 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 time in minutes to wait before performing the desired - * session handling action when a user disconnects during the ramp down period. - * @return the next definition stage. - */ - Update withRampDownMinutesToWaitOnDisconnect(Integer rampDownMinutesToWaitOnDisconnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampDownActionOnLogoff. - */ - interface WithRampDownActionOnLogoff { - /** - * Specifies the rampDownActionOnLogoff property: Action to be taken after a logoff during the ramp down - * period.. - * - * @param rampDownActionOnLogoff Action to be taken after a logoff during the ramp down period. - * @return the next definition stage. - */ - Update withRampDownActionOnLogoff(SessionHandlingOperation rampDownActionOnLogoff); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampDownMinutesToWaitOnLogoff. - */ - interface WithRampDownMinutesToWaitOnLogoff { - /** - * Specifies 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 time in minutes to wait before performing the desired session - * handling action when a user logs off during the ramp down period. - * @return the next definition stage. - */ - Update withRampDownMinutesToWaitOnLogoff(Integer rampDownMinutesToWaitOnLogoff); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update 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. - */ - Update withOffPeakStartTime(Time offPeakStartTime); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify offPeakStartVMOnConnect. - */ - interface WithOffPeakStartVMOnConnect { - /** - * Specifies the offPeakStartVMOnConnect property: The desired configuration of Start VM On Connect for the - * hostpool during the off-peak phase.. - * - * @param offPeakStartVMOnConnect The desired configuration of Start VM On Connect for the hostpool during - * the off-peak phase. - * @return the next definition stage. - */ - Update withOffPeakStartVMOnConnect(SetStartVMOnConnect offPeakStartVMOnConnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify offPeakActionOnDisconnect. - */ - interface WithOffPeakActionOnDisconnect { - /** - * Specifies the offPeakActionOnDisconnect property: Action to be taken after a user disconnect during the - * off-peak period.. - * - * @param offPeakActionOnDisconnect Action to be taken after a user disconnect during the off-peak period. - * @return the next definition stage. - */ - Update withOffPeakActionOnDisconnect(SessionHandlingOperation offPeakActionOnDisconnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify offPeakMinutesToWaitOnDisconnect. - */ - interface WithOffPeakMinutesToWaitOnDisconnect { - /** - * Specifies 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 time in minutes to wait before performing the desired session - * handling action when a user disconnects during the off-peak period. - * @return the next definition stage. - */ - Update withOffPeakMinutesToWaitOnDisconnect(Integer offPeakMinutesToWaitOnDisconnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify offPeakActionOnLogoff. - */ - interface WithOffPeakActionOnLogoff { - /** - * Specifies the offPeakActionOnLogoff property: Action to be taken after a logoff during the off-peak - * period.. - * - * @param offPeakActionOnLogoff Action to be taken after a logoff during the off-peak period. - * @return the next definition stage. - */ - Update withOffPeakActionOnLogoff(SessionHandlingOperation offPeakActionOnLogoff); - } - - /** - * The stage of the ScalingPlanPersonalSchedule update allowing to specify offPeakMinutesToWaitOnLogoff. - */ - interface WithOffPeakMinutesToWaitOnLogoff { - /** - * Specifies 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 time in minutes to wait before performing the desired session - * handling action when a user logs off during the off-peak period. + * @param properties Detailed properties for ScalingPlanPersonalSchedule. * @return the next definition stage. */ - Update withOffPeakMinutesToWaitOnLogoff(Integer offPeakMinutesToWaitOnLogoff); + Update withProperties(ScalingPlanPersonalSchedulePatchProperties properties); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalScheduleList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalScheduleList.java index 21f5c39476a4..15e6b70bb56e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalScheduleList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalScheduleList.java @@ -5,6 +5,7 @@ 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; @@ -14,19 +15,17 @@ import java.util.List; /** - * ScalingPlanPersonalScheduleList - * * List of ScalingPlanPersonalSchedule definitions. */ @Fluent public final class ScalingPlanPersonalScheduleList implements JsonSerializable { /* - * List of ScalingPlanPersonalSchedule definitions. + * The ScalingPlanPersonalSchedule items on this page */ private List value; /* - * Link to the next page of results. + * The link to the next page of items */ private String nextLink; @@ -37,7 +36,7 @@ public ScalingPlanPersonalScheduleList() { } /** - * Get the value property: List of ScalingPlanPersonalSchedule definitions. + * Get the value property: The ScalingPlanPersonalSchedule items on this page. * * @return the value value. */ @@ -46,7 +45,7 @@ public List value() { } /** - * Set the value property: List of ScalingPlanPersonalSchedule definitions. + * Set the value property: The ScalingPlanPersonalSchedule items on this page. * * @param value the value value to set. * @return the ScalingPlanPersonalScheduleList object itself. @@ -57,7 +56,7 @@ public ScalingPlanPersonalScheduleList withValue(List e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(ScalingPlanPersonalScheduleList.class); + /** * {@inheritDoc} */ @@ -83,6 +99,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -92,6 +109,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ScalingPlanPersonalScheduleList 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 ScalingPlanPersonalScheduleList. */ public static ScalingPlanPersonalScheduleList fromJson(JsonReader jsonReader) throws IOException { 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..2fe98e5e8c72 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,9 +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 java.io.IOException; -import java.util.List; /** * ScalingPlanPersonalSchedule properties that can be patched. @@ -21,7 +19,7 @@ public final class ScalingPlanPersonalSchedulePatch implements JsonSerializable< /* * Detailed properties for ScalingPlanPersonalSchedule */ - private ScalingPlanPersonalScheduleProperties innerProperties; + private ScalingPlanPersonalSchedulePatchProperties properties; /** * Creates an instance of ScalingPlanPersonalSchedulePatch class. @@ -30,649 +28,22 @@ public ScalingPlanPersonalSchedulePatch() { } /** - * Get the innerProperties property: Detailed properties for ScalingPlanPersonalSchedule. + * Get the properties property: Detailed properties for ScalingPlanPersonalSchedule. * - * @return the innerProperties value. + * @return the properties value. */ - private ScalingPlanPersonalScheduleProperties innerProperties() { - return this.innerProperties; + public ScalingPlanPersonalSchedulePatchProperties properties() { + return this.properties; } /** - * Get the daysOfWeek property: Set of days of the week on which this schedule is active. + * Set the properties property: Detailed properties for ScalingPlanPersonalSchedule. * - * @return the daysOfWeek value. - */ - public List daysOfWeek() { - return this.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch withDaysOfWeek(List daysOfWeek) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withDaysOfWeek(daysOfWeek); - return this; - } - - /** - * Get the rampUpStartTime property: Starting time for ramp up period. - * - * @return the rampUpStartTime value. - */ - public Time rampUpStartTime() { - return this.innerProperties() == null ? null : this.innerProperties().rampUpStartTime(); - } - - /** - * Set the rampUpStartTime property: Starting time for ramp up period. - * - * @param rampUpStartTime the rampUpStartTime value to set. - * @return the ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch withRampUpStartTime(Time rampUpStartTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withRampUpStartTime(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch withRampUpAutoStartHosts(StartupBehavior rampUpAutoStartHosts) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withRampUpAutoStartHosts(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch withRampUpStartVMOnConnect(SetStartVMOnConnect rampUpStartVMOnConnect) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withRampUpStartVMOnConnect(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch - withRampUpActionOnDisconnect(SessionHandlingOperation rampUpActionOnDisconnect) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withRampUpActionOnDisconnect(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch - withRampUpMinutesToWaitOnDisconnect(Integer rampUpMinutesToWaitOnDisconnect) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withRampUpMinutesToWaitOnDisconnect(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.innerProperties() == null ? null : this.innerProperties().rampUpActionOnLogoff(); - } - - /** - * Set the rampUpActionOnLogoff property: Action to be taken after a logoff during the ramp up period. - * - * @param rampUpActionOnLogoff the rampUpActionOnLogoff value to set. + * @param properties the properties value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ - public ScalingPlanPersonalSchedulePatch withRampUpActionOnLogoff(SessionHandlingOperation rampUpActionOnLogoff) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withRampUpActionOnLogoff(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch withRampUpMinutesToWaitOnLogoff(Integer rampUpMinutesToWaitOnLogoff) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withRampUpMinutesToWaitOnLogoff(rampUpMinutesToWaitOnLogoff); - return this; - } - - /** - * Get the peakStartTime property: Starting time for peak period. - * - * @return the peakStartTime value. - */ - public Time peakStartTime() { - return this.innerProperties() == null ? null : this.innerProperties().peakStartTime(); - } - - /** - * Set the peakStartTime property: Starting time for peak period. - * - * @param peakStartTime the peakStartTime value to set. - * @return the ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch withPeakStartTime(Time peakStartTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withPeakStartTime(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch withPeakStartVMOnConnect(SetStartVMOnConnect peakStartVMOnConnect) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withPeakStartVMOnConnect(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch - withPeakActionOnDisconnect(SessionHandlingOperation peakActionOnDisconnect) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withPeakActionOnDisconnect(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch withPeakMinutesToWaitOnDisconnect(Integer peakMinutesToWaitOnDisconnect) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withPeakMinutesToWaitOnDisconnect(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch withPeakActionOnLogoff(SessionHandlingOperation peakActionOnLogoff) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withPeakActionOnLogoff(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch withPeakMinutesToWaitOnLogoff(Integer peakMinutesToWaitOnLogoff) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withPeakMinutesToWaitOnLogoff(peakMinutesToWaitOnLogoff); - return this; - } - - /** - * Get the rampDownStartTime property: Starting time for ramp down period. - * - * @return the rampDownStartTime value. - */ - public Time rampDownStartTime() { - return this.innerProperties() == null ? null : this.innerProperties().rampDownStartTime(); - } - - /** - * Set the rampDownStartTime property: Starting time for ramp down period. - * - * @param rampDownStartTime the rampDownStartTime value to set. - * @return the ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch withRampDownStartTime(Time rampDownStartTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withRampDownStartTime(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch withRampDownStartVMOnConnect(SetStartVMOnConnect rampDownStartVMOnConnect) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withRampDownStartVMOnConnect(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch - withRampDownActionOnDisconnect(SessionHandlingOperation rampDownActionOnDisconnect) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withRampDownActionOnDisconnect(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch - withRampDownMinutesToWaitOnDisconnect(Integer rampDownMinutesToWaitOnDisconnect) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withRampDownMinutesToWaitOnDisconnect(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch - withRampDownActionOnLogoff(SessionHandlingOperation rampDownActionOnLogoff) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withRampDownActionOnLogoff(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch withRampDownMinutesToWaitOnLogoff(Integer rampDownMinutesToWaitOnLogoff) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withRampDownMinutesToWaitOnLogoff(rampDownMinutesToWaitOnLogoff); - return this; - } - - /** - * Get the offPeakStartTime property: Starting time for off-peak period. - * - * @return the offPeakStartTime value. - */ - public Time offPeakStartTime() { - return this.innerProperties() == null ? null : this.innerProperties().offPeakStartTime(); - } - - /** - * Set the offPeakStartTime property: Starting time for off-peak period. - * - * @param offPeakStartTime the offPeakStartTime value to set. - * @return the ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch withOffPeakStartTime(Time offPeakStartTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withOffPeakStartTime(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch withOffPeakStartVMOnConnect(SetStartVMOnConnect offPeakStartVMOnConnect) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withOffPeakStartVMOnConnect(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch - withOffPeakActionOnDisconnect(SessionHandlingOperation offPeakActionOnDisconnect) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withOffPeakActionOnDisconnect(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch - withOffPeakMinutesToWaitOnDisconnect(Integer offPeakMinutesToWaitOnDisconnect) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withOffPeakMinutesToWaitOnDisconnect(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch withOffPeakActionOnLogoff(SessionHandlingOperation offPeakActionOnLogoff) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withOffPeakActionOnLogoff(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPersonalSchedulePatch object itself. - */ - public ScalingPlanPersonalSchedulePatch withOffPeakMinutesToWaitOnLogoff(Integer offPeakMinutesToWaitOnLogoff) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withOffPeakMinutesToWaitOnLogoff(offPeakMinutesToWaitOnLogoff); + public ScalingPlanPersonalSchedulePatch withProperties(ScalingPlanPersonalSchedulePatchProperties properties) { + this.properties = properties; return this; } @@ -682,8 +53,8 @@ public ScalingPlanPersonalSchedulePatch withOffPeakMinutesToWaitOnLogoff(Integer * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -693,7 +64,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -714,8 +85,8 @@ public static ScalingPlanPersonalSchedulePatch fromJson(JsonReader jsonReader) t reader.nextToken(); if ("properties".equals(fieldName)) { - deserializedScalingPlanPersonalSchedulePatch.innerProperties - = ScalingPlanPersonalScheduleProperties.fromJson(reader); + deserializedScalingPlanPersonalSchedulePatch.properties + = ScalingPlanPersonalSchedulePatchProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedulePatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedulePatchProperties.java new file mode 100644 index 000000000000..b5499d0ea18d --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedulePatchProperties.java @@ -0,0 +1,904 @@ +// 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; +import java.util.List; + +/** + * ScalingPlanPersonalSchedule properties that can be patched. + */ +@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/models/ScalingPlanPersonalSchedules.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedules.java index 5d529134a8a8..25729a39a221 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedules.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedules.java @@ -13,35 +13,36 @@ */ public interface ScalingPlanPersonalSchedules { /** - * Get a ScalingPlanPersonalSchedule. + * List ScalingPlanPersonalSchedules. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ScalingPlanPersonalSchedule along with {@link Response}. + * @return list of ScalingPlanPersonalSchedule definitions as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName, Context context); + PagedIterable list(String resourceGroupName, String scalingPlanName); /** - * Get a ScalingPlanPersonalSchedule. + * List ScalingPlanPersonalSchedules. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ScalingPlanPersonalSchedule. + * @return list of ScalingPlanPersonalSchedule definitions as paginated response with {@link PagedIterable}. */ - ScalingPlanPersonalSchedule get(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); + PagedIterable list(String resourceGroupName, String scalingPlanName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** - * Remove a ScalingPlanPersonalSchedule. + * Get a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. @@ -50,13 +51,13 @@ Response getWithResponse(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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}. + * @return a ScalingPlanPersonalSchedule along with {@link Response}. */ - Response deleteWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, - Context context); + Response getWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context); /** - * Remove a ScalingPlanPersonalSchedule. + * Get a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. @@ -64,37 +65,36 @@ Response deleteWithResponse(String resourceGroupName, String scalingPlanNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ScalingPlanPersonalSchedule. */ - void delete(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); + ScalingPlanPersonalSchedule get(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); /** - * List ScalingPlanPersonalSchedules. + * Remove a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPersonalScheduleList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - PagedIterable list(String resourceGroupName, String scalingPlanName); + Response deleteWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, + Context context); /** - * List ScalingPlanPersonalSchedules. + * Remove a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPersonalScheduleList as paginated response with {@link PagedIterable}. */ - PagedIterable list(String resourceGroupName, String scalingPlanName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context); + void delete(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); /** * Get a ScalingPlanPersonalSchedule. 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..d79f586812d1 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. * @@ -74,7 +81,7 @@ public interface ScalingPlanPooledSchedule { * * @return the rampUpCapacityThresholdPct value. */ - Integer rampUpCapacityThresholdPct(); + int rampUpCapacityThresholdPct(); /** * Gets the peakStartTime property: Starting time for peak period. @@ -116,7 +123,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 +185,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,36 +213,7 @@ interface WithParentResource { * @param scalingPlanName The name of the scaling plan. * @return the next definition stage. */ - WithCreate withExistingScalingPlan(String resourceGroupName, String scalingPlanName); - } - - /** - * 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, - DefinitionStages.WithRampUpLoadBalancingAlgorithm, DefinitionStages.WithRampUpMinimumHostsPct, - DefinitionStages.WithRampUpCapacityThresholdPct, DefinitionStages.WithPeakStartTime, - DefinitionStages.WithPeakLoadBalancingAlgorithm, DefinitionStages.WithRampDownStartTime, - DefinitionStages.WithRampDownLoadBalancingAlgorithm, DefinitionStages.WithRampDownMinimumHostsPct, - DefinitionStages.WithRampDownCapacityThresholdPct, DefinitionStages.WithRampDownForceLogoffUsers, - DefinitionStages.WithRampDownStopHostsWhen, DefinitionStages.WithRampDownWaitTimeMinutes, - DefinitionStages.WithRampDownNotificationMessage, DefinitionStages.WithOffPeakStartTime, - DefinitionStages.WithOffPeakLoadBalancingAlgorithm { - /** - * Executes the create request. - * - * @return the created resource. - */ - ScalingPlanPooledSchedule create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - ScalingPlanPooledSchedule create(Context context); + WithDaysOfWeek withExistingScalingPlan(String resourceGroupName, String scalingPlanName); } /** @@ -245,7 +226,7 @@ interface WithDaysOfWeek { * @param daysOfWeek Set of days of the week on which this schedule is active. * @return the next definition stage. */ - WithCreate withDaysOfWeek(List daysOfWeek); + WithRampUpStartTime withDaysOfWeek(List daysOfWeek); } /** @@ -258,33 +239,7 @@ interface WithRampUpStartTime { * @param rampUpStartTime Starting time for ramp up period. * @return the next definition stage. */ - WithCreate withRampUpStartTime(Time rampUpStartTime); - } - - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampUpLoadBalancingAlgorithm. - */ - interface WithRampUpLoadBalancingAlgorithm { - /** - * Specifies the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period.. - * - * @param rampUpLoadBalancingAlgorithm Load balancing algorithm for ramp up period. - * @return the next definition stage. - */ - WithCreate withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm); - } - - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampUpMinimumHostsPct. - */ - interface WithRampUpMinimumHostsPct { - /** - * Specifies the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period.. - * - * @param rampUpMinimumHostsPct Minimum host percentage for ramp up period. - * @return the next definition stage. - */ - WithCreate withRampUpMinimumHostsPct(Integer rampUpMinimumHostsPct); + WithRampUpCapacityThresholdPct withRampUpStartTime(Time rampUpStartTime); } /** @@ -297,7 +252,7 @@ interface WithRampUpCapacityThresholdPct { * @param rampUpCapacityThresholdPct Capacity threshold for ramp up period. * @return the next definition stage. */ - WithCreate withRampUpCapacityThresholdPct(Integer rampUpCapacityThresholdPct); + WithPeakStartTime withRampUpCapacityThresholdPct(int rampUpCapacityThresholdPct); } /** @@ -310,20 +265,7 @@ interface WithPeakStartTime { * @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. - */ - interface WithPeakLoadBalancingAlgorithm { - /** - * Specifies the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period.. - * - * @param peakLoadBalancingAlgorithm Load balancing algorithm for peak period. - * @return the next definition stage. - */ - WithCreate withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm); + WithRampDownStartTime withPeakStartTime(Time peakStartTime); } /** @@ -336,34 +278,7 @@ interface WithRampDownStartTime { * @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. - */ - interface WithRampDownLoadBalancingAlgorithm { - /** - * Specifies the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period.. - * - * @param rampDownLoadBalancingAlgorithm Load balancing algorithm for ramp down period. - * @return the next definition stage. - */ - WithCreate - withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm); - } - - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownMinimumHostsPct. - */ - interface WithRampDownMinimumHostsPct { - /** - * Specifies the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period.. - * - * @param rampDownMinimumHostsPct Minimum host percentage for ramp down period. - * @return the next definition stage. - */ - WithCreate withRampDownMinimumHostsPct(Integer rampDownMinimumHostsPct); + WithRampDownCapacityThresholdPct withRampDownStartTime(Time rampDownStartTime); } /** @@ -376,61 +291,7 @@ interface WithRampDownCapacityThresholdPct { * @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. - */ - interface WithRampDownForceLogoffUsers { - /** - * Specifies the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts.. - * - * @param rampDownForceLogoffUsers Should users be logged off forcefully from hosts. - * @return the next definition stage. - */ - WithCreate withRampDownForceLogoffUsers(Boolean rampDownForceLogoffUsers); - } - - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownStopHostsWhen. - */ - interface WithRampDownStopHostsWhen { - /** - * Specifies the rampDownStopHostsWhen property: Specifies when to stop hosts during ramp down period.. - * - * @param rampDownStopHostsWhen Specifies when to stop hosts during ramp down period. - * @return the next definition stage. - */ - WithCreate withRampDownStopHostsWhen(StopHostsWhen rampDownStopHostsWhen); - } - - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownWaitTimeMinutes. - */ - interface WithRampDownWaitTimeMinutes { - /** - * Specifies the rampDownWaitTimeMinutes property: Number of minutes to wait to stop hosts during ramp down - * period.. - * - * @param rampDownWaitTimeMinutes Number of minutes to wait to stop hosts during ramp down period. - * @return the next definition stage. - */ - WithCreate withRampDownWaitTimeMinutes(Integer rampDownWaitTimeMinutes); - } - - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownNotificationMessage. - */ - interface WithRampDownNotificationMessage { - /** - * Specifies the rampDownNotificationMessage property: Notification message for users during ramp down - * period.. - * - * @param rampDownNotificationMessage Notification message for users during ramp down period. - * @return the next definition stage. - */ - WithCreate withRampDownNotificationMessage(String rampDownNotificationMessage); + WithOffPeakStartTime withRampDownCapacityThresholdPct(int rampDownCapacityThresholdPct); } /** @@ -447,87 +308,46 @@ interface WithOffPeakStartTime { } /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify offPeakLoadBalancingAlgorithm. + * 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 WithOffPeakLoadBalancingAlgorithm { + interface WithCreate extends DefinitionStages.WithNamePropertiesName, + DefinitionStages.WithRampUpLoadBalancingAlgorithm, DefinitionStages.WithRampUpMinimumHostsPct, + DefinitionStages.WithPeakLoadBalancingAlgorithm, DefinitionStages.WithRampDownLoadBalancingAlgorithm, + DefinitionStages.WithRampDownMinimumHostsPct, DefinitionStages.WithRampDownForceLogoffUsers, + DefinitionStages.WithRampDownStopHostsWhen, DefinitionStages.WithRampDownWaitTimeMinutes, + DefinitionStages.WithRampDownNotificationMessage, DefinitionStages.WithOffPeakLoadBalancingAlgorithm { /** - * Specifies the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period.. + * Executes the create request. * - * @param offPeakLoadBalancingAlgorithm Load balancing algorithm for off-peak period. - * @return the next definition stage. + * @return the created resource. */ - WithCreate - withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm); - } - } - - /** - * Begins update for the ScalingPlanPooledSchedule resource. - * - * @return the stage of resource update. - */ - ScalingPlanPooledSchedule.Update update(); - - /** - * The template for ScalingPlanPooledSchedule update. - */ - interface Update extends UpdateStages.WithDaysOfWeek, 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, - UpdateStages.WithRampDownNotificationMessage, UpdateStages.WithOffPeakStartTime, - UpdateStages.WithOffPeakLoadBalancingAlgorithm { - /** - * Executes the update request. - * - * @return the updated resource. - */ - ScalingPlanPooledSchedule apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - ScalingPlanPooledSchedule apply(Context context); - } + ScalingPlanPooledSchedule create(); - /** - * The ScalingPlanPooledSchedule update stages. - */ - interface UpdateStages { - /** - * The stage of the ScalingPlanPooledSchedule update allowing to specify daysOfWeek. - */ - interface WithDaysOfWeek { /** - * Specifies the daysOfWeek property: Set of days of the week on which this schedule is active.. + * Executes the create request. * - * @param daysOfWeek Set of days of the week on which this schedule is active. - * @return the next definition stage. + * @param context The context to associate with this operation. + * @return the created resource. */ - Update withDaysOfWeek(List daysOfWeek); + ScalingPlanPooledSchedule create(Context context); } /** - * The stage of the ScalingPlanPooledSchedule update allowing to specify rampUpStartTime. + * The stage of the ScalingPlanPooledSchedule definition allowing to specify namePropertiesName. */ - interface WithRampUpStartTime { + interface WithNamePropertiesName { /** - * Specifies the rampUpStartTime property: Starting time for ramp up period.. + * Specifies the namePropertiesName property: Name of the ScalingPlanPooledSchedule. * - * @param rampUpStartTime Starting time for ramp up period. + * @param namePropertiesName Name of the ScalingPlanPooledSchedule. * @return the next definition stage. */ - Update withRampUpStartTime(Time rampUpStartTime); + WithCreate withNamePropertiesName(String namePropertiesName); } /** - * The stage of the ScalingPlanPooledSchedule update allowing to specify rampUpLoadBalancingAlgorithm. + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampUpLoadBalancingAlgorithm. */ interface WithRampUpLoadBalancingAlgorithm { /** @@ -536,11 +356,11 @@ interface WithRampUpLoadBalancingAlgorithm { * @param rampUpLoadBalancingAlgorithm Load balancing algorithm for ramp up period. * @return the next definition stage. */ - Update withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm); + WithCreate withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm); } /** - * The stage of the ScalingPlanPooledSchedule update allowing to specify rampUpMinimumHostsPct. + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampUpMinimumHostsPct. */ interface WithRampUpMinimumHostsPct { /** @@ -549,37 +369,11 @@ interface WithRampUpMinimumHostsPct { * @param rampUpMinimumHostsPct Minimum host percentage for ramp up period. * @return the next definition stage. */ - Update withRampUpMinimumHostsPct(Integer rampUpMinimumHostsPct); - } - - /** - * The stage of the ScalingPlanPooledSchedule update 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. - */ - Update withRampUpCapacityThresholdPct(Integer rampUpCapacityThresholdPct); - } - - /** - * The stage of the ScalingPlanPooledSchedule update 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. - */ - Update withPeakStartTime(Time peakStartTime); + WithCreate withRampUpMinimumHostsPct(Integer rampUpMinimumHostsPct); } /** - * The stage of the ScalingPlanPooledSchedule update allowing to specify peakLoadBalancingAlgorithm. + * The stage of the ScalingPlanPooledSchedule definition allowing to specify peakLoadBalancingAlgorithm. */ interface WithPeakLoadBalancingAlgorithm { /** @@ -588,24 +382,11 @@ interface WithPeakLoadBalancingAlgorithm { * @param peakLoadBalancingAlgorithm Load balancing algorithm for peak period. * @return the next definition stage. */ - Update withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm); - } - - /** - * The stage of the ScalingPlanPooledSchedule update 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. - */ - Update withRampDownStartTime(Time rampDownStartTime); + WithCreate withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm); } /** - * The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownLoadBalancingAlgorithm. + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownLoadBalancingAlgorithm. */ interface WithRampDownLoadBalancingAlgorithm { /** @@ -614,11 +395,12 @@ interface WithRampDownLoadBalancingAlgorithm { * @param rampDownLoadBalancingAlgorithm Load balancing algorithm for ramp down period. * @return the next definition stage. */ - Update withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm); + WithCreate + withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm); } /** - * The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownMinimumHostsPct. + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownMinimumHostsPct. */ interface WithRampDownMinimumHostsPct { /** @@ -627,24 +409,11 @@ interface WithRampDownMinimumHostsPct { * @param rampDownMinimumHostsPct Minimum host percentage for ramp down period. * @return the next definition stage. */ - Update withRampDownMinimumHostsPct(Integer rampDownMinimumHostsPct); - } - - /** - * The stage of the ScalingPlanPooledSchedule update 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. - */ - Update withRampDownCapacityThresholdPct(Integer rampDownCapacityThresholdPct); + WithCreate withRampDownMinimumHostsPct(Integer rampDownMinimumHostsPct); } /** - * The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownForceLogoffUsers. + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownForceLogoffUsers. */ interface WithRampDownForceLogoffUsers { /** @@ -653,11 +422,11 @@ interface WithRampDownForceLogoffUsers { * @param rampDownForceLogoffUsers Should users be logged off forcefully from hosts. * @return the next definition stage. */ - Update withRampDownForceLogoffUsers(Boolean rampDownForceLogoffUsers); + WithCreate withRampDownForceLogoffUsers(Boolean rampDownForceLogoffUsers); } /** - * The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownStopHostsWhen. + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownStopHostsWhen. */ interface WithRampDownStopHostsWhen { /** @@ -666,11 +435,11 @@ interface WithRampDownStopHostsWhen { * @param rampDownStopHostsWhen Specifies when to stop hosts during ramp down period. * @return the next definition stage. */ - Update withRampDownStopHostsWhen(StopHostsWhen rampDownStopHostsWhen); + WithCreate withRampDownStopHostsWhen(StopHostsWhen rampDownStopHostsWhen); } /** - * The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownWaitTimeMinutes. + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownWaitTimeMinutes. */ interface WithRampDownWaitTimeMinutes { /** @@ -680,11 +449,11 @@ interface WithRampDownWaitTimeMinutes { * @param rampDownWaitTimeMinutes Number of minutes to wait to stop hosts during ramp down period. * @return the next definition stage. */ - Update withRampDownWaitTimeMinutes(Integer rampDownWaitTimeMinutes); + WithCreate withRampDownWaitTimeMinutes(Integer rampDownWaitTimeMinutes); } /** - * The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownNotificationMessage. + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownNotificationMessage. */ interface WithRampDownNotificationMessage { /** @@ -694,33 +463,66 @@ interface WithRampDownNotificationMessage { * @param rampDownNotificationMessage Notification message for users during ramp down period. * @return the next definition stage. */ - Update withRampDownNotificationMessage(String rampDownNotificationMessage); + WithCreate withRampDownNotificationMessage(String rampDownNotificationMessage); } /** - * The stage of the ScalingPlanPooledSchedule update allowing to specify offPeakStartTime. + * The stage of the ScalingPlanPooledSchedule definition allowing to specify offPeakLoadBalancingAlgorithm. */ - interface WithOffPeakStartTime { + interface WithOffPeakLoadBalancingAlgorithm { /** - * Specifies the offPeakStartTime property: Starting time for off-peak period.. + * Specifies the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period.. * - * @param offPeakStartTime Starting time for off-peak period. + * @param offPeakLoadBalancingAlgorithm Load balancing algorithm for off-peak period. * @return the next definition stage. */ - Update withOffPeakStartTime(Time offPeakStartTime); + WithCreate + withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm); } + } + /** + * Begins update for the ScalingPlanPooledSchedule resource. + * + * @return the stage of resource update. + */ + ScalingPlanPooledSchedule.Update update(); + + /** + * The template for ScalingPlanPooledSchedule update. + */ + interface Update extends UpdateStages.WithProperties { /** - * The stage of the ScalingPlanPooledSchedule update allowing to specify offPeakLoadBalancingAlgorithm. + * Executes the update request. + * + * @return the updated resource. */ - interface WithOffPeakLoadBalancingAlgorithm { + ScalingPlanPooledSchedule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ScalingPlanPooledSchedule apply(Context context); + } + + /** + * The ScalingPlanPooledSchedule update stages. + */ + interface UpdateStages { + /** + * The stage of the ScalingPlanPooledSchedule update allowing to specify properties. + */ + interface WithProperties { /** - * Specifies the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period.. + * Specifies the properties property: Detailed properties for ScalingPlanPooledSchedule. * - * @param offPeakLoadBalancingAlgorithm Load balancing algorithm for off-peak period. + * @param properties Detailed properties for ScalingPlanPooledSchedule. * @return the next definition stage. */ - Update withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm); + Update withProperties(ScalingPlanPooledSchedulePatchProperties properties); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledScheduleList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledScheduleList.java index 7395266343a5..7f6e33b664ab 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledScheduleList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledScheduleList.java @@ -5,6 +5,7 @@ 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; @@ -14,19 +15,17 @@ import java.util.List; /** - * ScalingPlanPooledScheduleList - * * List of ScalingPlanPooledSchedule definitions. */ @Fluent public final class ScalingPlanPooledScheduleList implements JsonSerializable { /* - * List of ScalingPlanPooledSchedule definitions. + * The ScalingPlanPooledSchedule items on this page */ private List value; /* - * Link to the next page of results. + * The link to the next page of items */ private String nextLink; @@ -37,7 +36,7 @@ public ScalingPlanPooledScheduleList() { } /** - * Get the value property: List of ScalingPlanPooledSchedule definitions. + * Get the value property: The ScalingPlanPooledSchedule items on this page. * * @return the value value. */ @@ -46,7 +45,7 @@ public List value() { } /** - * Set the value property: List of ScalingPlanPooledSchedule definitions. + * Set the value property: The ScalingPlanPooledSchedule items on this page. * * @param value the value value to set. * @return the ScalingPlanPooledScheduleList object itself. @@ -57,7 +56,7 @@ public ScalingPlanPooledScheduleList withValue(List e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(ScalingPlanPooledScheduleList.class); + /** * {@inheritDoc} */ @@ -83,6 +99,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -92,6 +109,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ScalingPlanPooledScheduleList 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 ScalingPlanPooledScheduleList. */ public static ScalingPlanPooledScheduleList fromJson(JsonReader jsonReader) throws IOException { 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..26decf38cbff 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,9 +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 java.io.IOException; -import java.util.List; /** * ScalingPlanPooledSchedule properties that can be patched. @@ -22,7 +20,7 @@ public final class ScalingPlanPooledSchedulePatch extends ProxyResource { /* * Detailed properties for ScalingPlanPooledSchedule */ - private ScalingPlanPooledScheduleProperties innerProperties; + private ScalingPlanPooledSchedulePatchProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -51,12 +49,23 @@ public ScalingPlanPooledSchedulePatch() { } /** - * Get the innerProperties property: Detailed properties for ScalingPlanPooledSchedule. + * Get the properties property: Detailed properties for ScalingPlanPooledSchedule. * - * @return the innerProperties value. + * @return the properties value. */ - private ScalingPlanPooledScheduleProperties innerProperties() { - return this.innerProperties; + public ScalingPlanPooledSchedulePatchProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Detailed properties for ScalingPlanPooledSchedule. + * + * @param properties the properties value to set. + * @return the ScalingPlanPooledSchedulePatch object itself. + */ + public ScalingPlanPooledSchedulePatch withProperties(ScalingPlanPooledSchedulePatchProperties properties) { + this.properties = properties; + return this; } /** @@ -98,409 +107,14 @@ public String id() { return this.id; } - /** - * 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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPooledSchedulePatch object itself. - */ - public ScalingPlanPooledSchedulePatch withDaysOfWeek(List daysOfWeek) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); - } - this.innerProperties().withDaysOfWeek(daysOfWeek); - return this; - } - - /** - * Get the rampUpStartTime property: Starting time for ramp up period. - * - * @return the rampUpStartTime value. - */ - public Time rampUpStartTime() { - return this.innerProperties() == null ? null : this.innerProperties().rampUpStartTime(); - } - - /** - * Set the rampUpStartTime property: Starting time for ramp up period. - * - * @param rampUpStartTime the rampUpStartTime value to set. - * @return the ScalingPlanPooledSchedulePatch object itself. - */ - public ScalingPlanPooledSchedulePatch withRampUpStartTime(Time rampUpStartTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); - } - this.innerProperties().withRampUpStartTime(rampUpStartTime); - return this; - } - - /** - * Get the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period. - * - * @return the rampUpLoadBalancingAlgorithm value. - */ - public SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm() { - return this.innerProperties() == null ? null : this.innerProperties().rampUpLoadBalancingAlgorithm(); - } - - /** - * Set the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period. - * - * @param rampUpLoadBalancingAlgorithm the rampUpLoadBalancingAlgorithm value to set. - * @return the ScalingPlanPooledSchedulePatch object itself. - */ - public ScalingPlanPooledSchedulePatch - withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); - } - this.innerProperties().withRampUpLoadBalancingAlgorithm(rampUpLoadBalancingAlgorithm); - return this; - } - - /** - * Get the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period. - * - * @return the rampUpMinimumHostsPct value. - */ - public Integer rampUpMinimumHostsPct() { - return this.innerProperties() == null ? null : this.innerProperties().rampUpMinimumHostsPct(); - } - - /** - * Set the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period. - * - * @param rampUpMinimumHostsPct the rampUpMinimumHostsPct value to set. - * @return the ScalingPlanPooledSchedulePatch object itself. - */ - public ScalingPlanPooledSchedulePatch withRampUpMinimumHostsPct(Integer rampUpMinimumHostsPct) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); - } - this.innerProperties().withRampUpMinimumHostsPct(rampUpMinimumHostsPct); - return this; - } - - /** - * Get the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period. - * - * @return the rampUpCapacityThresholdPct value. - */ - public Integer rampUpCapacityThresholdPct() { - return this.innerProperties() == null ? null : this.innerProperties().rampUpCapacityThresholdPct(); - } - - /** - * Set the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period. - * - * @param rampUpCapacityThresholdPct the rampUpCapacityThresholdPct value to set. - * @return the ScalingPlanPooledSchedulePatch object itself. - */ - public ScalingPlanPooledSchedulePatch withRampUpCapacityThresholdPct(Integer rampUpCapacityThresholdPct) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); - } - this.innerProperties().withRampUpCapacityThresholdPct(rampUpCapacityThresholdPct); - return this; - } - - /** - * Get the peakStartTime property: Starting time for peak period. - * - * @return the peakStartTime value. - */ - public Time peakStartTime() { - return this.innerProperties() == null ? null : this.innerProperties().peakStartTime(); - } - - /** - * Set the peakStartTime property: Starting time for peak period. - * - * @param peakStartTime the peakStartTime value to set. - * @return the ScalingPlanPooledSchedulePatch object itself. - */ - public ScalingPlanPooledSchedulePatch withPeakStartTime(Time peakStartTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); - } - this.innerProperties().withPeakStartTime(peakStartTime); - return this; - } - - /** - * Get the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period. - * - * @return the peakLoadBalancingAlgorithm value. - */ - public SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm() { - return this.innerProperties() == null ? null : this.innerProperties().peakLoadBalancingAlgorithm(); - } - - /** - * Set the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period. - * - * @param peakLoadBalancingAlgorithm the peakLoadBalancingAlgorithm value to set. - * @return the ScalingPlanPooledSchedulePatch object itself. - */ - public ScalingPlanPooledSchedulePatch - withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); - } - this.innerProperties().withPeakLoadBalancingAlgorithm(peakLoadBalancingAlgorithm); - return this; - } - - /** - * Get the rampDownStartTime property: Starting time for ramp down period. - * - * @return the rampDownStartTime value. - */ - public Time rampDownStartTime() { - return this.innerProperties() == null ? null : this.innerProperties().rampDownStartTime(); - } - - /** - * Set the rampDownStartTime property: Starting time for ramp down period. - * - * @param rampDownStartTime the rampDownStartTime value to set. - * @return the ScalingPlanPooledSchedulePatch object itself. - */ - public ScalingPlanPooledSchedulePatch withRampDownStartTime(Time rampDownStartTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); - } - this.innerProperties().withRampDownStartTime(rampDownStartTime); - return this; - } - - /** - * Get the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period. - * - * @return the rampDownLoadBalancingAlgorithm value. - */ - public SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm() { - return this.innerProperties() == null ? null : this.innerProperties().rampDownLoadBalancingAlgorithm(); - } - - /** - * Set the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period. - * - * @param rampDownLoadBalancingAlgorithm the rampDownLoadBalancingAlgorithm value to set. - * @return the ScalingPlanPooledSchedulePatch object itself. - */ - public ScalingPlanPooledSchedulePatch - withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); - } - this.innerProperties().withRampDownLoadBalancingAlgorithm(rampDownLoadBalancingAlgorithm); - return this; - } - - /** - * Get the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period. - * - * @return the rampDownMinimumHostsPct value. - */ - public Integer rampDownMinimumHostsPct() { - return this.innerProperties() == null ? null : this.innerProperties().rampDownMinimumHostsPct(); - } - - /** - * Set the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period. - * - * @param rampDownMinimumHostsPct the rampDownMinimumHostsPct value to set. - * @return the ScalingPlanPooledSchedulePatch object itself. - */ - public ScalingPlanPooledSchedulePatch withRampDownMinimumHostsPct(Integer rampDownMinimumHostsPct) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); - } - this.innerProperties().withRampDownMinimumHostsPct(rampDownMinimumHostsPct); - return this; - } - - /** - * Get the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period. - * - * @return the rampDownCapacityThresholdPct value. - */ - public Integer rampDownCapacityThresholdPct() { - return this.innerProperties() == null ? null : this.innerProperties().rampDownCapacityThresholdPct(); - } - - /** - * Set the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period. - * - * @param rampDownCapacityThresholdPct the rampDownCapacityThresholdPct value to set. - * @return the ScalingPlanPooledSchedulePatch object itself. - */ - public ScalingPlanPooledSchedulePatch withRampDownCapacityThresholdPct(Integer rampDownCapacityThresholdPct) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); - } - this.innerProperties().withRampDownCapacityThresholdPct(rampDownCapacityThresholdPct); - return this; - } - - /** - * Get the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts. - * - * @return the rampDownForceLogoffUsers value. - */ - public Boolean rampDownForceLogoffUsers() { - return this.innerProperties() == null ? null : this.innerProperties().rampDownForceLogoffUsers(); - } - - /** - * Set the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts. - * - * @param rampDownForceLogoffUsers the rampDownForceLogoffUsers value to set. - * @return the ScalingPlanPooledSchedulePatch object itself. - */ - public ScalingPlanPooledSchedulePatch withRampDownForceLogoffUsers(Boolean rampDownForceLogoffUsers) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); - } - this.innerProperties().withRampDownForceLogoffUsers(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.innerProperties() == null ? null : this.innerProperties().rampDownStopHostsWhen(); - } - - /** - * Set the rampDownStopHostsWhen property: Specifies when to stop hosts during ramp down period. - * - * @param rampDownStopHostsWhen the rampDownStopHostsWhen value to set. - * @return the ScalingPlanPooledSchedulePatch object itself. - */ - public ScalingPlanPooledSchedulePatch withRampDownStopHostsWhen(StopHostsWhen rampDownStopHostsWhen) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); - } - this.innerProperties().withRampDownStopHostsWhen(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.innerProperties() == null ? null : this.innerProperties().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 ScalingPlanPooledSchedulePatch object itself. - */ - public ScalingPlanPooledSchedulePatch withRampDownWaitTimeMinutes(Integer rampDownWaitTimeMinutes) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); - } - this.innerProperties().withRampDownWaitTimeMinutes(rampDownWaitTimeMinutes); - return this; - } - - /** - * Get the rampDownNotificationMessage property: Notification message for users during ramp down period. - * - * @return the rampDownNotificationMessage value. - */ - public String rampDownNotificationMessage() { - return this.innerProperties() == null ? null : this.innerProperties().rampDownNotificationMessage(); - } - - /** - * Set the rampDownNotificationMessage property: Notification message for users during ramp down period. - * - * @param rampDownNotificationMessage the rampDownNotificationMessage value to set. - * @return the ScalingPlanPooledSchedulePatch object itself. - */ - public ScalingPlanPooledSchedulePatch withRampDownNotificationMessage(String rampDownNotificationMessage) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); - } - this.innerProperties().withRampDownNotificationMessage(rampDownNotificationMessage); - return this; - } - - /** - * Get the offPeakStartTime property: Starting time for off-peak period. - * - * @return the offPeakStartTime value. - */ - public Time offPeakStartTime() { - return this.innerProperties() == null ? null : this.innerProperties().offPeakStartTime(); - } - - /** - * Set the offPeakStartTime property: Starting time for off-peak period. - * - * @param offPeakStartTime the offPeakStartTime value to set. - * @return the ScalingPlanPooledSchedulePatch object itself. - */ - public ScalingPlanPooledSchedulePatch withOffPeakStartTime(Time offPeakStartTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); - } - this.innerProperties().withOffPeakStartTime(offPeakStartTime); - return this; - } - - /** - * Get the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period. - * - * @return the offPeakLoadBalancingAlgorithm value. - */ - public SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm() { - return this.innerProperties() == null ? null : this.innerProperties().offPeakLoadBalancingAlgorithm(); - } - - /** - * Set the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period. - * - * @param offPeakLoadBalancingAlgorithm the offPeakLoadBalancingAlgorithm value to set. - * @return the ScalingPlanPooledSchedulePatch object itself. - */ - public ScalingPlanPooledSchedulePatch - withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPooledScheduleProperties(); - } - this.innerProperties().withOffPeakLoadBalancingAlgorithm(offPeakLoadBalancingAlgorithm); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -510,7 +124,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -538,8 +152,8 @@ public static ScalingPlanPooledSchedulePatch fromJson(JsonReader jsonReader) thr } else if ("type".equals(fieldName)) { deserializedScalingPlanPooledSchedulePatch.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedScalingPlanPooledSchedulePatch.innerProperties - = ScalingPlanPooledScheduleProperties.fromJson(reader); + deserializedScalingPlanPooledSchedulePatch.properties + = 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/ScalingPlanPooledSchedulePatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedulePatchProperties.java new file mode 100644 index 000000000000..091efca7f80f --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedulePatchProperties.java @@ -0,0 +1,609 @@ +// 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; +import java.util.List; + +/** + * A ScalingPlanPooledSchedule that can be patched. + */ +@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; + + /* + * 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; + } + + /** + * Set the name property: Name of the ScalingPlanPooledSchedule. + * + * @param name the name value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withName(String name) { + this.name = name; + return this; + } + + /** + * 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 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 (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.writeStringField("name", this.name); + jsonWriter.writeArrayField("daysOfWeek", this.daysOfWeek, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + 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 ("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/models/ScalingPlanPooledSchedules.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedules.java index 47a01b94e020..2a5cd5569d83 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedules.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedules.java @@ -13,35 +13,36 @@ */ public interface ScalingPlanPooledSchedules { /** - * Get a ScalingPlanPooledSchedule. + * List ScalingPlanPooledSchedules. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ScalingPlanPooledSchedule along with {@link Response}. + * @return list of ScalingPlanPooledSchedule definitions as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName, Context context); + PagedIterable list(String resourceGroupName, String scalingPlanName); /** - * Get a ScalingPlanPooledSchedule. + * List ScalingPlanPooledSchedules. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ScalingPlanPooledSchedule. + * @return list of ScalingPlanPooledSchedule definitions as paginated response with {@link PagedIterable}. */ - ScalingPlanPooledSchedule get(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); + PagedIterable list(String resourceGroupName, String scalingPlanName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** - * Remove a ScalingPlanPooledSchedule. + * Get a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. @@ -50,13 +51,13 @@ Response getWithResponse(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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}. + * @return a ScalingPlanPooledSchedule along with {@link Response}. */ - Response deleteWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, - Context context); + Response getWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context); /** - * Remove a ScalingPlanPooledSchedule. + * Get a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. @@ -64,37 +65,36 @@ Response deleteWithResponse(String resourceGroupName, String scalingPlanNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ScalingPlanPooledSchedule. */ - void delete(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); + ScalingPlanPooledSchedule get(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); /** - * List ScalingPlanPooledSchedules. + * Remove a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPooledScheduleList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - PagedIterable list(String resourceGroupName, String scalingPlanName); + Response deleteWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, + Context context); /** - * List ScalingPlanPooledSchedules. + * Remove a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPooledScheduleList as paginated response with {@link PagedIterable}. */ - PagedIterable list(String resourceGroupName, String scalingPlanName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context); + void delete(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); /** * Get a ScalingPlanPooledSchedule. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlans.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlans.java index c7be030bdd61..778874db70e5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlans.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlans.java @@ -13,54 +13,56 @@ */ public interface ScalingPlans { /** - * Get a scaling plan. + * List scaling plans in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a scaling plan along with {@link Response}. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String scalingPlanName, - Context context); + PagedIterable list(); /** - * Get a scaling plan. + * List scaling plans in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a scaling plan. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. */ - ScalingPlan getByResourceGroup(String resourceGroupName, String scalingPlanName); + PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** - * Remove a scaling plan. + * List scaling plan associated with hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. - * @param context The context to associate with this operation. + * @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 Response}. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. */ - Response deleteByResourceGroupWithResponse(String resourceGroupName, String scalingPlanName, Context context); + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); /** - * Remove a scaling plan. + * List scaling plan associated with hostpool. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scalingPlanName The name of the scaling plan. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. */ - void deleteByResourceGroup(String resourceGroupName, String scalingPlanName); + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** * List scaling plans. @@ -69,7 +71,7 @@ Response getByResourceGroupWithResponse(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedIterable}. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -84,62 +86,60 @@ Response getByResourceGroupWithResponse(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedIterable}. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** - * List scaling plans in subscription. + * Get a scaling plan. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedIterable}. + * @return a scaling plan along with {@link Response}. */ - PagedIterable list(); + Response getByResourceGroupWithResponse(String resourceGroupName, String scalingPlanName, + Context context); /** - * List scaling plans in subscription. + * Get a scaling plan. * - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedIterable}. + * @return a scaling plan. */ - PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + ScalingPlan getByResourceGroup(String resourceGroupName, String scalingPlanName); /** - * List scaling plan associated with hostpool. + * Remove a scaling plan. * * @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 scalingPlanName The name of the scaling plan. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); + Response deleteByResourceGroupWithResponse(String resourceGroupName, String scalingPlanName, Context context); /** - * List scaling plan associated with hostpool. + * Remove a scaling plan. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanList as paginated response with {@link PagedIterable}. */ - PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context); + void deleteByResourceGroup(String resourceGroupName, String scalingPlanName); /** * Get a scaling plan. 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..bb7119215282 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,7 @@ public final class ScalingSchedule implements JsonSerializable /* * Set of days of the week on which this schedule is active. */ - private List daysOfWeek; + private List daysOfWeek; /* * Starting time for ramp up period. @@ -138,7 +138,7 @@ public ScalingSchedule withName(String name) { * * @return the daysOfWeek value. */ - public List daysOfWeek() { + public List daysOfWeek() { return this.daysOfWeek; } @@ -148,7 +148,7 @@ 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; } @@ -548,8 +548,7 @@ 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 ("rampUpStartTime".equals(fieldName)) { deserializedScalingSchedule.rampUpStartTime = Time.fromJson(reader); 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..fa29ca17e0f3 --- /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. 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 SecurityInfoPatchProperties class. + */ + public SecurityInfoPatchProperties() { + } + + /** + * 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 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..c7e371295c6a --- /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..4689274e2906 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 @@ -153,6 +153,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..006c1ffb624c --- /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..95283fe136c5 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurationList.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 com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * List of SessionHostConfiguration definitions. + */ +@Fluent +public final class SessionHostConfigurationList implements JsonSerializable { + /* + * The SessionHostConfiguration items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SessionHostConfigurationList class. + */ + public SessionHostConfigurationList() { + } + + /** + * Get the value property: The SessionHostConfiguration items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The SessionHostConfiguration items on this page. + * + * @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: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the SessionHostConfigurationList object itself. + */ + public SessionHostConfigurationList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model SessionHostConfigurationList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SessionHostConfigurationList.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of 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 IllegalStateException If the deserialized JSON object was missing any required properties. + * @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..db36d45c8630 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurationPatch.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + +/** + * SessionHostConfiguration properties that can be patched. + */ +@Fluent +public final class SessionHostConfigurationPatch implements JsonSerializable { + /* + * Detailed properties for SessionHostConfiguration + */ + private SessionHostConfigurationPatchProperties properties; + + /** + * Creates an instance of SessionHostConfigurationPatch class. + */ + public SessionHostConfigurationPatch() { + } + + /** + * Get the properties property: Detailed properties for SessionHostConfiguration. + * + * @return the properties value. + */ + public SessionHostConfigurationPatchProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Detailed properties for SessionHostConfiguration. + * + * @param properties the properties value to set. + * @return the SessionHostConfigurationPatch object itself. + */ + public SessionHostConfigurationPatch withProperties(SessionHostConfigurationPatchProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + 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.properties + = SessionHostConfigurationPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostConfigurationPatch; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurationPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurationPatchProperties.java new file mode 100644 index 000000000000..78f6b9c30143 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurationPatchProperties.java @@ -0,0 +1,536 @@ +// 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; +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. 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 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. 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 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/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..a1ecbd5b05a1 --- /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 { + /** + * 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 list of SessionHostConfiguration definitions 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 list of SessionHostConfiguration definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable listByHostPool(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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties. + */ + 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 Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties. + */ + 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 schema for SessionHostConfiguration properties. + */ + 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 The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostConfiguration properties. + */ + SessionHostConfiguration update(String resourceGroupName, String hostPoolName, + SessionHostConfigurationPatch sessionHostConfiguration, Context context); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostList.java index a69f2f8c8c9a..53adf4ed669e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostList.java @@ -5,6 +5,7 @@ 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; @@ -14,19 +15,17 @@ import java.util.List; /** - * SessionHostList - * * List of SessionHost definitions. */ @Fluent public final class SessionHostList implements JsonSerializable { /* - * List of SessionHost definitions. + * The SessionHost items on this page */ private List value; /* - * Link to the next page of results. + * The link to the next page of items */ private String nextLink; @@ -37,7 +36,7 @@ public SessionHostList() { } /** - * Get the value property: List of SessionHost definitions. + * Get the value property: The SessionHost items on this page. * * @return the value value. */ @@ -46,7 +45,7 @@ public List value() { } /** - * Set the value property: List of SessionHost definitions. + * Set the value property: The SessionHost items on this page. * * @param value the value value to set. * @return the SessionHostList object itself. @@ -57,7 +56,7 @@ public SessionHostList withValue(List value) { } /** - * Get the nextLink property: Link to the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,17 +64,33 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the SessionHostList object itself. + */ + public SessionHostList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model SessionHostList")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(SessionHostList.class); + /** * {@inheritDoc} */ @@ -83,6 +98,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -92,6 +108,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of SessionHostList 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 SessionHostList. */ public static SessionHostList fromJson(JsonReader jsonReader) throws IOException { 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..17432b44fa23 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementList.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 com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; +import java.io.IOException; +import java.util.List; + +/** + * List of SessionHostManagement definitions. + */ +@Fluent +public final class SessionHostManagementList implements JsonSerializable { + /* + * The SessionHostManagement items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SessionHostManagementList class. + */ + public SessionHostManagementList() { + } + + /** + * Get the value property: The SessionHostManagement items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The SessionHostManagement items on this page. + * + * @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: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the SessionHostManagementList object itself. + */ + public SessionHostManagementList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property value in model SessionHostManagementList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SessionHostManagementList.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of 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 IllegalStateException If the deserialized JSON object was missing any required properties. + * @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..c00b9537804e --- /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..855f9df56f9c --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementPatch.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; + +/** + * SessionHostManagement properties that can be patched. + */ +@Fluent +public final class SessionHostManagementPatch implements JsonSerializable { + /* + * Detailed properties for SessionHostManagement + */ + private SessionHostManagementPatchProperties properties; + + /** + * Creates an instance of SessionHostManagementPatch class. + */ + public SessionHostManagementPatch() { + } + + /** + * Get the properties property: Detailed properties for SessionHostManagement. + * + * @return the properties value. + */ + public SessionHostManagementPatchProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Detailed properties for SessionHostManagement. + * + * @param properties the properties value to set. + * @return the SessionHostManagementPatch object itself. + */ + public SessionHostManagementPatch withProperties(SessionHostManagementPatchProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + 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.properties + = SessionHostManagementPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostManagementPatch; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementPatchProperties.java new file mode 100644 index 000000000000..f821de46403c --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementPatchProperties.java @@ -0,0 +1,133 @@ +// 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; + +/** + * Represents a SessionHostManagementPatch definition. + */ +@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/models/SessionHostManagementUpdateOperationStatus.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementUpdateOperationStatus.java new file mode 100644 index 000000000000..3b871257da43 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementUpdateOperationStatus.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Operation status for SessionHostManagementUpdate. + */ +public final class SessionHostManagementUpdateOperationStatus + extends ExpandableStringEnum { + /** + * Static value Error for SessionHostManagementUpdateOperationStatus. + */ + public static final SessionHostManagementUpdateOperationStatus ERROR = fromString("Error"); + + /** + * Static value Scheduled for SessionHostManagementUpdateOperationStatus. + */ + public static final SessionHostManagementUpdateOperationStatus SCHEDULED = fromString("Scheduled"); + + /** + * Static value UpdatingSessionHosts for SessionHostManagementUpdateOperationStatus. + */ + public static final SessionHostManagementUpdateOperationStatus UPDATING_SESSION_HOSTS + = fromString("UpdatingSessionHosts"); + + /** + * Static value ValidatingSessionHostUpdate for SessionHostManagementUpdateOperationStatus. + */ + public static final SessionHostManagementUpdateOperationStatus VALIDATING_SESSION_HOST_UPDATE + = fromString("ValidatingSessionHostUpdate"); + + /** + * Static value Paused for SessionHostManagementUpdateOperationStatus. + */ + public static final SessionHostManagementUpdateOperationStatus PAUSED = fromString("Paused"); + + /** + * Static value Pausing for SessionHostManagementUpdateOperationStatus. + */ + public static final SessionHostManagementUpdateOperationStatus PAUSING = fromString("Pausing"); + + /** + * Static value Cancelling for SessionHostManagementUpdateOperationStatus. + */ + public static final SessionHostManagementUpdateOperationStatus CANCELLING = fromString("Cancelling"); + + /** + * Static value Succeeded for SessionHostManagementUpdateOperationStatus. + */ + public static final SessionHostManagementUpdateOperationStatus SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for SessionHostManagementUpdateOperationStatus. + */ + public static final SessionHostManagementUpdateOperationStatus FAILED = fromString("Failed"); + + /** + * Static value Cancelled for SessionHostManagementUpdateOperationStatus. + */ + public static final SessionHostManagementUpdateOperationStatus CANCELLED = fromString("Cancelled"); + + /** + * Creates a new instance of SessionHostManagementUpdateOperationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SessionHostManagementUpdateOperationStatus() { + } + + /** + * Creates or finds a SessionHostManagementUpdateOperationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SessionHostManagementUpdateOperationStatus. + */ + public static SessionHostManagementUpdateOperationStatus fromString(String name) { + return fromString(name, SessionHostManagementUpdateOperationStatus.class); + } + + /** + * Gets known SessionHostManagementUpdateOperationStatus values. + * + * @return known SessionHostManagementUpdateOperationStatus values. + */ + public static Collection values() { + return values(SessionHostManagementUpdateOperationStatus.class); + } +} 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..0177f4d2bfc7 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementUpdateStatus.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + Double percentComplete(); + + /** + * Gets the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the error property: If present, details of the operation error. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the status property: Operation status. Current defined values are < Error | Scheduled | + * UpdatingSessionHosts | ValidatingSessionHostUpdate | Paused | Pausing | Cancelling > | Succeeded | Failed | + * Canceled. + * + * @return the status value. + */ + SessionHostManagementUpdateOperationStatus status(); + + /** + * Gets the properties property: Properties bag to hold custom RP properties for sessionHostManagement Update + * Statuses. + * + * @return the properties value. + */ + SessionHostManagementUpdateStatusProperties properties(); + + /** + * 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..e55aa78ca434 --- /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 { + /** + * List SessionHostManagements. + * + * @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 list of SessionHostManagement definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); + + /** + * List SessionHostManagements. + * + * @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 list of SessionHostManagement definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable listByHostPool(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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostManagement properties 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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostManagement properties. + */ + 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 The properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for SessionHostManagement properties 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 schema for SessionHostManagement properties. + */ + SessionHostManagement update(String resourceGroupName, String hostPoolName); +} 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..47a5f479469e --- /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 a SessionHostManagementUpdateStatus. + * + * @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 SessionHostManagementUpdateStatus along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context); + + /** + * Get a SessionHostManagementUpdateStatus. + * + * @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 SessionHostManagementUpdateStatus. + */ + SessionHostManagementUpdateStatus get(String resourceGroupName, String hostPoolName); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostPatch.java index 0e6249f61b2c..dca5413df2ad 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostPatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostPatch.java @@ -10,7 +10,6 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostPatchProperties; import java.io.IOException; /** @@ -21,7 +20,7 @@ public final class SessionHostPatch extends ProxyResource { /* * Detailed properties for SessionHost */ - private SessionHostPatchProperties innerProperties; + private SessionHostPatchProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -50,12 +49,23 @@ public SessionHostPatch() { } /** - * Get the innerProperties property: Detailed properties for SessionHost. + * Get the properties property: Detailed properties for SessionHost. * - * @return the innerProperties value. + * @return the properties value. */ - private SessionHostPatchProperties innerProperties() { - return this.innerProperties; + public SessionHostPatchProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Detailed properties for SessionHost. + * + * @param properties the properties value to set. + * @return the SessionHostPatch object itself. + */ + public SessionHostPatch withProperties(SessionHostPatchProperties properties) { + this.properties = properties; + return this; } /** @@ -97,83 +107,14 @@ public String id() { return this.id; } - /** - * Get the allowNewSession property: Allow a new session. - * - * @return the allowNewSession value. - */ - public Boolean allowNewSession() { - return this.innerProperties() == null ? null : this.innerProperties().allowNewSession(); - } - - /** - * Set the allowNewSession property: Allow a new session. - * - * @param allowNewSession the allowNewSession value to set. - * @return the SessionHostPatch object itself. - */ - public SessionHostPatch withAllowNewSession(Boolean allowNewSession) { - if (this.innerProperties() == null) { - this.innerProperties = new SessionHostPatchProperties(); - } - this.innerProperties().withAllowNewSession(allowNewSession); - return this; - } - - /** - * Get the assignedUser property: User assigned to SessionHost. - * - * @return the assignedUser value. - */ - public String assignedUser() { - return this.innerProperties() == null ? null : this.innerProperties().assignedUser(); - } - - /** - * Set the assignedUser property: User assigned to SessionHost. - * - * @param assignedUser the assignedUser value to set. - * @return the SessionHostPatch object itself. - */ - public SessionHostPatch withAssignedUser(String assignedUser) { - if (this.innerProperties() == null) { - this.innerProperties = new SessionHostPatchProperties(); - } - this.innerProperties().withAssignedUser(assignedUser); - return this; - } - - /** - * Get the friendlyName property: Friendly name of SessionHost. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); - } - - /** - * Set the friendlyName property: Friendly name of SessionHost. - * - * @param friendlyName the friendlyName value to set. - * @return the SessionHostPatch object itself. - */ - public SessionHostPatch withFriendlyName(String friendlyName) { - if (this.innerProperties() == null) { - this.innerProperties = new SessionHostPatchProperties(); - } - this.innerProperties().withFriendlyName(friendlyName); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -183,7 +124,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -210,7 +151,7 @@ public static SessionHostPatch fromJson(JsonReader jsonReader) throws IOExceptio } else if ("type".equals(fieldName)) { deserializedSessionHostPatch.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedSessionHostPatch.innerProperties = SessionHostPatchProperties.fromJson(reader); + deserializedSessionHostPatch.properties = SessionHostPatchProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedSessionHostPatch.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostPatchProperties.java similarity index 98% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostPatchProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostPatchProperties.java index 662ac2a2511c..72cbd22efcd2 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostPatchProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostPatchProperties.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.desktopvirtualization.fluent.models; +package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; 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..ecc31474d16c 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 @@ -12,6 +12,36 @@ * Resource collection API of SessionHosts. */ public interface SessionHosts { + /** + * List sessionHosts. + * + * @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 list of SessionHost definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String hostPoolName); + + /** + * List sessionHosts. + * + * @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 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SessionHost definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, String vmPath, Context context); + /** * Get a session host. * @@ -41,23 +71,24 @@ Response getWithResponse(String resourceGroupName, String hostPoolN SessionHost get(String resourceGroupName, String hostPoolName, String sessionHostname); /** - * Remove a SessionHost. + * Update a session host. * * @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 force Force flag to force sessionHost deletion even when userSession exists. + * @param force Force flag to update assign, unassign or reassign personal desktop. + * @param sessionHost The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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}. + * @return represents a SessionHost definition along with {@link Response}. */ - Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, - Boolean force, Context context); + Response updateWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Boolean force, SessionHostPatch sessionHost, Context context); /** - * Remove a SessionHost. + * Update a session host. * * @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. @@ -65,28 +96,28 @@ Response deleteWithResponse(String resourceGroupName, String hostPoolName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 SessionHost definition. */ - void delete(String resourceGroupName, String hostPoolName, String sessionHostname); + SessionHost update(String resourceGroupName, String hostPoolName, String sessionHostname); /** - * Update a session host. + * Remove 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 force Force flag to update assign, unassign or reassign personal desktop. - * @param sessionHost Object containing SessionHost definitions. + * @param force Force flag to force sessionHost deletion even when userSession exists. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 SessionHost definition along with {@link Response}. + * @return the {@link Response}. */ - Response updateWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, - Boolean force, SessionHostPatch sessionHost, Context context); + Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Boolean force, Context context); /** - * Update a session host. + * Remove 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. @@ -94,36 +125,33 @@ Response updateWithResponse(String resourceGroupName, String hostPo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 SessionHost definition. */ - SessionHost update(String resourceGroupName, String hostPoolName, String sessionHostname); + void delete(String resourceGroupName, String hostPoolName, String sessionHostname); /** - * List sessionHosts. + * A synchronous resource action that returns no content. * * @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 sessionHostList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - PagedIterable list(String resourceGroupName, String hostPoolName); + Response retryProvisioningWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Context context); /** - * List sessionHosts. + * A synchronous resource action that returns no content. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @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 sessionHostList as paginated response with {@link PagedIterable}. */ - PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context); + void retryProvisioning(String resourceGroupName, String hostPoolName, String sessionHostname); } 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/StartMenuItem.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItem.java index 6e181ef87e65..3fcce41d49d0 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItem.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItem.java @@ -33,46 +33,18 @@ public interface StartMenuItem { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the appAlias property: Alias of StartMenuItem. - * - * @return the appAlias value. - */ - String appAlias(); - - /** - * Gets the filePath property: Path to the file of StartMenuItem. + * Gets the properties property: Detailed properties for StartMenuItem. * - * @return the filePath value. + * @return the properties value. */ - String filePath(); + StartMenuItemProperties properties(); /** - * Gets the commandLineArguments property: Command line arguments for StartMenuItem. - * - * @return the commandLineArguments value. - */ - String commandLineArguments(); - - /** - * Gets the iconPath property: Path to the icon. - * - * @return the iconPath value. - */ - String iconPath(); - - /** - * Gets the iconIndex property: Index of the icon. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the iconIndex value. + * @return the systemData value. */ - Integer iconIndex(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.StartMenuItemInner object. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItemList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItemList.java index 0b60ad2e0cf3..e3dbbfff9ddf 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItemList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItemList.java @@ -5,6 +5,7 @@ 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; @@ -14,19 +15,17 @@ import java.util.List; /** - * StartMenuItemList - * * List of StartMenuItem definitions. */ @Fluent public final class StartMenuItemList implements JsonSerializable { /* - * List of StartMenuItem definitions. + * The StartMenuItem items on this page */ private List value; /* - * Link to the next page of results. + * The link to the next page of items */ private String nextLink; @@ -37,7 +36,7 @@ public StartMenuItemList() { } /** - * Get the value property: List of StartMenuItem definitions. + * Get the value property: The StartMenuItem items on this page. * * @return the value value. */ @@ -46,7 +45,7 @@ public List value() { } /** - * Set the value property: List of StartMenuItem definitions. + * Set the value property: The StartMenuItem items on this page. * * @param value the value value to set. * @return the StartMenuItemList object itself. @@ -57,7 +56,7 @@ public StartMenuItemList withValue(List value) { } /** - * Get the nextLink property: Link to the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,17 +64,33 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the StartMenuItemList object itself. + */ + public StartMenuItemList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model StartMenuItemList")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(StartMenuItemList.class); + /** * {@inheritDoc} */ @@ -83,6 +98,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -92,6 +108,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of StartMenuItemList 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 StartMenuItemList. */ public static StartMenuItemList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/StartMenuItemProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItemProperties.java similarity index 98% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/StartMenuItemProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItemProperties.java index 852802ab2642..670aa38b32d2 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/StartMenuItemProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItemProperties.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.desktopvirtualization.fluent.models; +package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItems.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItems.java index 6a93a98e939f..f4ae5422a2b3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItems.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItems.java @@ -19,7 +19,7 @@ public interface StartMenuItems { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return startMenuItemList as paginated response with {@link PagedIterable}. + * @return list of StartMenuItem definitions as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String applicationGroupName); @@ -35,7 +35,7 @@ public interface StartMenuItems { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return startMenuItemList as paginated response with {@link PagedIterable}. + * @return list of StartMenuItem definitions as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); 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/UserSessionList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSessionList.java index 00c30fba7426..687241314ed7 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSessionList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSessionList.java @@ -5,6 +5,7 @@ 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; @@ -14,19 +15,17 @@ import java.util.List; /** - * UserSessionList - * * List of UserSession definitions. */ @Fluent public final class UserSessionList implements JsonSerializable { /* - * List of UserSession definitions. + * The UserSession items on this page */ private List value; /* - * Link to the next page of results. + * The link to the next page of items */ private String nextLink; @@ -37,7 +36,7 @@ public UserSessionList() { } /** - * Get the value property: List of UserSession definitions. + * Get the value property: The UserSession items on this page. * * @return the value value. */ @@ -46,7 +45,7 @@ public List value() { } /** - * Set the value property: List of UserSession definitions. + * Set the value property: The UserSession items on this page. * * @param value the value value to set. * @return the UserSessionList object itself. @@ -57,7 +56,7 @@ public UserSessionList withValue(List value) { } /** - * Get the nextLink property: Link to the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,17 +64,33 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the UserSessionList object itself. + */ + public UserSessionList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model UserSessionList")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(UserSessionList.class); + /** * {@inheritDoc} */ @@ -83,6 +98,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -92,6 +108,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of UserSessionList 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 UserSessionList. */ public static UserSessionList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSessions.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSessions.java index 15f117fcaa2e..2d7ea4fab153 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSessions.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSessions.java @@ -17,19 +17,20 @@ public interface UserSessions { * * @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 userSessionList as paginated response with {@link PagedIterable}. + * @return list of UserSession definitions as paginated response with {@link PagedIterable}. */ - PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); + PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname); /** * List userSessions. * * @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 filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @param sessionHostname The name of the session host within the specified host pool. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -37,9 +38,9 @@ public interface UserSessions { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList as paginated response with {@link PagedIterable}. + * @return list of UserSession definitions as paginated response with {@link PagedIterable}. */ - PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, String filter, + PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** @@ -103,54 +104,53 @@ Response deleteWithResponse(String resourceGroupName, String hostPoolName, void delete(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); /** - * List userSessions. + * Disconnect a userSession. * * @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 userSessionId The name of the user session within the specified session host. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname); + Response disconnectWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, Context context); /** - * List userSessions. + * Disconnect a userSession. * * @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 pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param userSessionId The name of the user session within the specified session host. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return userSessionList as paginated response with {@link PagedIterable}. */ - PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + void disconnect(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); /** - * Disconnect a userSession. + * Send a message to a user. * * @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 userSessionId The name of the user session within the specified session host. + * @param sendMessage The sendMessage parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response disconnectWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, - String userSessionId, Context context); + Response sendMessageWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, SendMessage sendMessage, Context context); /** - * Disconnect a userSession. + * Send a message to a user. * * @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. @@ -160,35 +160,35 @@ Response disconnectWithResponse(String resourceGroupName, String hostPoolN * @throws com.azure.core.management.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 disconnect(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); + void sendMessage(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); /** - * Send a message to a user. + * A synchronous resource action. * * @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 userSessionId The name of the user session within the specified session host. - * @param sendMessage Object containing message includes title and message body. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return list of UserSession definitions as paginated response with {@link PagedIterable}. */ - Response sendMessageWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, - String userSessionId, SendMessage sendMessage, Context context); + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); /** - * Send a message to a user. + * A synchronous resource action. * * @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 userSessionId The name of the user session within the specified session host. + * @param filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of UserSession definitions as paginated response with {@link PagedIterable}. */ - void sendMessage(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); } 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..f6c3ab5c5def 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 @@ -51,17 +51,25 @@ public interface Workspace { Map tags(); /** - * Gets the managedBy property: The fully qualified resource ID of the resource that manages this resource. - * Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment - * will not delete the resource if it is removed from the template since it is managed by another resource. + * Gets the identity property: The managed service identities assigned to this resource. * - * @return the managedBy value. + * @return the identity value. */ - String managedBy(); + ManagedServiceIdentity identity(); + + /** + * Gets the etag property: If etag is provided in the response body, it may also be provided as a header per the + * normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. + * HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), + * and If-Range (section 14.27) header fields. + * + * @return the etag value. + */ + String etag(); /** * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of - * the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must * validate and persist this value. * * @return the kind value. @@ -69,35 +77,27 @@ public interface Workspace { String kind(); /** - * Gets the etag property: The etag field is *not* required. If it is provided in the response body, it must also be - * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from - * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), - * If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + * Gets the managedBy property: The fully qualified resource ID of the resource that manages this resource. + * Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment + * will not delete the resource if it is removed from the template since it is managed by another resource. * - * @return the etag value. + * @return the managedBy value. */ - String etag(); + String managedBy(); /** - * Gets the identity property: The identity property. + * Gets the plan property: Details of the resource plan. * - * @return the identity value. + * @return the plan value. */ - ResourceModelWithAllowedPropertySetIdentity identity(); + Plan plan(); /** - * Gets the sku property: The sku property. + * Gets the sku property: The SKU (Stock Keeping Unit) assigned to this resource. * * @return the sku value. */ - ResourceModelWithAllowedPropertySetSku sku(); - - /** - * Gets the plan property: The plan property. - * - * @return the plan value. - */ - ResourceModelWithAllowedPropertySetPlan plan(); + Sku sku(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -240,9 +240,9 @@ interface WithResourceGroup { * The stage of the Workspace definition which contains all the minimum required properties for the resource to * be created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithManagedBy, - DefinitionStages.WithKind, DefinitionStages.WithIdentity, DefinitionStages.WithSku, - DefinitionStages.WithPlan, DefinitionStages.WithDescription, DefinitionStages.WithFriendlyName, + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithKind, DefinitionStages.WithManagedBy, DefinitionStages.WithPlan, + DefinitionStages.WithSku, DefinitionStages.WithDescription, DefinitionStages.WithFriendlyName, DefinitionStages.WithApplicationGroupReferences, DefinitionStages.WithPublicNetworkAccess { /** * Executes the create request. @@ -274,21 +274,16 @@ interface WithTags { } /** - * The stage of the Workspace definition allowing to specify managedBy. + * The stage of the Workspace definition allowing to specify identity. */ - interface WithManagedBy { + interface WithIdentity { /** - * Specifies the managedBy property: The fully qualified resource ID of the resource that manages this - * resource. Indicates if this resource is managed by another Azure resource. If this is present, complete - * mode deployment will not delete the resource if it is removed from the template since it is managed by - * another resource.. + * Specifies the identity property: The managed service identities assigned to this resource.. * - * @param managedBy The fully qualified resource ID of the resource that manages this resource. Indicates if - * this resource is managed by another Azure resource. If this is present, complete mode deployment will not - * delete the resource if it is removed from the template since it is managed by another resource. + * @param identity The managed service identities assigned to this resource. * @return the next definition stage. */ - WithCreate withManagedBy(String managedBy); + WithCreate withIdentity(ManagedServiceIdentity identity); } /** @@ -297,11 +292,11 @@ interface WithManagedBy { interface WithKind { /** * Specifies the kind property: Metadata used by portal/tooling/etc to render different UX experiences for - * resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the + * resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the * resource provider must validate and persist this value.. * * @param kind Metadata used by portal/tooling/etc to render different UX experiences for resources of the - * same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must * validate and persist this value. * @return the next definition stage. */ @@ -309,42 +304,47 @@ interface WithKind { } /** - * The stage of the Workspace definition allowing to specify identity. + * The stage of the Workspace definition allowing to specify managedBy. */ - interface WithIdentity { + interface WithManagedBy { /** - * Specifies the identity property: The identity property.. + * Specifies the managedBy property: The fully qualified resource ID of the resource that manages this + * resource. Indicates if this resource is managed by another Azure resource. If this is present, complete + * mode deployment will not delete the resource if it is removed from the template since it is managed by + * another resource.. * - * @param identity The identity property. + * @param managedBy The fully qualified resource ID of the resource that manages this resource. Indicates if + * this resource is managed by another Azure resource. If this is present, complete mode deployment will not + * delete the resource if it is removed from the template since it is managed by another resource. * @return the next definition stage. */ - WithCreate withIdentity(ResourceModelWithAllowedPropertySetIdentity identity); + WithCreate withManagedBy(String managedBy); } /** - * The stage of the Workspace definition allowing to specify sku. + * The stage of the Workspace definition allowing to specify plan. */ - interface WithSku { + interface WithPlan { /** - * Specifies the sku property: The sku property.. + * Specifies the plan property: Details of the resource plan.. * - * @param sku The sku property. + * @param plan Details of the resource plan. * @return the next definition stage. */ - WithCreate withSku(ResourceModelWithAllowedPropertySetSku sku); + WithCreate withPlan(Plan plan); } /** - * The stage of the Workspace definition allowing to specify plan. + * The stage of the Workspace definition allowing to specify sku. */ - interface WithPlan { + interface WithSku { /** - * Specifies the plan property: The plan property.. + * Specifies the sku property: The SKU (Stock Keeping Unit) assigned to this resource.. * - * @param plan The plan property. + * @param sku The SKU (Stock Keeping Unit) assigned to this resource. * @return the next definition stage. */ - WithCreate withPlan(ResourceModelWithAllowedPropertySetPlan plan); + WithCreate withSku(Sku sku); } /** @@ -412,8 +412,7 @@ interface WithPublicNetworkAccess { /** * The template for Workspace update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithDescription, UpdateStages.WithFriendlyName, - UpdateStages.WithApplicationGroupReferences, UpdateStages.WithPublicNetworkAccess { + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { /** * Executes the update request. * @@ -448,56 +447,16 @@ interface WithTags { } /** - * The stage of the Workspace update allowing to specify description. + * The stage of the Workspace update allowing to specify properties. */ - interface WithDescription { - /** - * Specifies the description property: Description of Workspace.. - * - * @param description Description of Workspace. - * @return the next definition stage. - */ - Update withDescription(String description); - } - - /** - * The stage of the Workspace update allowing to specify friendlyName. - */ - interface WithFriendlyName { - /** - * Specifies the friendlyName property: Friendly name of Workspace.. - * - * @param friendlyName Friendly name of Workspace. - * @return the next definition stage. - */ - Update withFriendlyName(String friendlyName); - } - - /** - * The stage of the Workspace update allowing to specify applicationGroupReferences. - */ - interface WithApplicationGroupReferences { - /** - * Specifies the applicationGroupReferences property: List of applicationGroup links.. - * - * @param applicationGroupReferences List of applicationGroup links. - * @return the next definition stage. - */ - Update withApplicationGroupReferences(List applicationGroupReferences); - } - - /** - * The stage of the Workspace update allowing to specify publicNetworkAccess. - */ - interface WithPublicNetworkAccess { + interface WithProperties { /** - * Specifies the publicNetworkAccess property: Enabled to allow this resource to be access from the public - * network. + * Specifies the properties property: Detailed properties for Workspace. * - * @param publicNetworkAccess Enabled to allow this resource to be access from the public network. + * @param properties Detailed properties for Workspace. * @return the next definition stage. */ - Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + Update withProperties(WorkspacePatchProperties properties); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspaceList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspaceList.java index cca1d1c61fc7..e6a241ae08fe 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspaceList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspaceList.java @@ -5,6 +5,7 @@ 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; @@ -14,19 +15,17 @@ import java.util.List; /** - * WorkspaceList - * * List of Workspace definitions. */ @Fluent public final class WorkspaceList implements JsonSerializable { /* - * List of Workspace definitions. + * The Workspace items on this page */ private List value; /* - * Link to the next page of results. + * The link to the next page of items */ private String nextLink; @@ -37,7 +36,7 @@ public WorkspaceList() { } /** - * Get the value property: List of Workspace definitions. + * Get the value property: The Workspace items on this page. * * @return the value value. */ @@ -46,7 +45,7 @@ public List value() { } /** - * Set the value property: List of Workspace definitions. + * Set the value property: The Workspace items on this page. * * @param value the value value to set. * @return the WorkspaceList object itself. @@ -57,7 +56,7 @@ public WorkspaceList withValue(List value) { } /** - * Get the nextLink property: Link to the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,17 +64,33 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the WorkspaceList object itself. + */ + public WorkspaceList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model WorkspaceList")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(WorkspaceList.class); + /** * {@inheritDoc} */ @@ -83,6 +98,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -92,6 +108,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of WorkspaceList 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 WorkspaceList. */ public static WorkspaceList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspacePatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspacePatch.java index f7e3f2dbdadd..ce9f17fa79f0 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspacePatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspacePatch.java @@ -9,13 +9,11 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.WorkspacePatchProperties; import java.io.IOException; -import java.util.List; import java.util.Map; /** - * Workspace properties that can be patched. + * Workspace properties that can be patched.A patch model. */ @Fluent public final class WorkspacePatch implements JsonSerializable { @@ -27,7 +25,7 @@ public final class WorkspacePatch implements JsonSerializable { /* * Detailed properties for Workspace */ - private WorkspacePatchProperties innerProperties; + private WorkspacePatchProperties properties; /** * Creates an instance of WorkspacePatch class. @@ -56,103 +54,22 @@ public WorkspacePatch withTags(Map tags) { } /** - * Get the innerProperties property: Detailed properties for Workspace. + * Get the properties property: Detailed properties for Workspace. * - * @return the innerProperties value. + * @return the properties value. */ - private WorkspacePatchProperties innerProperties() { - return this.innerProperties; + public WorkspacePatchProperties properties() { + return this.properties; } /** - * Get the description property: Description of Workspace. + * Set the properties property: Detailed properties for Workspace. * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Description of Workspace. - * - * @param description the description value to set. + * @param properties the properties value to set. * @return the WorkspacePatch object itself. */ - public WorkspacePatch withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspacePatchProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the friendlyName property: Friendly name of Workspace. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); - } - - /** - * Set the friendlyName property: Friendly name of Workspace. - * - * @param friendlyName the friendlyName value to set. - * @return the WorkspacePatch object itself. - */ - public WorkspacePatch withFriendlyName(String friendlyName) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspacePatchProperties(); - } - this.innerProperties().withFriendlyName(friendlyName); - return this; - } - - /** - * Get the applicationGroupReferences property: List of applicationGroup links. - * - * @return the applicationGroupReferences value. - */ - public List applicationGroupReferences() { - return this.innerProperties() == null ? null : this.innerProperties().applicationGroupReferences(); - } - - /** - * Set the applicationGroupReferences property: List of applicationGroup links. - * - * @param applicationGroupReferences the applicationGroupReferences value to set. - * @return the WorkspacePatch object itself. - */ - public WorkspacePatch withApplicationGroupReferences(List applicationGroupReferences) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspacePatchProperties(); - } - this.innerProperties().withApplicationGroupReferences(applicationGroupReferences); - return this; - } - - /** - * Get the publicNetworkAccess property: Enabled to allow this resource to be access from the public network. - * - * @return the publicNetworkAccess value. - */ - public PublicNetworkAccess publicNetworkAccess() { - return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); - } - - /** - * Set the publicNetworkAccess property: Enabled to allow this resource to be access from the public network. - * - * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the WorkspacePatch object itself. - */ - public WorkspacePatch withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspacePatchProperties(); - } - this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + public WorkspacePatch withProperties(WorkspacePatchProperties properties) { + this.properties = properties; return this; } @@ -162,8 +79,8 @@ public WorkspacePatch withPublicNetworkAccess(PublicNetworkAccess publicNetworkA * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -174,7 +91,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -197,7 +114,7 @@ public static WorkspacePatch fromJson(JsonReader jsonReader) throws IOException Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedWorkspacePatch.tags = tags; } else if ("properties".equals(fieldName)) { - deserializedWorkspacePatch.innerProperties = WorkspacePatchProperties.fromJson(reader); + deserializedWorkspacePatch.properties = WorkspacePatchProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspacePatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspacePatchProperties.java similarity index 97% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspacePatchProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspacePatchProperties.java index 6c3ccc7951e1..90ad23773286 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspacePatchProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspacePatchProperties.java @@ -2,14 +2,13 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.desktopvirtualization.fluent.models; +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.models.PublicNetworkAccess; import java.io.IOException; import java.util.List; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Workspaces.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Workspaces.java index c584e21924b3..3254dfa3c557 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Workspaces.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Workspaces.java @@ -13,100 +13,100 @@ */ public interface Workspaces { /** - * Get a workspace. + * List workspaces in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a workspace along with {@link Response}. + * @return list of Workspace definitions as paginated response with {@link PagedIterable}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, Context context); + PagedIterable list(); /** - * Get a workspace. + * List workspaces in subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a workspace. + * @return list of Workspace definitions as paginated response with {@link PagedIterable}. */ - Workspace getByResourceGroup(String resourceGroupName, String workspaceName); + PagedIterable list(Context context); /** - * Remove a workspace. + * List workspaces. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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}. + * @return list of Workspace definitions as paginated response with {@link PagedIterable}. */ - Response deleteByResourceGroupWithResponse(String resourceGroupName, String workspaceName, Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Remove a workspace. + * List workspaces. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param pageSize Number of items per page. + * @param isDescending Indicates whether the collection is descending. + * @param initialSkip Initial number of items to skip. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Workspace definitions as paginated response with {@link PagedIterable}. */ - void deleteByResourceGroup(String resourceGroupName, String workspaceName); + PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, + Integer initialSkip, Context context); /** - * List workspaces. + * Get a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList as paginated response with {@link PagedIterable}. + * @return a workspace along with {@link Response}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, Context context); /** - * List workspaces. + * Get a workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param pageSize Number of items per page. - * @param isDescending Indicates whether the collection is descending. - * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. + * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList as paginated response with {@link PagedIterable}. + * @return a workspace. */ - PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, - Integer initialSkip, Context context); + Workspace getByResourceGroup(String resourceGroupName, String workspaceName); /** - * List workspaces in subscription. + * Remove a workspace. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - PagedIterable list(); + Response deleteByResourceGroupWithResponse(String resourceGroupName, String workspaceName, Context context); /** - * List workspaces in subscription. + * Remove a workspace. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaceList as paginated response with {@link PagedIterable}. */ - PagedIterable list(Context context); + void deleteByResourceGroup(String resourceGroupName, String workspaceName); /** * Get a workspace. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/package-info.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/package-info.java index ac9ee1c6643f..c598bd103c8d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/package-info.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/package-info.java @@ -4,6 +4,6 @@ /** * Package containing the data models for DesktopVirtualizationApiClient. - * null. + * This Typespec represents the Desktop Virtualization API interfaces. */ package com.azure.resourcemanager.desktopvirtualization.models; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/package-info.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/package-info.java index 5240260090e6..7b364fdb88aa 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/package-info.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/package-info.java @@ -4,6 +4,6 @@ /** * Package containing the classes for DesktopVirtualizationApiClient. - * null. + * This Typespec represents the Desktop Virtualization API interfaces. */ package com.azure.resourcemanager.desktopvirtualization; 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..e20783a736e7 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.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..2af3df194260 --- /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-08-08-preview/ + * examples/ActiveSessionHostConfigurations_Get.json + */ + /** + * Sample code: ActiveSessionHostConfigurations_Get. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void activeSessionHostConfigurationsGet( + 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..c71a8b57947f --- /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-08-08-preview/ + * examples/ActiveSessionHostConfigurations_ListByHostPool.json + */ + /** + * Sample code: ActiveSessionHostConfigurations_ListByHostPool. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void activeSessionHostConfigurationsListByHostPool( + 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..ce85de58265c 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.desktopvirtualization.generated; 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; @@ -18,8 +17,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-08-08-preview/ + * examples/AppAttachPackage_CreateOrUpdate.json */ /** * Sample code: AppAttachPackage_Create. @@ -32,34 +31,33 @@ public final class AppAttachPackageCreateOrUpdateSamples { .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)) + .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("") + .withFailHealthCheckOnStagingFailure(FailHealthCheckOnStagingFailure.NEEDS_ASSISTANCE) .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..391f0e068071 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-08-08-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..a207ec714375 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-08-08-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..c77fdee6d81f 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-08-08-preview/ + * examples/AppAttachPackageInfo_Import.json */ /** * Sample code: AppAttachPackageInfo_Import. @@ -24,7 +24,9 @@ public final class AppAttachPackageInfoImportMethodSamples { 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); + .importMethod("resourceGroup1", "hostpool1", + new ImportPackageInfoRequest().withPath("https://url.com/imagePath") + .withPackageArchitecture(AppAttachPackageArchitectures.X64), + com.azure.core.util.Context.NONE); } } 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..6e3bb0b093a0 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-08-08-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..999250f648f7 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-08-08-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..0b1e1d0246e3 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 @@ -5,6 +5,13 @@ package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackage; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackagePatchProperties; +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 Update. @@ -12,8 +19,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-08-08-preview/ + * examples/AppAttachPackage_Update.json */ /** * Sample code: AppAttachPackage_Update. @@ -25,6 +32,37 @@ public final class AppAttachPackageUpdateSamples { AppAttachPackage resource = manager.appAttachPackages() .getByResourceGroupWithResponse("resourceGroup1", "msixpackagefullname", com.azure.core.util.Context.NONE) .getValue(); - resource.update().apply(); + resource.update() + .withProperties(new AppAttachPackagePatchProperties() + .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( + "/subscriptions/d15725f7-6577-4a8c-95f1-3da903b42364/resourcegroups/charlesk-southcentralus/providers/Microsoft.DesktopVirtualization/hostPool/hp1", + "/subscriptions/d15725f7-6577-4a8c-95f1-3da903b42364/resourcegroups/charlesk-southcentralus/providers/Microsoft.DesktopVirtualization/hostPool/hp2")) + .withKeyVaultUrl("fakeTokenPlaceholder") + .withFailHealthCheckOnStagingFailure(FailHealthCheckOnStagingFailure.DO_NOT_FAIL)) + .apply(); } } 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..02fa29c7bb1c 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-08-08-preview/ + * examples/ApplicationGroups_CreateOrUpdate.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..c35fc652d142 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,16 +10,16 @@ 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-08-08-preview/ + * examples/ApplicationGroups_Delete.json */ /** - * Sample code: ApplicationGroup_Delete. + * Sample code: ApplicationGroups_Delete. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - applicationGroupDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + applicationGroupsDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.applicationGroups() .deleteByResourceGroupWithResponse("resourceGroup1", "applicationGroup1", com.azure.core.util.Context.NONE); } 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..7055bfdc652f 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-08-08-preview/ + * examples/ApplicationGroups_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..34c88566e2c7 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-08-08-preview/ + * examples/ApplicationGroups_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..8edf8f866b2e 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-08-08-preview/ + * examples/ApplicationGroups_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..4f07b5625a45 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroup; +import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupPatchProperties; import java.util.HashMap; import java.util.Map; @@ -14,24 +15,24 @@ 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-08-08-preview/ + * examples/ApplicationGroups_Update.json */ /** - * Sample code: ApplicationGroups_Update. + * Sample code: ApplicationGroup_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - applicationGroupsUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + applicationGroupUpdate(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) + .withProperties(new ApplicationGroupPatchProperties().withDescription("des1") + .withFriendlyName("friendly") + .withShowInFeed(true)) .apply(); } 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..01b1b53c355f 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,16 +12,16 @@ 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-08-08-preview/ + * examples/Applications_CreateOrUpdate.json */ /** - * Sample code: Application_Create. + * Sample code: Applications_CreateOrUpdate. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void - applicationCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + public static void applicationsCreateOrUpdate( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.applications() .define("application1") .withExistingApplicationGroup("resourceGroup1", "applicationGroup1") 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..7892dae17bbb 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,16 +10,16 @@ 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-08-08-preview/ + * examples/Applications_Delete.json */ /** - * Sample code: Application_Delete. + * Sample code: Applications_Delete. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - applicationDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + applicationsDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.applications() .deleteWithResponse("resourceGroup1", "applicationGroup1", "application1", com.azure.core.util.Context.NONE); 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..096d015f13a7 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,16 +10,16 @@ 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-08-08-preview/ + * examples/Applications_Get.json */ /** - * Sample code: Application_Get. + * Sample code: Applications_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - applicationGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + applicationsGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.applications() .getWithResponse("resourceGroup1", "applicationGroup1", "application1", com.azure.core.util.Context.NONE); } 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..5a5a9a0db3c4 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-08-08-preview/ + * examples/Applications_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..a62c352bd4eb 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.resourcemanager.desktopvirtualization.models.Application; +import com.azure.resourcemanager.desktopvirtualization.models.ApplicationPatchProperties; import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; @@ -14,29 +15,29 @@ 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-08-08-preview/ + * examples/Applications_Update.json */ /** - * Sample code: Application_Update. + * Sample code: Applications_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - applicationUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + applicationsUpdate(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) + .withProperties(new ApplicationPatchProperties().withDescription("des1") + .withFriendlyName("friendly") + .withFilePath("path") + .withCommandLineSetting(CommandLineSetting.ALLOW) + .withCommandLineArguments("arguments") + .withShowInPortal(true) + .withIconPath("icon") + .withIconIndex(1) + .withApplicationType(RemoteApplicationType.IN_BUILT)) .apply(); } } 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..c4cf3fda7b2b --- /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-08-08-preview/ + * examples/SessionHostManagements_ControlSessionHostUpdate_Post.json + */ + /** + * Sample code: SessionHostManagements_ControlSessionHostUpdate_Post. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostManagementsControlSessionHostUpdatePost( + 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..4eb249730b08 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,16 +10,16 @@ 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-08-08-preview/ + * examples/Desktops_Get.json */ /** - * Sample code: Desktop_Get. + * Sample code: Desktops_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - desktopGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + desktopsGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.desktops() .getWithResponse("resourceGroup1", "applicationGroup1", "SessionDesktop", com.azure.core.util.Context.NONE); } 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..4eeb036f8e16 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,16 +10,16 @@ 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-08-08-preview/ + * examples/Desktops_List.json */ /** - * Sample code: Desktop_List. + * Sample code: Desktops_List. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - desktopList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + desktopsList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.desktops().list("resourceGroup1", "applicationGroup1", 10, true, 0, com.azure.core.util.Context.NONE); } } 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..1b9536a56aa8 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.resourcemanager.desktopvirtualization.models.DesktopPatch; +import com.azure.resourcemanager.desktopvirtualization.models.DesktopPatchProperties; /** * Samples for Desktops Update. @@ -12,19 +13,20 @@ 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-08-08-preview/ + * examples/Desktops_Update.json */ /** - * Sample code: Desktop_Update. + * Sample code: Desktops_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - desktopUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + desktopsUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.desktops() .updateWithResponse("resourceGroup1", "applicationGroup1", "SessionDesktop", - new DesktopPatch().withDescription("des1").withFriendlyName("friendly"), + new DesktopPatch() + .withProperties(new DesktopPatchProperties().withDescription("des1").withFriendlyName("friendly")), com.azure.core.util.Context.NONE); } } 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..0316505b62fd 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,16 +31,16 @@ 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-08-08-preview/ + * examples/HostPool_CreateOrUpdate.json */ /** - * Sample code: HostPool_Create. + * Sample code: HostPools_CreateOrUpdate. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - hostPoolCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + hostPoolsCreateOrUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.hostPools() .define("hostPool1") .withRegion("centralus") @@ -63,6 +68,11 @@ 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) + .withManagementType(ManagementType.AUTOMATED) .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..41ac3d128a23 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,16 +10,16 @@ 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-08-08-preview/ + * examples/HostPools_Delete.json */ /** - * Sample code: HostPool_Delete. + * Sample code: HostPools_Delete. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - hostPoolDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + hostPoolsDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.hostPools().deleteWithResponse("resourceGroup1", "hostPool1", true, com.azure.core.util.Context.NONE); } } 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..54e1e1a41aa6 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,16 +10,16 @@ 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-08-08-preview/ + * examples/HostPools_Get.json */ /** - * Sample code: HostPool_Get. + * Sample code: HostPools_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - hostPoolGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + hostPoolsGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.hostPools() .getByResourceGroupWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); } 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..6b33db3cb277 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,15 +10,15 @@ 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-08-08-preview/ + * examples/HostPools_ListByResourceGroup.json */ /** - * Sample code: HostPool_ListByResourceGroup. + * Sample code: HostPools_ListByResourceGroup. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void hostPoolListByResourceGroup( + public static void hostPoolsListByResourceGroup( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.hostPools().listByResourceGroup("resourceGroup1", 10, true, 0, com.azure.core.util.Context.NONE); } 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..a2ff6a3941d4 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,15 +10,15 @@ 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-08-08-preview/ + * examples/HostPools_ListRegistrationTokens.json */ /** - * Sample code: HostPools_ListRegistrationToken_Post. + * Sample code: HostPools_ListRegistrationTokens. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void hostPoolsListRegistrationTokenPost( + public static void hostPoolsListRegistrationTokens( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.hostPools() .listRegistrationTokensWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); 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..0064202fed76 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-08-08-preview/ + * examples/HostPool_Lists.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..6add0d69de55 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,15 +10,15 @@ 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-08-08-preview/ + * examples/HostPools_RetrieveRegistrationToken.json */ /** - * Sample code: HostPools_RetrieveRegistrationToken_Post. + * Sample code: HostPools_RetrieveRegistrationToken. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void hostPoolsRetrieveRegistrationTokenPost( + public static void hostPoolsRetrieveRegistrationToken( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.hostPools() .retrieveRegistrationTokenWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); 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..c1ea5aeca821 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,17 @@ 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.HostPoolPatchProperties; 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,42 +30,46 @@ 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-08-08-preview/ + * examples/HostPools_Update.json */ /** - * Sample code: HostPool_Update. + * Sample code: HostPools_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - hostPoolUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + hostPoolsUpdate(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)))) + .withProperties( + new HostPoolPatchProperties().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("fakeTokenPlaceholder") + .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)))) + .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..6da1450cfb31 --- /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-08-08-preview/ + * examples/SessionHostManagements_UpdateSessionHosts_Post.json + */ + /** + * Sample code: SessionHostManagements_UpdateSessionHosts_Post. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostManagementsUpdateSessionHostsPost( + 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..cf52575530d8 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,18 +12,18 @@ 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-08-08-preview/ + * examples/MsixImages_Expand.json */ /** - * Sample code: MsixImage_Expand. + * Sample code: MsixImages_Expand. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - msixImageExpand(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + msixImagesExpand(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.msixImages() - .expand("resourceGroup1", "hostpool1", new MsixImageUri().withUri("imagepath"), + .expand("resourceGroup1", "hostpool1", new MsixImageUri().withUri("https://url.com/imagePath"), com.azure.core.util.Context.NONE); } } 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..4e6cdba11e40 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,16 +15,16 @@ 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-08-08-preview/ + * examples/MsixPackages_CreateOrUpdate.json */ /** - * Sample code: MSIXPackage_Create. + * Sample code: MsixPackages_Create. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - mSIXPackageCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + msixPackagesCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.msixPackages() .define("msixpackagefullname") .withExistingHostPool("resourceGroup1", "hostpool1") 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..02f25c54a9db 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,16 +10,16 @@ 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-08-08-preview/ + * examples/MsixPackages_Delete.json */ /** - * Sample code: MSIXPackage_Delete. + * Sample code: MsixPackages_Delete. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - mSIXPackageDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + msixPackagesDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.msixPackages() .deleteWithResponse("resourceGroup1", "hostpool1", "packagefullname", com.azure.core.util.Context.NONE); } 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..da8a8b18541a 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,16 +10,16 @@ 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-08-08-preview/ + * examples/MSIXPackages_Get.json */ /** - * Sample code: MSIXPackage_Get. + * Sample code: MSIXPackages_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - mSIXPackageGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + mSIXPackagesGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.msixPackages() .getWithResponse("resourceGroup1", "hostpool1", "packagefullname", com.azure.core.util.Context.NONE); } 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..5b81c320c80d 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,16 +10,16 @@ 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-08-08-preview/ + * examples/MSIXPackages_List.json */ /** - * Sample code: MSIXPackage_List. + * Sample code: MSIXPackages_List. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - mSIXPackageList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + mSIXPackagesList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.msixPackages().list("resourceGroup1", "hostpool1", 10, true, 0, com.azure.core.util.Context.NONE); } } 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..3709eedb882e 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackage; +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackagePatchProperties; /** * Samples for MsixPackages Update. @@ -12,19 +13,23 @@ 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-08-08-preview/ + * examples/MsixPackages_Update.json */ /** - * Sample code: MSIXPackage_Update. + * Sample code: MsixPackage_Update. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - mSIXPackageUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + 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(); + resource.update() + .withProperties(new MsixPackagePatchProperties().withIsActive(true) + .withIsRegularRegistration(false) + .withDisplayName("displayname")) + .apply(); } } 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..2429f2d37d88 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,16 +10,16 @@ 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-08-08-preview/ + * examples/Operations_List.json */ /** - * Sample code: OperationDescription_List. + * Sample code: List Provider Operations. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - operationDescriptionList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + listProviderOperations(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.operations().list(com.azure.core.util.Context.NONE); } } 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..f2369d22b86d 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,15 +10,15 @@ 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-08-08-preview/ + * examples/PrivateEndpointConnections_DeleteByHostPool.json */ /** - * Sample code: PrivateEndpointConnection_DeleteByHostPool. + * Sample code: PrivateEndpointConnections_DeleteByHostPool. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionDeleteByHostPool( + public static void privateEndpointConnectionsDeleteByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.privateEndpointConnections() .deleteByHostPoolWithResponse("resourceGroup1", "hostPool1", 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..fa265d84b665 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,15 +10,15 @@ 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-08-08-preview/ + * examples/PrivateEndpointConnections_DeleteByWorkspace.json */ /** - * Sample code: PrivateEndpointConnection_DeleteByWorkspace. + * Sample code: PrivateEndpointConnections_DeleteByWorkspace. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionDeleteByWorkspace( + public static void privateEndpointConnectionsDeleteByWorkspace( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.privateEndpointConnections() .deleteByWorkspaceWithResponse("resourceGroup1", "workspace1", 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..619955a1d407 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,15 +10,15 @@ 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-08-08-preview/ + * examples/PrivateEndpointConnections_GetByHostPool.json */ /** - * Sample code: PrivateEndpointConnection_GetByHostPool. + * Sample code: PrivateEndpointConnections_GetByHostPool. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionGetByHostPool( + public static void privateEndpointConnectionsGetByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.privateEndpointConnections() .getByHostPoolWithResponse("resourceGroup1", "hostPool1", "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", 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..d5371a219ce2 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,15 +10,15 @@ 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-08-08-preview/ + * examples/PrivateEndpointConnections_GetByWorkspace.json */ /** - * Sample code: PrivateEndpointConnection_GetByWorkspace. + * Sample code: PrivateEndpointConnections_GetByWorkspace. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionGetByWorkspace( + public static void privateEndpointConnectionsGetByWorkspace( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.privateEndpointConnections() .getByWorkspaceWithResponse("resourceGroup1", "workspace1", 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..c914e9e45058 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,15 +10,15 @@ 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-08-08-preview/ + * examples/PrivateEndpointConnections_ListByHostPool.json */ /** - * Sample code: PrivateEndpointConnection_ListByHostPool. + * Sample code: PrivateEndpointConnections_ListByHostPool. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionListByHostPool( + public static void privateEndpointConnectionsListByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.privateEndpointConnections() .listByHostPool("resourceGroup1", "hostPool1", null, null, null, com.azure.core.util.Context.NONE); 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..e26a672d7dcf 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,15 +10,15 @@ 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-08-08-preview/ + * examples/PrivateEndpointConnections_ListByWorkspace.json */ /** - * Sample code: PrivateEndpointConnection_ListByWorkspace. + * Sample code: PrivateEndpointConnections_ListByWorkspace. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionListByWorkspace( + public static void privateEndpointConnectionsListByWorkspace( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.privateEndpointConnections() .listByWorkspace("resourceGroup1", "workspace1", com.azure.core.util.Context.NONE); 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..7bee45d923af 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 @@ -4,7 +4,7 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionWithSystemDataInner; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; @@ -14,20 +14,20 @@ 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-08-08-preview/ + * examples/PrivateEndpointConnections_UpdateByHostPool.json */ /** - * Sample code: PrivateEndpointConnection_UpdateByHostPool. + * Sample code: PrivateEndpointConnections_UpdateByHostPool. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionUpdateByHostPool( + public static void privateEndpointConnectionsUpdateByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.privateEndpointConnections() .updateByHostPoolWithResponse("resourceGroup1", "hostPool1", "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", - new PrivateEndpointConnection().withPrivateLinkServiceConnectionState( + new PrivateEndpointConnectionWithSystemDataInner().withPrivateLinkServiceConnectionState( new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) .withDescription("Approved by admin@consoto.com") .withActionsRequired("None")), 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..36bba5261a2c 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 @@ -4,7 +4,7 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionWithSystemDataInner; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; @@ -14,20 +14,20 @@ 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-08-08-preview/ + * examples/PrivateEndpointConnections_UpdateByWorkspace.json */ /** - * Sample code: PrivateEndpointConnection_UpdateByWorkspace. + * Sample code: PrivateEndpointConnections_UpdateByWorkspace. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void privateEndpointConnectionUpdateByWorkspace( + public static void privateEndpointConnectionsUpdateByWorkspace( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.privateEndpointConnections() .updateByWorkspaceWithResponse("resourceGroup1", "workspace1", "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", - new PrivateEndpointConnection().withPrivateLinkServiceConnectionState( + new PrivateEndpointConnectionWithSystemDataInner().withPrivateLinkServiceConnectionState( new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) .withDescription("Approved by admin@consoto.com") .withActionsRequired("None")), 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..db1120ac120b 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-08-08-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..64989089f132 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-08-08-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..4a5ea1d58882 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-08-08-preview/ + * examples/ScalingPlanPersonalSchedules_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..35753304d5f6 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-08-08-preview/ + * examples/ScalingPlanPersonalSchedules_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..2b2f1ac9cc12 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-08-08-preview/ + * examples/ScalingPlanPersonalSchedules_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..0bb55dca7531 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-08-08-preview/ + * examples/ScalingPlanPersonalSchedules_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..18b4328b8343 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedule; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedulePatchProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; import com.azure.resourcemanager.desktopvirtualization.models.Time; @@ -15,8 +16,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-08-08-preview/ + * examples/ScalingPlanPersonalSchedules_Update.json */ /** * Sample code: ScalingPlanPersonalSchedules_Update. @@ -30,22 +31,23 @@ public static void scalingPlanPersonalSchedulesUpdate( 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) + .withProperties( + new ScalingPlanPersonalSchedulePatchProperties().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(); } } 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..88ce913db975 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 @@ -15,8 +15,8 @@ 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-08-08-preview/ + * examples/ScalingPlanPooledSchedules_Create.json */ /** * Sample code: ScalingPlanPooledSchedules_Create. @@ -31,19 +31,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..6a55ab3682ed 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-08-08-preview/ + * examples/ScalingPlanPooledSchedules_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..3ff3020d3d1c 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-08-08-preview/ + * examples/ScalingPlanPooledSchedules_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..7f4702ec894f 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-08-08-preview/ + * examples/ScalingPlanPooledSchedules_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..c59262c11379 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 @@ -6,6 +6,7 @@ import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedule; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedulePatchProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.Time; import java.util.Arrays; @@ -16,8 +17,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-08-08-preview/ + * examples/ScalingPlanPooledSchedules_Update.json */ /** * Sample code: ScalingPlanPooledSchedules_Update. @@ -31,14 +32,15 @@ public static void scalingPlanPooledSchedulesUpdate( 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) + .withProperties(new ScalingPlanPooledSchedulePatchProperties() + .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(); } } 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..4c63aaed96b8 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-08-08-preview/ + * examples/ScalingPlans_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..1709bb332531 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-08-08-preview/ + * examples/ScalingPlans_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..d11bfb1a33b0 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-08-08-preview/ + * examples/ScalingPlans_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..978b01c6f59e 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,15 +10,15 @@ 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-08-08-preview/ + * examples/ScalingPlans_ListByHostPool.json */ /** - * Sample code: ScalingPlan_ListByHostPool. + * Sample code: ScalingPlans_ListByHostPool. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlanListByHostPool( + public static void scalingPlansListByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.scalingPlans() .listByHostPool("resourceGroup1", "hostPool1", 10, true, 0, com.azure.core.util.Context.NONE); 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..52afc8595079 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-08-08-preview/ + * examples/ScalingPlans_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..570374fe983a 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-08-08-preview/ + * examples/ScalingPlans_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..f426846865ae 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 @@ -4,7 +4,16 @@ 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.ScalingPlan; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPatchProperties; +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 ScalingPlans Update. @@ -12,8 +21,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-08-08-preview/ + * examples/ScalingPlans_Update.json */ /** * Sample code: ScalingPlans_Update. @@ -25,6 +34,45 @@ public final class ScalingPlansUpdateSamples { ScalingPlan resource = manager.scalingPlans() .getByResourceGroupWithResponse("resourceGroup1", "scalingPlan1", com.azure.core.util.Context.NONE) .getValue(); - resource.update().apply(); + resource.update() + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withProperties(new ScalingPlanPatchProperties().withDescription("Description of Scaling Plan") + .withFriendlyName("Scaling Plan 1") + .withTimeZone("Central Standard Time") + .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)))) + .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; } } 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..7f3caf30d909 --- /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-08-08-preview/ + * examples/SessionHostConfigurations_CreateOrUpdate.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().withType(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..af23e067c6fb --- /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-08-08-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..6168c3053366 --- /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-08-08-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..9b17c91b5cd9 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostConfigurationsUpdateSamples.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.SessionHostConfigurationPatchProperties; +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-08-08-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().withProperties(new SessionHostConfigurationPatchProperties() + .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().withType(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..bf1d5f77cb45 --- /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-08-08-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..3b83736487b1 --- /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-08-08-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..45a35f0417bb --- /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-08-08-preview/ + * examples/SessionHostManagements_ListByHostPool.json + */ + /** + * Sample code: SessionHostManagements_ListByHostPool. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostManagementsListByHostPool( + 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..b6c544c5a7cc --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsUpdateSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementPatch; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementPatchProperties; + +/** + * Samples for SessionHostManagements Update. + */ +public final class SessionHostManagementsUpdateSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-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().withProperties( + new SessionHostManagementPatchProperties().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..c9df0c2b4d0f --- /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-08-08-preview/ + * examples/SessionHostManagementsUpdateStatus_Get.json + */ + /** + * Sample code: SessionHostManagementsUpdateStatus_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/SessionHostsDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsDeleteSamples.java index 1d4fd832d03b..7dfa681476d7 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-08-08-preview/ + * examples/SessionHosts_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..e833ae97d8fc 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-08-08-preview/ + * examples/SessionHosts_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..33aa28ce8f1c 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-08-08-preview/ + * examples/SessionHosts_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/SessionHostsRetryProvisioningSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsRetryProvisioningSamples.java new file mode 100644 index 000000000000..d3b707d73b58 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsRetryProvisioningSamples.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 SessionHosts RetryProvisioning. + */ +public final class SessionHostsRetryProvisioningSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/ + * examples/SessionHost_RetryProvisioning_Post.json + */ + /** + * Sample code: SessionHosts_RetryProvisioning_Post. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostsRetryProvisioningPost( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHosts() + .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/SessionHostsUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsUpdateSamples.java index 9dd436628b88..7ad1ca14afc8 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatch; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatchProperties; /** * Samples for SessionHosts Update. @@ -12,8 +13,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-08-08-preview/ + * examples/SessionHosts_Update.json */ /** * Sample code: SessionHost_Update. @@ -24,9 +25,9 @@ public final class SessionHostsUpdateSamples { sessionHostUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.sessionHosts() .updateWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", true, - new SessionHostPatch().withAllowNewSession(true) + new SessionHostPatch().withProperties(new SessionHostPatchProperties().withAllowNewSession(true) .withAssignedUser("user1@microsoft.com") - .withFriendlyName("friendly"), + .withFriendlyName("friendly")), com.azure.core.util.Context.NONE); } } 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..da6986050915 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,16 +10,16 @@ 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-08-08-preview/ + * examples/StartMenuItems_List.json */ /** - * Sample code: StartMenuItem_List. + * Sample code: StartMenuItems_List. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - startMenuItemList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + startMenuItemsList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.startMenuItems() .list("resourceGroup1", "applicationGroup1", null, null, null, com.azure.core.util.Context.NONE); } 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..73af56fccf4a 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-08-08-preview/ + * examples/UserSessions_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..63839e5f2745 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-08-08-preview/ + * examples/UserSessions_Disconnect.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..3bbb2c0b2291 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,16 +10,16 @@ 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-08-08-preview/ + * examples/UserSession_Get.json */ /** - * Sample code: UserSession_Get. + * Sample code: UserSessions_Get. * * @param manager Entry point to DesktopVirtualizationManager. */ public static void - userSessionGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + userSessionsGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.userSessions() .getWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", com.azure.core.util.Context.NONE); 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..04c7eee3bcf1 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-08-08-preview/ + * examples/UserSessions_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..c46f4338501b 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-08-08-preview/ + * examples/UserSessions_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..b699219d5d67 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-08-08-preview/ + * examples/UserSessions_SendMessage.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..50d11387c3c1 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-08-08-preview/ + * examples/Workspaces_CreateOrUpdate.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..7dcb75b0c232 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-08-08-preview/ + * examples/Workspaces_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..1b754ba42b19 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-08-08-preview/ + * examples/Workspaces_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..e79e0a9205c6 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-08-08-preview/ + * examples/Workspaces_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..dc9af7378a3c 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,15 +10,15 @@ 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-08-08-preview/ + * examples/Workspaces_ListBySubscription.json */ /** - * Sample code: Workspace_ListBySubscription. + * Sample code: Workspaces_ListBySubscription. * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void workspaceListBySubscription( + public static void workspacesListBySubscription( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.workspaces().list(com.azure.core.util.Context.NONE); } 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..19b9071a0a60 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.resourcemanager.desktopvirtualization.models.Workspace; +import com.azure.resourcemanager.desktopvirtualization.models.WorkspacePatchProperties; import java.util.HashMap; import java.util.Map; @@ -14,8 +15,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-08-08-preview/ + * examples/Workspaces_Update.json */ /** * Sample code: Workspace_Update. @@ -29,8 +30,7 @@ public final class WorkspacesUpdateSamples { .getValue(); resource.update() .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withDescription("des1") - .withFriendlyName("friendly") + .withProperties(new WorkspacePatchProperties().withDescription("des1").withFriendlyName("friendly")) .apply(); } 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); - - } -}